summary refs log tree commit diff
path: root/synapse/appservice/api.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-02-05 10:08:12 +0000
committerKegan Dougal <kegan@matrix.org>2015-02-05 10:08:12 +0000
commit27091f146a0ebdbfe1ae7c5cd30de51515cfbebc (patch)
treef32ff280c60ccaf599c2ef053dd5c464e53e3854 /synapse/appservice/api.py
parentImpl push_bulk function (diff)
downloadsynapse-27091f146a0ebdbfe1ae7c5cd30de51515cfbebc.tar.xz
Add hs_token column and generate a different token f.e application service.
Diffstat (limited to 'synapse/appservice/api.py')
-rw-r--r--synapse/appservice/api.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/appservice/api.py b/synapse/appservice/api.py
index fbf4abc526..29bb35d61b 100644
--- a/synapse/appservice/api.py
+++ b/synapse/appservice/api.py
@@ -30,7 +30,6 @@ class ApplicationServiceApi(SimpleHttpClient):
 
     def __init__(self,  hs):
         super(ApplicationServiceApi, self).__init__(hs)
-        self.hs_token = "_hs_token_"  # TODO extract hs token
 
     @defer.inlineCallbacks
     def query_user(self, service, user_id):
@@ -38,7 +37,7 @@ class ApplicationServiceApi(SimpleHttpClient):
         response = None
         try:
             response = yield self.get_json(uri, {
-                "access_token": self.hs_token
+                "access_token": service.hs_token
             })
             if response:  # just an empty json object
                 defer.returnValue(True)
@@ -54,7 +53,7 @@ class ApplicationServiceApi(SimpleHttpClient):
         response = None
         try:
             response = yield self.get_json(uri, {
-                "access_token": self.hs_token
+                "access_token": service.hs_token
             })
             if response:  # just an empty json object
                 defer.returnValue(True)
@@ -76,9 +75,10 @@ class ApplicationServiceApi(SimpleHttpClient):
                     "events": events
                 },
                 {
-                    "access_token": self.hs_token
+                    "access_token": service.hs_token
                 })
             if response:  # just an empty json object
+                # TODO: Mark txn as sent successfully
                 defer.returnValue(True)
         except CodeMessageException as e:
             logger.warning("push_bulk to %s received %s", uri, e.code)