mirror of
https://github.com/element-hq/synapse
synced 2024-08-20 03:50:20 +00:00
Send the invier's member event in room invite state so the invitee has their display name and avatar.
This commit is contained in:
parent
faa3d172ab
commit
0f0b011440
1 changed files with 7 additions and 1 deletions
|
@ -293,6 +293,12 @@ class BaseHandler(object):
|
||||||
|
|
||||||
if event.type == EventTypes.Member:
|
if event.type == EventTypes.Member:
|
||||||
if event.content["membership"] == Membership.INVITE:
|
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"] = [
|
event.unsigned["invite_room_state"] = [
|
||||||
{
|
{
|
||||||
"type": e.type,
|
"type": e.type,
|
||||||
|
@ -306,7 +312,7 @@ class BaseHandler(object):
|
||||||
EventTypes.CanonicalAlias,
|
EventTypes.CanonicalAlias,
|
||||||
EventTypes.RoomAvatar,
|
EventTypes.RoomAvatar,
|
||||||
EventTypes.Name,
|
EventTypes.Name,
|
||||||
)
|
) or is_inviter_member_event(e)
|
||||||
]
|
]
|
||||||
|
|
||||||
invitee = UserID.from_string(event.state_key)
|
invitee = UserID.from_string(event.state_key)
|
||||||
|
|
Loading…
Reference in a new issue