mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 23:09:24 -05:00
Merge pull request #2450 from matrix-org/dbkr/push_event_id_only
Add support for event_id_only push format
This commit is contained in:
commit
862c8da560
@ -244,6 +244,26 @@ class HttpPusher(object):
|
|||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _build_notification_dict(self, event, tweaks, badge):
|
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(
|
ctx = yield push_tools.get_context_for_event(
|
||||||
self.store, self.state_handler, event, self.user_id
|
self.store, self.state_handler, event, self.user_id
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user