summary refs log tree commit diff
path: root/synapse/rest/client/v1
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-01-23 10:37:38 +0000
committerMark Haines <mark.haines@matrix.org>2015-01-23 10:37:38 +0000
commit7256def8e43bf5ab982cb7e785fb1334a1ef4ab8 (patch)
tree44c5eb1754851f7467bb1ec4a0ee7dee7524af17 /synapse/rest/client/v1
parentMerge pull request #30 from matrix-org/client_api_restructure (diff)
downloadsynapse-7256def8e43bf5ab982cb7e785fb1334a1ef4ab8.tar.xz
Merge rest servlets into the client json resource object
Diffstat (limited to 'synapse/rest/client/v1')
-rw-r--r--synapse/rest/client/v1/__init__.py18
1 files changed, 7 insertions, 11 deletions
diff --git a/synapse/rest/client/v1/__init__.py b/synapse/rest/client/v1/__init__.py
index 88ec9cd27d..8bb89b2f6a 100644
--- a/synapse/rest/client/v1/__init__.py
+++ b/synapse/rest/client/v1/__init__.py
@@ -19,22 +19,18 @@ from . import (
     voip, admin,
 )
 
+from synapse.http.server import JsonResource
 
-class RestServletFactory(object):
 
-    """ A factory for creating REST servlets.
-
-    These REST servlets represent the entire client-server REST API. Generally
-    speaking, they serve as wrappers around events and the handlers that
-    process them.
-
-    See synapse.events for information on synapse events.
-    """
+class ClientV1RestResource(JsonResource):
+    """A resource for version 1 of the matrix client API."""
 
     def __init__(self, hs):
-        client_resource = hs.get_resource_for_client()
+        JsonResource.__init__(self)
+        self.register_servlets(self, hs)
 
-        # TODO(erikj): There *must* be a better way of doing this.
+    @staticmethod
+    def register_servlets(client_resource, hs):
         room.register_servlets(hs, client_resource)
         events.register_servlets(hs, client_resource)
         register.register_servlets(hs, client_resource)