catch thinko in presentable names

This commit is contained in:
Matthew Hodgson 2016-05-23 22:55:11 +01:00
parent cb8a321bdd
commit 680f1d9387
1 changed files with 15 additions and 4 deletions

View File

@ -14,6 +14,9 @@
# limitations under the License. # limitations under the License.
import re import re
import logging
logger = logging.getLogger(__name__)
# intentionally looser than what aliases we allow to be registered since # intentionally looser than what aliases we allow to be registered since
# other HSes may allow aliases that we would not # 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. # or inbound invite, or outbound 3PID invite.
if all_members[0].sender == user_id: if all_members[0].sender == user_id:
if "m.room.third_party_invite" in room_state_bytype: 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: if len(third_party_invites) > 0:
# technically third party invite events are not member # technically third party invite events are not member
# events, but they are close enough # 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: else:
return ALL_ALONE return ALL_ALONE
else: else: