summary refs log tree commit diff
path: root/synapse/handlers/initial_sync.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-03-21 14:10:31 +0000
committerErik Johnston <erik@matrix.org>2019-03-21 14:10:31 +0000
commitb0bf1ea7bda4894bae92a895c957a1a2ce431f4e (patch)
treec1ab07c55925e9c50aa0b7b55b4984bb9fc464e0 /synapse/handlers/initial_sync.py
parentMerge branch 'develop' into matrix-org-hotfixes (diff)
parentMerge pull request #4908 from matrix-org/erikj/block_peek_on_blocked_rooms (diff)
downloadsynapse-b0bf1ea7bda4894bae92a895c957a1a2ce431f4e.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/handlers/initial_sync.py')
-rw-r--r--synapse/handlers/initial_sync.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/handlers/initial_sync.py b/synapse/handlers/initial_sync.py

index 563bb3cea3..7dfae78db0 100644 --- a/synapse/handlers/initial_sync.py +++ b/synapse/handlers/initial_sync.py
@@ -18,7 +18,7 @@ import logging from twisted.internet import defer from synapse.api.constants import EventTypes, Membership -from synapse.api.errors import AuthError, Codes +from synapse.api.errors import AuthError, Codes, SynapseError from synapse.events.utils import serialize_event from synapse.events.validator import EventValidator from synapse.handlers.presence import format_user_presence_state @@ -262,6 +262,10 @@ class InitialSyncHandler(BaseHandler): A JSON serialisable dict with the snapshot of the room. """ + blocked = yield self.store.is_room_blocked(room_id) + if blocked: + raise SynapseError(403, "This room has been blocked on this server") + user_id = requester.user.to_string() membership, member_event_id = yield self._check_in_room_or_world_readable(