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
This commit is contained in:
lilia 2016-04-04 16:14:15 -07:00
parent 7ff2d431b2
commit 0f4f00ff4e
2 changed files with 4 additions and 1 deletions

View file

@ -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) {

View file

@ -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');