summary refs log tree commit diff
path: root/synapse/push/pusherpool.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-01-16 11:24:10 +0000
committerDavid Baker <dave@matrix.org>2015-01-16 11:24:10 +0000
commit2d2953cf5fce26625e56fc1abc230735d007ea1e (patch)
treef792d8e4067d5edf43e5bed876fe5d4ee11d8a51 /synapse/push/pusherpool.py
parentSend room name and first alias in notification poke. (diff)
downloadsynapse-2d2953cf5fce26625e56fc1abc230735d007ea1e.tar.xz
Require device language when adding a pusher.
Because this seems like it might be useful to do sooner rather
than later.
Diffstat (limited to 'synapse/push/pusherpool.py')
-rw-r--r--synapse/push/pusherpool.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py
index edddc3003e..8c77f4b668 100644
--- a/synapse/push/pusherpool.py
+++ b/synapse/push/pusherpool.py
@@ -41,7 +41,7 @@ class PusherPool:
 
     @defer.inlineCallbacks
     def add_pusher(self, user_name, kind, app_id,
-                   app_display_name, device_display_name, pushkey, data):
+                   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,
         # recreated, added and started: this means we have only one
@@ -54,6 +54,7 @@ class PusherPool:
             "device_display_name": device_display_name,
             "pushkey": pushkey,
             "pushkey_ts": self.hs.get_clock().time_msec(),
+            "lang": lang,
             "data": data,
             "last_token": None,
             "last_success": None,
@@ -62,13 +63,13 @@ class PusherPool:
         yield self._add_pusher_to_store(
             user_name, kind, app_id,
             app_display_name, device_display_name,
-            pushkey, data
+            pushkey, lang, data
         )
 
     @defer.inlineCallbacks
     def _add_pusher_to_store(self, user_name, kind, app_id,
                              app_display_name, device_display_name,
-                             pushkey, data):
+                             pushkey, lang, data):
         yield self.store.add_pusher(
             user_name=user_name,
             kind=kind,
@@ -77,6 +78,7 @@ class PusherPool:
             device_display_name=device_display_name,
             pushkey=pushkey,
             pushkey_ts=self.hs.get_clock().time_msec(),
+            lang=lang,
             data=json.dumps(data)
         )
         self._refresh_pusher((app_id, pushkey))