mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 02:44:53 -04:00
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.
This commit is contained in:
parent
fcbe63eaad
commit
2110e35fd6
24 changed files with 178 additions and 144 deletions
|
@ -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'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue