summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-08-27 11:19:37 +0100
committerMark Haines <mark.haines@matrix.org>2014-08-27 11:19:37 +0100
commitbf05218c4b1740cdc5477cadbc36f0575e2dcd51 (patch)
treeced8ed09e18afb11e97734959150b8ef7f0db833 /synapse/server.py
parentFold federation/handler into handlers/federation (diff)
parentAdded support for GET /events/$eventid with auth checks. (diff)
downloadsynapse-bf05218c4b1740cdc5477cadbc36f0575e2dcd51.tar.xz
Merge branch 'develop' into storage_transactions
Diffstat (limited to 'synapse/server.py')
-rw-r--r--synapse/server.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/server.py b/synapse/server.py
index b825917748..9de88b6642 100644
--- a/synapse/server.py
+++ b/synapse/server.py
@@ -27,7 +27,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, RoomAlias
+from synapse.types import UserID, RoomAlias, RoomID
 from synapse.util import Clock
 from synapse.util.distributor import Distributor
 from synapse.util.lockutils import LockManager
@@ -115,6 +115,9 @@ class BaseHomeServer(object):
 
         setattr(BaseHomeServer, "get_%s" % (depname), _get)
 
+    # TODO: Why are these parse_ methods so high up along with other globals?
+    # Surely these should be in a util package or in the api package?
+
     # Other utility methods
     def parse_userid(self, s):
         """Parse the string given by 's' as a User ID and return a UserID
@@ -126,6 +129,11 @@ class BaseHomeServer(object):
         object."""
         return RoomAlias.from_string(s, hs=self)
 
+    def parse_roomid(self, s):
+        """Parse the string given by 's' as a Room ID and return a RoomID
+        object."""
+        return RoomID.from_string(s, hs=self)
+
 # Build magic accessors for every dependency
 for depname in BaseHomeServer.DEPENDENCIES:
     BaseHomeServer._make_dependency_method(depname)