diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-09-03 11:31:48 +0100 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-09-03 11:31:48 +0100 |
commit | acfabfff9c7cda10b5be085732e80bb7a2af50a6 (patch) | |
tree | 95b5866825fab8f9324280e9432a6fbe27b7fca8 /synapse/rest | |
parent | Fixed GET /events/$id to be not broken. (diff) | |
download | synapse-acfabfff9c7cda10b5be085732e80bb7a2af50a6.tar.xz |
Fixed /presence APIs to urldecode user IDs.
Diffstat (limited to 'synapse/rest')
-rw-r--r-- | synapse/rest/presence.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/rest/presence.py b/synapse/rest/presence.py index bce3943542..967bb7d34f 100644 --- a/synapse/rest/presence.py +++ b/synapse/rest/presence.py @@ -21,7 +21,7 @@ from base import RestServlet, client_path_pattern import json import logging - +import urllib logger = logging.getLogger(__name__) @@ -32,6 +32,7 @@ class PresenceStatusRestServlet(RestServlet): @defer.inlineCallbacks def on_GET(self, request, user_id): auth_user = yield self.auth.get_user_by_req(request) + user_id = urllib.unquote(user_id) user = self.hs.parse_userid(user_id) state = yield self.handlers.presence_handler.get_state( @@ -42,6 +43,7 @@ class PresenceStatusRestServlet(RestServlet): @defer.inlineCallbacks def on_PUT(self, request, user_id): auth_user = yield self.auth.get_user_by_req(request) + user_id = urllib.unquote(user_id) user = self.hs.parse_userid(user_id) state = {} @@ -77,6 +79,7 @@ class PresenceListRestServlet(RestServlet): @defer.inlineCallbacks def on_GET(self, request, user_id): auth_user = yield self.auth.get_user_by_req(request) + user_id = urllib.unquote(user_id) user = self.hs.parse_userid(user_id) if not user.is_mine: @@ -97,6 +100,7 @@ class PresenceListRestServlet(RestServlet): @defer.inlineCallbacks def on_POST(self, request, user_id): auth_user = yield self.auth.get_user_by_req(request) + user_id = urllib.unquote(user_id) user = self.hs.parse_userid(user_id) if not user.is_mine: |