summary refs log tree commit diff
path: root/synapse/rest/client/v1/profile.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-01-23 13:41:55 +0000
committerMark Haines <mjark@negativecurvature.net>2015-01-23 13:41:55 +0000
commitf7cb6042117fd54748ec771337a4b04fe8498ac8 (patch)
tree62fece1cc473923d5bd4e72dac9035ca9e81ea1f /synapse/rest/client/v1/profile.py
parentMerge pull request #31 from matrix-org/client_api_resource (diff)
parentRemove hs.parse_eventid (diff)
downloadsynapse-f7cb6042117fd54748ec771337a4b04fe8498ac8.tar.xz
Merge pull request #32 from matrix-org/remove_parse_id_from_hs
Remove parse id from hs
Diffstat (limited to 'synapse/rest/client/v1/profile.py')
-rw-r--r--synapse/rest/client/v1/profile.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/synapse/rest/client/v1/profile.py b/synapse/rest/client/v1/profile.py
index dc6eb424b0..39297930c8 100644
--- a/synapse/rest/client/v1/profile.py
+++ b/synapse/rest/client/v1/profile.py
@@ -16,7 +16,8 @@
 """ This module contains REST servlets to do with profile: /profile/<paths> """
 from twisted.internet import defer
 
-from base import RestServlet, client_path_pattern
+from .base import RestServlet, client_path_pattern
+from synapse.types import UserID
 
 import json
 
@@ -26,7 +27,7 @@ class ProfileDisplaynameRestServlet(RestServlet):
 
     @defer.inlineCallbacks
     def on_GET(self, request, user_id):
-        user = self.hs.parse_userid(user_id)
+        user = UserID.from_string(user_id)
 
         displayname = yield self.handlers.profile_handler.get_displayname(
             user,
@@ -37,7 +38,7 @@ class ProfileDisplaynameRestServlet(RestServlet):
     @defer.inlineCallbacks
     def on_PUT(self, request, user_id):
         auth_user = yield self.auth.get_user_by_req(request)
-        user = self.hs.parse_userid(user_id)
+        user = UserID.from_string(user_id)
 
         try:
             content = json.loads(request.content.read())
@@ -59,7 +60,7 @@ class ProfileAvatarURLRestServlet(RestServlet):
 
     @defer.inlineCallbacks
     def on_GET(self, request, user_id):
-        user = self.hs.parse_userid(user_id)
+        user = UserID.from_string(user_id)
 
         avatar_url = yield self.handlers.profile_handler.get_avatar_url(
             user,
@@ -70,7 +71,7 @@ class ProfileAvatarURLRestServlet(RestServlet):
     @defer.inlineCallbacks
     def on_PUT(self, request, user_id):
         auth_user = yield self.auth.get_user_by_req(request)
-        user = self.hs.parse_userid(user_id)
+        user = UserID.from_string(user_id)
 
         try:
             content = json.loads(request.content.read())
@@ -92,7 +93,7 @@ class ProfileRestServlet(RestServlet):
 
     @defer.inlineCallbacks
     def on_GET(self, request, user_id):
-        user = self.hs.parse_userid(user_id)
+        user = UserID.from_string(user_id)
 
         displayname = yield self.handlers.profile_handler.get_displayname(
             user,