summary refs log tree commit diff
path: root/synapse/push/pusherpool.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-01-20 11:49:48 +0000
committerDavid Baker <dave@matrix.org>2015-01-20 11:49:48 +0000
commitafb714f7bebf88ac27eac018cffa2078e2723310 (patch)
treec65a60cc08b0c5335a25b946f49255cbe4468202 /synapse/push/pusherpool.py
parentRequire device language when adding a pusher. (diff)
downloadsynapse-afb714f7bebf88ac27eac018cffa2078e2723310.tar.xz
add instance_handles to pushers so we have a way to refer to them even if the push token changes.
Diffstat (limited to 'synapse/push/pusherpool.py')
-rw-r--r--synapse/push/pusherpool.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py
index 8c77f4b668..2dfecf178b 100644
--- a/synapse/push/pusherpool.py
+++ b/synapse/push/pusherpool.py
@@ -40,7 +40,7 @@ class PusherPool:
         self._start_pushers(pushers)
 
     @defer.inlineCallbacks
-    def add_pusher(self, user_name, kind, app_id,
+    def add_pusher(self, user_name, instance_handle, kind, app_id,
                    app_display_name, device_display_name, pushkey, lang, data):
         # we try to create the pusher just to validate the config: it
         # will then get pulled out of the database,
@@ -49,6 +49,7 @@ class PusherPool:
         self._create_pusher({
             "user_name": user_name,
             "kind": kind,
+            "instance_handle": instance_handle,
             "app_id": app_id,
             "app_display_name": app_display_name,
             "device_display_name": device_display_name,
@@ -61,17 +62,18 @@ class PusherPool:
             "failing_since": None
         })
         yield self._add_pusher_to_store(
-            user_name, kind, app_id,
+            user_name, instance_handle, kind, app_id,
             app_display_name, device_display_name,
             pushkey, lang, data
         )
 
     @defer.inlineCallbacks
-    def _add_pusher_to_store(self, user_name, kind, app_id,
+    def _add_pusher_to_store(self, user_name, instance_handle, kind, app_id,
                              app_display_name, device_display_name,
                              pushkey, lang, data):
         yield self.store.add_pusher(
             user_name=user_name,
+            instance_handle=instance_handle,
             kind=kind,
             app_id=app_id,
             app_display_name=app_display_name,
@@ -87,6 +89,7 @@ class PusherPool:
         if pusherdict['kind'] == 'http':
             return HttpPusher(
                 self.hs,
+                instance_handle=pusherdict['instance_handle'],
                 user_name=pusherdict['user_name'],
                 app_id=pusherdict['app_id'],
                 app_display_name=pusherdict['app_display_name'],