mirror of
https://git.sr.ht/~emersion/gamja
synced 2024-11-14 19:25:26 -05:00
Update stored unread status on READ message
This commit is contained in:
parent
a3eec9a351
commit
f2c9fd1d7f
1 changed files with 9 additions and 6 deletions
|
@ -1018,12 +1018,8 @@ export default class App extends Component {
|
|||
break;
|
||||
}
|
||||
let readReceipt = { time: bound.replace("timestamp=", "") };
|
||||
let updated = this.bufferStore.put({
|
||||
name: target,
|
||||
server: client.params,
|
||||
receipts: { [ReceiptType.READ]: readReceipt },
|
||||
});
|
||||
if (!updated) {
|
||||
let stored = this.bufferStore.get({ name: target, server: client.params });
|
||||
if (isReceiptBefore(readReceipt, getReceipt(stored, ReceiptType.READ))) {
|
||||
break;
|
||||
}
|
||||
for (let notif of this.messageNotifications) {
|
||||
|
@ -1054,6 +1050,13 @@ export default class App extends Component {
|
|||
unread = Unread.MESSAGE;
|
||||
}
|
||||
|
||||
this.bufferStore.put({
|
||||
name: target,
|
||||
server: client.params,
|
||||
unread,
|
||||
receipts: { [ReceiptType.READ]: readReceipt },
|
||||
});
|
||||
|
||||
return { unread };
|
||||
});
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue