diff options
author | Matthew Hodgson <matthew@matrix.org> | 2016-05-23 22:55:11 +0100 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2016-05-23 22:55:11 +0100 |
commit | 680f1d9387f48ced9902f4e7d54758ab6a0aa9b0 (patch) | |
tree | 3850e300e6528393386bb55858c6412602a5bed0 /synapse/util/presentable_names.py | |
parent | fix NPE in room ordering (diff) | |
download | synapse-680f1d9387f48ced9902f4e7d54758ab6a0aa9b0.tar.xz |
catch thinko in presentable names
Diffstat (limited to 'synapse/util/presentable_names.py')
-rw-r--r-- | synapse/util/presentable_names.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/synapse/util/presentable_names.py b/synapse/util/presentable_names.py index 3efa8a8206..a6866f6117 100644 --- a/synapse/util/presentable_names.py +++ b/synapse/util/presentable_names.py @@ -14,6 +14,9 @@ # limitations under the License. import re +import logging + +logger = logging.getLogger(__name__) # intentionally looser than what aliases we allow to be registered since # other HSes may allow aliases that we would not @@ -105,13 +108,21 @@ def calculate_room_name(room_state, user_id, fallback_to_members=True): # or inbound invite, or outbound 3PID invite. if all_members[0].sender == user_id: if "m.room.third_party_invite" in room_state_bytype: - third_party_invites = room_state_bytype["m.room.third_party_invite"] + third_party_invites = ( + room_state_bytype["m.room.third_party_invite"].values() + ) + if len(third_party_invites) > 0: # technically third party invite events are not member # events, but they are close enough - return "Inviting %s" ( - descriptor_from_member_events(third_party_invites) - ) + + # FIXME: no they're not - they look nothing like a member; + # they have a great big encrypted thing as their name to + # prevent leaking the 3PID name... + # return "Inviting %s" % ( + # descriptor_from_member_events(third_party_invites) + # ) + return "Inviting email address" else: return ALL_ALONE else: |