summary refs log tree commit diff
path: root/synapse/appservice
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-02-04 11:19:18 +0000
committerKegan Dougal <kegan@matrix.org>2015-02-04 11:19:18 +0000
commit17753f0c20d0d8190095c5a3183630b78bf9650c (patch)
tree92975fb2f7fe22e3e65f8e5df2c478298ead579c /synapse/appservice
parentAdd appservice package and move ApplicationService into it. (diff)
downloadsynapse-17753f0c20d0d8190095c5a3183630b78bf9650c.tar.xz
Add stub ApplicationServiceApi and glue it with the handler.
Diffstat (limited to 'synapse/appservice')
-rw-r--r--synapse/appservice/__init__.py3
-rw-r--r--synapse/appservice/api.py21
2 files changed, 23 insertions, 1 deletions
diff --git a/synapse/appservice/__init__.py b/synapse/appservice/__init__.py
index f801fb5324..92f64619c9 100644
--- a/synapse/appservice/__init__.py
+++ b/synapse/appservice/__init__.py
@@ -31,10 +31,11 @@ class ApplicationService(object):
     # values.
     NS_LIST = [NS_USERS, NS_ALIASES, NS_ROOMS]
 
-    def __init__(self, token, url=None, namespaces=None):
+    def __init__(self, token, url=None, namespaces=None, txn_id=None):
         self.token = token
         self.url = url
         self.namespaces = self._check_namespaces(namespaces)
+        self.txn_id = None
 
     def _check_namespaces(self, namespaces):
         # Sanity check that it is of the form:
diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py
index 803f97ea4f..158aded66e 100644
--- a/synapse/appservice/api.py
+++ b/synapse/appservice/api.py
@@ -13,3 +13,24 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+
+class ApplicationServiceApi(object):
+    """This class manages HS -> AS communications, including querying and
+    pushing.
+    """
+
+    def __init__(self,  hs):
+        self.hs_token = "_hs_token_"  # TODO extract hs token
+
+    def query_user(self, service, user_id):
+        pass
+
+    def query_alias(self, service, alias):
+        pass
+
+    def push_bulk(self, service, events):
+        pass
+
+    def push(self, service, event):
+        pass
+