summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-02-25 18:12:09 +0000
committerDavid Baker <dave@matrix.org>2016-02-25 18:12:09 +0000
commit0f0b011440eba5ee5c018cb7b9d2618bccd20220 (patch)
tree952d3d538199d141fe224018a99f30a3c7f7210c /synapse/handlers/_base.py
parentMerge pull request #606 from matrix-org/markjh/get_enabled (diff)
downloadsynapse-0f0b011440eba5ee5c018cb7b9d2618bccd20220.tar.xz
Send the invier's member event in room invite state so the invitee has their display name and avatar.
Diffstat (limited to '')
-rw-r--r--synapse/handlers/_base.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 5613bd2059..bdade98bf7 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -293,6 +293,12 @@ class BaseHandler(object):
 
         if event.type == EventTypes.Member:
             if event.content["membership"] == Membership.INVITE:
+                def is_inviter_member_event(e):
+                    return (
+                        e.type == EventTypes.Member and
+                        e.sender == event.sender
+                    )
+
                 event.unsigned["invite_room_state"] = [
                     {
                         "type": e.type,
@@ -306,7 +312,7 @@ class BaseHandler(object):
                         EventTypes.CanonicalAlias,
                         EventTypes.RoomAvatar,
                         EventTypes.Name,
-                    )
+                    ) or is_inviter_member_event(e)
                 ]
 
                 invitee = UserID.from_string(event.state_key)