summary refs log tree commit diff
path: root/synapse/server.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-08-27 14:13:06 +0100
committerErik Johnston <erik@matrix.org>2014-08-27 14:13:06 +0100
commit47519cd8c27c343405431c206660ba74fdea52f6 (patch)
tree77b7a55778c42e256b99577226a6172f719e8416 /synapse/server.py
parentImplement presence event source. Change the way the notifier indexes listeners (diff)
parentfix joining rooms on webclient (diff)
downloadsynapse-47519cd8c27c343405431c206660ba74fdea52f6.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into stream_refactor
Conflicts:
	synapse/handlers/events.py
	synapse/rest/events.py
	synapse/rest/room.py
Diffstat (limited to 'synapse/server.py')
-rw-r--r--synapse/server.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/synapse/server.py b/synapse/server.py
index 5e9b76603a..c29c61220d 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, 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
@@ -119,17 +119,30 @@ 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
         object."""
         return UserID.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)
+
     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)
 
+    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)