Do not trigger notifications for timer updates

This commit is contained in:
lilia 2016-09-28 19:28:23 -07:00
parent 7a26cf79ee
commit e488c19889

View file

@ -329,6 +329,14 @@
message.set({group_update: group_update}); message.set({group_update: group_update});
} }
} }
message.set({
body : dataMessage.body,
conversationId : conversation.id,
attachments : dataMessage.attachments,
decrypted_at : now,
flags : dataMessage.flags,
errors : []
});
if (type === 'outgoing') { if (type === 'outgoing') {
var receipts = Whisper.DeliveryReceipts.forMessage(conversation, message); var receipts = Whisper.DeliveryReceipts.forMessage(conversation, message);
receipts.forEach(function(receipt) { receipts.forEach(function(receipt) {
@ -340,7 +348,7 @@
attributes.active_at = now; attributes.active_at = now;
if (type === 'incoming') { if (type === 'incoming') {
// experimental // experimental
if (Whisper.ReadReceipts.forMessage(message)) { if (Whisper.ReadReceipts.forMessage(message) || message.isExpirationTimerUpdate()) {
message.unset('unread'); message.unset('unread');
} else { } else {
attributes.unreadCount = conversation.get('unreadCount') + 1; attributes.unreadCount = conversation.get('unreadCount') + 1;
@ -348,14 +356,6 @@
} }
conversation.set(attributes); conversation.set(attributes);
message.set({
body : dataMessage.body,
conversationId : conversation.id,
attachments : dataMessage.attachments,
decrypted_at : now,
flags : dataMessage.flags,
errors : []
});
if (message.isExpirationTimerUpdate()) { if (message.isExpirationTimerUpdate()) {
message.set({ message.set({
expirationTimerUpdate: { expirationTimerUpdate: {