From 11291e61d0b67b37bcc29833804c0975bf512677 Mon Sep 17 00:00:00 2001 From: aliazhar Date: Sun, 3 Sep 2023 14:31:08 +0700 Subject: [PATCH] Fix: 'blocklist.update' was never emitted --- src/Socket/messages-recv.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 1c4d93ad890..5ed6a7a86d0 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -392,7 +392,16 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { }, } }) - } + } else if (child.tag === 'blocklist') { + const blocklists = getBinaryNodeChildren(child, 'item') + + for(const { attrs } of blocklists) { + const blocklist = [attrs.jid] + const type = (attrs.action === 'block') ? 'add' : 'remove' + + ev.emit('blocklist.update', { blocklist, type }) + } + } break case 'link_code_companion_reg':