Refactor read state tracking
Adds support for handling early arriving read receipts. // FREEBIE
This commit is contained in:
parent
d1e9534542
commit
0cd7f84a05
4 changed files with 55 additions and 25 deletions
|
@ -326,7 +326,12 @@
|
|||
}
|
||||
attributes.active_at = now;
|
||||
if (type === 'incoming') {
|
||||
attributes.unreadCount = conversation.get('unreadCount') + 1;
|
||||
// experimental
|
||||
if (Whisper.ReadReceipts.forMessage(message)) {
|
||||
message.unset('unread');
|
||||
} else {
|
||||
attributes.unreadCount = conversation.get('unreadCount') + 1;
|
||||
}
|
||||
}
|
||||
conversation.set(attributes);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue