summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2020-05-20 22:11:30 +0100
committerRichard van der Hoff <richard@matrix.org>2020-05-20 22:13:32 +0100
commit84639b32ae9f99de0405186d6568fd510caff21e (patch)
tree4899d9551124b095e30d31b3860e0df17c9596f9
parentHash passwords earlier in the registration process (#7523) (diff)
downloadsynapse-84639b32ae9f99de0405186d6568fd510caff21e.tar.xz
stub out GET presence requests
-rw-r--r--synapse/app/generic_worker.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/synapse/app/generic_worker.py b/synapse/app/generic_worker.py

index 667ad20428..9d9849365a 100644 --- a/synapse/app/generic_worker.py +++ b/synapse/app/generic_worker.py
@@ -140,31 +140,18 @@ logger = logging.getLogger("synapse.app.generic_worker") class PresenceStatusStubServlet(RestServlet): """If presence is disabled this servlet can be used to stub out setting - presence status, while proxying the getters to the master instance. + presence status. """ PATTERNS = client_patterns("/presence/(?P<user_id>[^/]*)/status") def __init__(self, hs): super(PresenceStatusStubServlet, self).__init__() - self.http_client = hs.get_simple_http_client() self.auth = hs.get_auth() - self.main_uri = hs.config.worker_main_http_uri async def on_GET(self, request, user_id): - # Pass through the auth headers, if any, in case the access token - # is there. - auth_headers = request.requestHeaders.getRawHeaders("Authorization", []) - headers = {"Authorization": auth_headers} - - try: - result = await self.http_client.get_json( - self.main_uri + request.uri.decode("ascii"), headers=headers - ) - except HttpResponseException as e: - raise e.to_synapse_error() - - return 200, result + await self.auth.get_user_by_req(request) + return 200, {"state": "offline"} async def on_PUT(self, request, user_id): await self.auth.get_user_by_req(request)