diff options
author | Erik Johnston <erik@matrix.org> | 2017-06-26 14:02:44 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2017-06-26 14:02:44 +0100 |
commit | e3cbec10c10e64c8388c4030191c141a8cbe4966 (patch) | |
tree | 6a4eacab98c581406eacf47c392b7a41fa00118f /synapse/handlers/room_member.py | |
parent | Reject local events that don't round trip the DB (diff) | |
parent | Merge pull request #2301 from xwiki-labs/push-redact-content (diff) | |
download | synapse-e3cbec10c10e64c8388c4030191c141a8cbe4966.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/ensure_round_trip
Diffstat (limited to 'synapse/handlers/room_member.py')
-rw-r--r-- | synapse/handlers/room_member.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py index 1ca88517a2..b3f979b246 100644 --- a/synapse/handlers/room_member.py +++ b/synapse/handlers/room_member.py @@ -203,6 +203,11 @@ class RoomMemberHandler(BaseHandler): if not remote_room_hosts: remote_room_hosts = [] + if effective_membership_state not in ("leave", "ban",): + is_blocked = yield self.store.is_room_blocked(room_id) + if is_blocked: + raise SynapseError(403, "This room has been blocked on this server") + latest_event_ids = yield self.store.get_latest_event_ids_in_room(room_id) current_state_ids = yield self.state_handler.get_current_state_ids( room_id, latest_event_ids=latest_event_ids, @@ -369,6 +374,11 @@ class RoomMemberHandler(BaseHandler): # so don't really fit into the general auth process. raise AuthError(403, "Guest access not allowed") + if event.membership not in (Membership.LEAVE, Membership.BAN): + is_blocked = yield self.store.is_room_blocked(room_id) + if is_blocked: + raise SynapseError(403, "This room has been blocked on this server") + yield message_handler.handle_new_client_event( requester, event, |