summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-08-13 17:43:10 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-08-13 18:03:41 +0100
commit7fb93f2a47ab8abc44a9b6a94171950a40f6ba33 (patch)
treeb82af6bb6e2432a38e989ba2bdf44c213f75d2cb /synapse/server.py
parentUpdate graph.py to use new federation urls (diff)
downloadsynapse-7fb93f2a47ab8abc44a9b6a94171950a40f6ba33.tar.xz
Add a HomeServer.parse_roomalias() to avoid having to RoomAlias.from_sring(..., hs=hs) - similar to parse_userid()
Diffstat (limited to 'synapse/server.py')
-rw-r--r--synapse/server.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/synapse/server.py b/synapse/server.py
index 0211972d05..96830a88b1 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -28,7 +28,7 @@ from synapse.handlers import Handlers
 from synapse.rest import RestServletFactory
 from synapse.state import StateHandler
 from synapse.storage import DataStore
-from synapse.types import UserID
+from synapse.types import UserID, RoomAlias
 from synapse.util import Clock
 from synapse.util.distributor import Distributor
 from synapse.util.lockutils import LockManager
@@ -120,6 +120,11 @@ class BaseHomeServer(object):
         object."""
         return UserID.from_string(s, hs=self)
 
+    def parse_roomalias(self, s):
+        """Parse the string given by 's' as a Room Alias and return a RoomAlias
+        object."""
+        return RoomAlias.from_string(s, hs=self)
+
 # Build magic accessors for every dependency
 for depname in BaseHomeServer.DEPENDENCIES:
     BaseHomeServer._make_dependency_method(depname)