diff options
author | Daniel Wagner-Hall <daniel@matrix.org> | 2016-01-11 15:29:57 +0000 |
---|---|---|
committer | Daniel Wagner-Hall <daniel@matrix.org> | 2016-01-11 17:48:45 +0000 |
commit | 2110e35fd6e50aa7c44410601c7e5e938c912c3e (patch) | |
tree | 825cfc5c59aa6e60064b56dce920b6429437d7e5 /synapse/rest/client/v1/pusher.py | |
parent | Use logger not logging (diff) | |
download | synapse-2110e35fd6e50aa7c44410601c7e5e938c912c3e.tar.xz |
Introduce a Requester object
This tracks data about the entity which made the request. This is instead of passing around a tuple, which requires call-site modifications every time a new piece of optional context is passed around. I tried to introduce a User object. I gave up.
Diffstat (limited to 'synapse/rest/client/v1/pusher.py')
-rw-r--r-- | synapse/rest/client/v1/pusher.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/rest/client/v1/pusher.py b/synapse/rest/client/v1/pusher.py index 81a8786aeb..b162b210bc 100644 --- a/synapse/rest/client/v1/pusher.py +++ b/synapse/rest/client/v1/pusher.py @@ -30,7 +30,8 @@ class PusherRestServlet(ClientV1RestServlet): @defer.inlineCallbacks def on_POST(self, request): - user, token_id, _ = yield self.auth.get_user_by_req(request) + requester = yield self.auth.get_user_by_req(request) + user = requester.user content = _parse_json(request) @@ -71,7 +72,7 @@ class PusherRestServlet(ClientV1RestServlet): try: yield pusher_pool.add_pusher( user_name=user.to_string(), - access_token=token_id, + access_token=requester.access_token_id, profile_tag=content['profile_tag'], kind=content['kind'], app_id=content['app_id'], |