Update messages-recv.ts

This commit is contained in:
azudin
2023-12-02 07:37:35 +08:00
committed by GitHub
parent ece99eab23
commit 4b3841d202

View File

@@ -392,14 +392,13 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
}, },
} }
}) })
} else if (child.tag === 'blocklist') { } else if(child.tag === 'blocklist') {
const blocklists = getBinaryNodeChildren(child, 'item') const blocklists = getBinaryNodeChildren(child, 'item')
for(const { attrs } of blocklists) { for(const { attrs } of blocklists) {
const blocklist = [attrs.jid] const blocklist = [attrs.jid]
const type = (attrs.action === 'block') ? 'add' : 'remove' const type = (attrs.action === 'block') ? 'add' : 'remove'
ev.emit('blocklist.update', { blocklist, type })
ev.emit('blocklist.update', { blocklist, type })
} }
} }