Handle room invites in email notifs

This commit is contained in:
David Baker 2016-04-28 11:49:36 +01:00
parent 5367708236
commit ebbabc4986
3 changed files with 42 additions and 13 deletions

View file

@ -52,6 +52,9 @@ def calculate_room_name(room_state, user_id, fallback_to_members=True):
if len(the_aliases) > 0 and _looks_like_an_alias(the_aliases[0]):
return the_aliases[0]
if not fallback_to_members:
return None
my_member_event = None
if ("m.room.member", user_id) in room_state:
my_member_event = room_state[("m.room.member", user_id)]
@ -66,9 +69,6 @@ def calculate_room_name(room_state, user_id, fallback_to_members=True):
else:
return "Room Invite"
if not fallback_to_members:
return None
# we're going to have to generate a name based on who's in the room,
# so find out who is in the room that isn't the user.
if "m.room.member" in room_state_bytype: