Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add support for event_id_only push format #2450

Merged
merged 3 commits into from
Sep 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions synapse/push/httppusher.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,26 @@ def _process_one(self, push_action):

@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
)
Expand Down