keybindings: fix error on alt+h

Fixes the following JS error:

    TypeError: e.setReceipt is not a function
This commit is contained in:
Simon Ser 2022-02-12 10:05:58 +01:00
parent fbc42b6dab
commit 5f8cd976e6
3 changed files with 19 additions and 17 deletions

View file

@ -85,6 +85,16 @@ export function getServerName(server, bouncerNetwork) {
}
}
export function receiptFromMessage(msg) {
// At this point all messages are supposed to have a time tag.
// App.addMessage ensures this is the case even if the server doesn't
// support server-time.
if (!msg.tags.time) {
throw new Error("Missing time message tag");
}
return { time: msg.tags.time };
}
export function isMessageBeforeReceipt(msg, receipt) {
if (!receipt) {
return false;