summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorDavid Baker <dbkr@users.noreply.github.com>2017-09-18 16:41:29 +0100
committerGitHub <noreply@github.com>2017-09-18 16:41:29 +0100
commit862c8da560a353da8247a36b0ae550a770aedd48 (patch)
treee13e566009ade822b13a6b95892e22e428886f07 /synapse
parentMerge pull request #2449 from matrix-org/erikj/rejoin_device_lists (diff)
parentAlso include the room_id (diff)
downloadsynapse-862c8da560a353da8247a36b0ae550a770aedd48.tar.xz
Merge pull request #2450 from matrix-org/dbkr/push_event_id_only
Add support for event_id_only push format
Diffstat (limited to 'synapse')
-rw-r--r--synapse/push/httppusher.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/synapse/push/httppusher.py b/synapse/push/httppusher.py
index 8a5d473108..62c41cd9db 100644
--- a/synapse/push/httppusher.py
+++ b/synapse/push/httppusher.py
@@ -244,6 +244,26 @@ class HttpPusher(object):
 
     @defer.inlineCallbacks
     def _build_notification_dict(self, event, tweaks, badge):
+        if self.data.get('format') == 'event_id_only':
+            d = {
+                'notification': {
+                    'event_id': event.event_id,
+                    'room_id': event.room_id,
+                    'counts': {
+                        'unread': badge,
+                    },
+                    'devices': [
+                        {
+                            'app_id': self.app_id,
+                            'pushkey': self.pushkey,
+                            'pushkey_ts': long(self.pushkey_ts / 1000),
+                            'data': self.data_minus_url,
+                        }
+                    ]
+                }
+            }
+            defer.returnValue(d)
+
         ctx = yield push_tools.get_context_for_event(
             self.store, self.state_handler, event, self.user_id
         )