diff options
author | Krombel <krombel@krombel.de> | 2018-07-13 21:40:14 +0200 |
---|---|---|
committer | Krombel <krombel@krombel.de> | 2018-07-13 21:40:14 +0200 |
commit | 32fd6910d0175f14d9be756ac2241da683af83bb (patch) | |
tree | 40ee591606c439c8309eb0aa25a01d1fef8f76d8 /synapse/rest/client/v1/initial_sync.py | |
parent | Merge pull request #3533 from matrix-org/rav/fix_federation_ratelimite_queue (diff) | |
download | synapse-32fd6910d0175f14d9be756ac2241da683af83bb.tar.xz |
Use parse_{int,str} and assert from http.servlet
parse_integer and parse_string can take a request and raise errors in case we have wrong or missing params. This PR tries to use them more to deduplicate some code and make it better readable
Diffstat (limited to 'synapse/rest/client/v1/initial_sync.py')
-rw-r--r-- | synapse/rest/client/v1/initial_sync.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/initial_sync.py b/synapse/rest/client/v1/initial_sync.py index fbe8cb2023..00a1a99feb 100644 --- a/synapse/rest/client/v1/initial_sync.py +++ b/synapse/rest/client/v1/initial_sync.py @@ -16,6 +16,7 @@ from twisted.internet import defer from synapse.streams.config import PaginationConfig +from synapse.http.servlet import parse_boolean from .base import ClientV1RestServlet, client_path_patterns @@ -33,7 +34,7 @@ class InitialSyncRestServlet(ClientV1RestServlet): requester = yield self.auth.get_user_by_req(request) as_client_event = "raw" not in request.args pagination_config = PaginationConfig.from_request(request) - include_archived = request.args.get("archived", None) == ["true"] + include_archived = parse_boolean(request, "archived", default=False) content = yield self.initial_sync_handler.snapshot_all_rooms( user_id=requester.user.to_string(), pagin_config=pagination_config, |