mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
style: use sendMessageAck in recv notification
This commit is contained in:
@@ -465,25 +465,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
ws.on('CB:receipt', handleReceipt)
|
ws.on('CB:receipt', handleReceipt)
|
||||||
|
|
||||||
ws.on('CB:notification', async(node: BinaryNode) => {
|
ws.on('CB:notification', async(node: BinaryNode) => {
|
||||||
const sendAck = async() => {
|
await sendMessageAck(node, { class: 'notification', type: node.attrs.type })
|
||||||
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()
|
|
||||||
|
|
||||||
const msg = processNotification(node)
|
const msg = processNotification(node)
|
||||||
if(msg) {
|
if(msg) {
|
||||||
|
|||||||
Reference in New Issue
Block a user