Fix markRead when messages have not been loaded yet
Query the database and not just the in-memory messages. // FREEBIE
This commit is contained in:
parent
01053335ac
commit
b77d5df4f2
1 changed files with 12 additions and 12 deletions
|
@ -210,18 +210,18 @@
|
||||||
conversationId: conversationId
|
conversationId: conversationId
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var readReceipts = this.messageCollection.where({
|
this.getUnread().then(function(unreadMessages) {
|
||||||
type: 'incoming', unread: 1
|
var read = unreadMessages.map(function(m) {
|
||||||
}).map(function(m) {
|
m.markRead();
|
||||||
m.markRead();
|
return {
|
||||||
return {
|
sender : m.get('source'),
|
||||||
sender : m.get('source'),
|
timestamp : m.get('sent_at')
|
||||||
timestamp : m.get('sent_at')
|
};
|
||||||
};
|
});
|
||||||
}.bind(this));
|
if (read.length > 0) {
|
||||||
if (readReceipts.length > 0) {
|
textsecure.messaging.sendReadReceipts(read);
|
||||||
textsecure.messaging.sendReadReceipts(readReceipts);
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue