components/app: close notifications when receiving READ message

This commit is contained in:
Simon Ser 2022-02-11 19:28:18 +01:00
parent 7c6f334dbf
commit 0636544c40

View file

@ -1022,6 +1022,14 @@ export default class App extends Component {
server: client.params, server: client.params,
receipts: { [ReceiptType.READ]: readReceipt }, receipts: { [ReceiptType.READ]: readReceipt },
}); });
for (let notif of this.messageNotifications) {
if (client.cm(notif.data.bufferName) !== client.cm(target)) {
continue;
}
if (isMessageBeforeReceipt(notif.data.message, readReceipt)) {
notif.close();
}
}
this.setBufferState({ server: serverID, name: target }, (buf) => { this.setBufferState({ server: serverID, name: target }, (buf) => {
if (buf.prevReadReceipt && buf.prevReadReceipt.time >= readReceipt.time) { if (buf.prevReadReceipt && buf.prevReadReceipt.time >= readReceipt.time) {
return; return;