fix logic

This commit is contained in:
Rajeh Taher
2024-03-12 23:56:38 +02:00
committed by GitHub
parent b66b362512
commit 99cd10b621

View File

@@ -99,13 +99,14 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
stanza.attrs.recipient = attrs.recipient
}
if(!!attrs.type) {
stanza.attrs.type = attrs.type
}
if(tag === 'message') {
stanza.attrs.from = authState.creds.me!.id
}
if (!!attrs.type && (tag !== "message" || getBinaryNodeChild({ tag, attrs, content }, "unavailable"))) {
stanza.attrs.type = attrs.type;
}
if(tag === "message" && getBinaryNodeChild({ tag, attrs, content }, "unavailable")) {
stanza.attrs.from = authState.creds.me!.id;
}
logger.debug({ recv: { tag, attrs }, sent: stanza.attrs }, 'sent ack')
await sendNode(stanza)