Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Send the invier's member event in room invite state so the invitee ha…
Browse files Browse the repository at this point in the history
…s their display name and avatar.
  • Loading branch information
dbkr committed Feb 25, 2016
1 parent faa3d17 commit 0f0b011
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion synapse/handlers/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ def handle_new_client_event(self, event, context, ratelimit=True, extra_users=[]

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,
Expand All @@ -306,7 +312,7 @@ def handle_new_client_event(self, event, context, ratelimit=True, extra_users=[]
EventTypes.CanonicalAlias,
EventTypes.RoomAvatar,
EventTypes.Name,
)
) or is_inviter_member_event(e)
]

invitee = UserID.from_string(event.state_key)
Expand Down

0 comments on commit 0f0b011

Please sign in to comment.