From 8777f7fa70014584f3a8b96bc050f619374cdef2 Mon Sep 17 00:00:00 2001 From: Rajeh Taher Date: Tue, 12 Mar 2024 06:23:56 +0200 Subject: [PATCH] fix ack --- src/Socket/messages-recv.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index f22a7f5..8e7f544 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -99,10 +99,14 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { stanza.attrs.recipient = attrs.recipient } - if(tag !== 'message' && attrs.type) { + if(!!attrs.type) { stanza.attrs.type = attrs.type } + if(tag === "message") { + stanza.attrs.from = authState.creds.me!.id + } + logger.debug({ recv: { tag, attrs }, sent: stanza.attrs }, 'sent ack') await sendNode(stanza) } @@ -111,7 +115,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { const stanza: BinaryNode = ({ tag: 'call', attrs: { - from: authState.creds.me!.id, + from: authState.creds.me!, to: callFrom, }, content: [{