From 7b5bb1f428169632c85ede75b231f9ec2ddd0c43 Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 11 Nov 2021 15:14:42 +0530 Subject: [PATCH] style: use sendMessageAck in recv notification --- src/Socket/messages-recv.ts | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) 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) {