fix: handle receipts more accurately

1. only send timestamp with read receipts
2. use unix timestamp in seconds instead of millis
3. use "sender" receipts for own messages
This commit is contained in:
Adhiraj Singh
2022-04-03 11:27:13 +05:30
parent 64bab02b7c
commit 59f834ca39
4 changed files with 35 additions and 21 deletions

View File

@@ -14,8 +14,8 @@ export const decodeMessageStanza = (stanza: BinaryNode, auth: AuthenticationStat
let chatId: string
let author: string
const msgId: string = stanza.attrs.id
const from: string = stanza.attrs.from
const msgId = stanza.attrs.id
const from = stanza.attrs.from
const participant: string | undefined = stanza.attrs.participant
const recipient: string | undefined = stanza.attrs.recipient
@@ -83,6 +83,7 @@ export const decodeMessageStanza = (stanza: BinaryNode, auth: AuthenticationStat
return {
fullMessage,
category: stanza.attrs.category,
author,
decryptionTask: (async() => {
let decryptables = 0
if(Array.isArray(stanza.content)) {