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:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user