diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 12156b5..46b7279 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -465,25 +465,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { ws.on('CB:receipt', handleReceipt) ws.on('CB:notification', async(node: BinaryNode) => { - const sendAck = async() => { - const stanza: BinaryNode = { - tag: 'ack', - attrs: { - class: 'notification', - id: node.attrs.id, - type: node.attrs.type, - to: node.attrs.from - } - } - if(node.attrs.participant) { - stanza.attrs.participant = node.attrs.participant - } - await sendNode(stanza) - - logger.debug({ attrs: stanza.attrs }, 'ack notification') - } - - await sendAck() + await sendMessageAck(node, { class: 'notification', type: node.attrs.type }) const msg = processNotification(node) if(msg) {