summary refs log tree commit diff
path: root/synapse/rest/client/v1/directory.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-01-23 13:21:58 +0000
committerMark Haines <mark.haines@matrix.org>2015-01-23 13:21:58 +0000
commitada711504efb4dd25fe1123d38a0b2d196b9890a (patch)
tree73789e6eb42442559a7d1e34385827b7465f580c /synapse/rest/client/v1/directory.py
parentReplace hs.parse_roomid with RoomID.from_string (diff)
downloadsynapse-ada711504efb4dd25fe1123d38a0b2d196b9890a.tar.xz
Replace hs.parse_roomalias with RoomAlias.from_string
Diffstat (limited to 'synapse/rest/client/v1/directory.py')
-rw-r--r--synapse/rest/client/v1/directory.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/rest/client/v1/directory.py b/synapse/rest/client/v1/directory.py
index 7ff44fdd9e..1f33ec9e81 100644
--- a/synapse/rest/client/v1/directory.py
+++ b/synapse/rest/client/v1/directory.py
@@ -17,7 +17,8 @@
 from twisted.internet import defer
 
 from synapse.api.errors import AuthError, SynapseError, Codes
-from base import RestServlet, client_path_pattern
+from synapse.types import RoomAlias
+from .base import RestServlet, client_path_pattern
 
 import json
 import logging
@@ -35,7 +36,7 @@ class ClientDirectoryServer(RestServlet):
 
     @defer.inlineCallbacks
     def on_GET(self, request, room_alias):
-        room_alias = self.hs.parse_roomalias(room_alias)
+        room_alias = RoomAlias.from_string(room_alias)
 
         dir_handler = self.handlers.directory_handler
         res = yield dir_handler.get_association(room_alias)
@@ -53,7 +54,7 @@ class ClientDirectoryServer(RestServlet):
 
         logger.debug("Got content: %s", content)
 
-        room_alias = self.hs.parse_roomalias(room_alias)
+        room_alias = RoomAlias.from_string(room_alias)
 
         logger.debug("Got room name: %s", room_alias.to_string())
 
@@ -92,7 +93,7 @@ class ClientDirectoryServer(RestServlet):
 
         dir_handler = self.handlers.directory_handler
 
-        room_alias = self.hs.parse_roomalias(room_alias)
+        room_alias = RoomAlias.from_string(room_alias)
 
         yield dir_handler.delete_association(
             user.to_string(), room_alias