diff options
author | David Baker <dave@matrix.org> | 2015-12-22 17:23:35 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2015-12-22 17:23:35 +0000 |
commit | 140a50f641ce345053fc9bdf6bfadffb063f1424 (patch) | |
tree | 5fc29aed1a423bde9e6e317072b72233767240a5 /synapse/rest/client/v2_alpha/sync.py | |
parent | Add some comments to areas that could be optimised. (diff) | |
parent | Merge pull request #455 from matrix-org/markjh/guest_access (diff) | |
download | synapse-140a50f641ce345053fc9bdf6bfadffb063f1424.tar.xz |
Merge remote-tracking branch 'origin/develop' into store_event_actions
Diffstat (limited to 'synapse/rest/client/v2_alpha/sync.py')
-rw-r--r-- | synapse/rest/client/v2_alpha/sync.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/rest/client/v2_alpha/sync.py b/synapse/rest/client/v2_alpha/sync.py index 93e607f9ec..cd3aef9e07 100644 --- a/synapse/rest/client/v2_alpha/sync.py +++ b/synapse/rest/client/v2_alpha/sync.py @@ -85,7 +85,9 @@ class SyncRestServlet(RestServlet): @defer.inlineCallbacks def on_GET(self, request): - user, token_id, _ = yield self.auth.get_user_by_req(request) + user, token_id, is_guest = yield self.auth.get_user_by_req( + request, allow_guest=True + ) timeout = parse_integer(request, "timeout", default=0) since = parse_string(request, "since") @@ -118,8 +120,14 @@ class SyncRestServlet(RestServlet): except: filter = FilterCollection({}) + if is_guest and filter.list_rooms() is None: + raise SynapseError( + 400, "Guest users must provide a list of rooms in the filter" + ) + sync_config = SyncConfig( user=user, + is_guest=is_guest, filter=filter, ) |