diff options
author | Erik Johnston <erikj@jki.re> | 2019-03-21 14:07:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-21 14:07:17 +0000 |
commit | 01e6b405be57183618fade0ecadc76adc805a2b4 (patch) | |
tree | 1e63595ae93ac0f579f2c4ba91b3d657cb14f2a8 /synapse/handlers/events.py | |
parent | Update Apache Setup To Remove Location Syntax (#4870) (diff) | |
parent | Update changelog.d/4908.bugfix (diff) | |
download | synapse-01e6b405be57183618fade0ecadc76adc805a2b4.tar.xz |
Merge pull request #4908 from matrix-org/erikj/block_peek_on_blocked_rooms
Deny peeking into rooms that have been blocked
Diffstat (limited to 'synapse/handlers/events.py')
-rw-r--r-- | synapse/handlers/events.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/handlers/events.py b/synapse/handlers/events.py index f772e62c28..d883e98381 100644 --- a/synapse/handlers/events.py +++ b/synapse/handlers/events.py @@ -19,7 +19,7 @@ import random from twisted.internet import defer from synapse.api.constants import EventTypes, Membership -from synapse.api.errors import AuthError +from synapse.api.errors import AuthError, SynapseError from synapse.events import EventBase from synapse.events.utils import serialize_event from synapse.types import UserID @@ -61,6 +61,11 @@ class EventStreamHandler(BaseHandler): If `only_keys` is not None, events from keys will be sent down. """ + if room_id: + blocked = yield self.store.is_room_blocked(room_id) + if blocked: + raise SynapseError(403, "This room has been blocked on this server") + # send any outstanding server notices to the user. yield self._server_notices_sender.on_user_syncing(auth_user_id) |