Fix read sync on duplicate messages

In the case of a double send (same message encrypted and sent twice due
to key conflict bug), we would mark the first instance read twice rather
than marking both instances read. Fix by searching for matching messages
that have not yet been marked read.

// FREEBIE
pull/749/head
lilia 9 years ago
parent 7ff2d431b2
commit 0f4f00ff4e

@ -253,7 +253,7 @@
var ids = groups.pluck('id');
ids.push(sender);
var message = messages.find(function(message) {
return (message.get('type') === 'incoming' &&
return (message.isIncoming() && message.isUnread() &&
_.contains(ids, message.get('conversationId')));
});
if (message) {

@ -35,6 +35,9 @@
isIncoming: function() {
return this.get('type') === 'incoming';
},
isUnread: function() {
return !!this.get('unread');
},
getDescription: function() {
if (this.isGroupUpdate()) {
var group_update = this.get('group_update');

Loading…
Cancel
Save