diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py index 5613bd2059f4..bdade98bf7b2 100644 --- a/synapse/handlers/_base.py +++ b/synapse/handlers/_base.py @@ -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, @@ -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)