mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-14 19:05:01 -05:00
components/app: close notifications when receiving READ message
This commit is contained in:
parent
7c6f334dbf
commit
0636544c40
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue