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:
6
store.js
6
store.js
@@ -1,3 +1,5 @@
|
||||
import { ReceiptType } from "./state.js";
|
||||
|
||||
const PREFIX = "gamja_";
|
||||
|
||||
class Item {
|
||||
@@ -90,6 +92,10 @@ export class Buffer {
|
||||
updated = true;
|
||||
}
|
||||
});
|
||||
if (receipts[ReceiptType.DELIVERED] < receipts[ReceiptType.READ]) {
|
||||
receipts[ReceiptType.DELIVERED] = receipts[ReceiptType.READ];
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!updated) {
|
||||
|
||||
Reference in New Issue
Block a user