mirror of
https://codeberg.org/emersion/gamja.git
synced 2024-11-25 00:38:12 -05:00
Make delivery receipts follow read receipts
If a message has been read, it's been delivered. Fixes #23 at least partially. References: https://todo.sr.ht/~emersion/gamja/23
This commit is contained in:
parent
065b3f21fc
commit
77f54080e7
1 changed files with 6 additions and 0 deletions
6
store.js
6
store.js
|
@ -1,3 +1,5 @@
|
||||||
|
import { ReceiptType } from "./state.js";
|
||||||
|
|
||||||
const PREFIX = "gamja_";
|
const PREFIX = "gamja_";
|
||||||
|
|
||||||
class Item {
|
class Item {
|
||||||
|
@ -90,6 +92,10 @@ export class Buffer {
|
||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (receipts[ReceiptType.DELIVERED] < receipts[ReceiptType.READ]) {
|
||||||
|
receipts[ReceiptType.DELIVERED] = receipts[ReceiptType.READ];
|
||||||
|
updated = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!updated) {
|
if (!updated) {
|
||||||
|
|
Loading…
Reference in a new issue