summary refs log tree commit diff
path: root/synapse/util
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-07-28 10:20:47 +0100
committerDavid Baker <dave@matrix.org>2016-07-28 10:20:47 +0100
commit389c890f14c456a157d973fd29b49d64e5fa9226 (patch)
tree23ed0df062c0ea8165f04061e10a9e2532af12bd /synapse/util
parentTypo (diff)
downloadsynapse-389c890f14c456a157d973fd29b49d64e5fa9226.tar.xz
Don't include name of room for invites in push
Avoids insane pushes like, "Bob invited you to invite from Bob"
Diffstat (limited to 'synapse/util')
-rw-r--r--synapse/util/presentable_names.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/util/presentable_names.py b/synapse/util/presentable_names.py
index 4c54812e6f..f68676e9e7 100644
--- a/synapse/util/presentable_names.py
+++ b/synapse/util/presentable_names.py
@@ -83,7 +83,10 @@ def calculate_room_name(room_state, user_id, fallback_to_members=True,
     ):
         if ("m.room.member", my_member_event.sender) in room_state:
             inviter_member_event = room_state[("m.room.member", my_member_event.sender)]
-            return "Invite from %s" % (name_from_member_event(inviter_member_event),)
+            if fallback_to_single_member:
+                return "Invite from %s" % (name_from_member_event(inviter_member_event),)
+            else:
+                return None
         else:
             return "Room Invite"