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: [{