diff --git a/synapse/api/auth.py b/synapse/api/auth.py index eca851390576101fc08eab103b7140f34db9fb73..f399aa8c7c728de376e0967c99c1a2b0727324fd 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -376,6 +376,10 @@ class Auth(object): if Membership.INVITE == membership and "third_party_invite" in event.content: if not self._verify_third_party_invite(event, auth_events): raise AuthError(403, "You are not invited to this room.") + if target_banned: + raise AuthError( + 403, "%s is banned from the room" % (target_user_id,) + ) return True if Membership.JOIN != membership: