From e097c2b24f881f31579ccefa4d51410f043b51ce Mon Sep 17 00:00:00 2001 From: Bob <115008575+FortisEtMagnus@users.noreply.github.com> Date: Wed, 6 Dec 2023 06:59:03 -0300 Subject: [PATCH 1/6] Update Call.ts --- src/Types/Call.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Types/Call.ts b/src/Types/Call.ts index cea184a..06f3b1f 100644 --- a/src/Types/Call.ts +++ b/src/Types/Call.ts @@ -5,10 +5,11 @@ export type WACallEvent = { chatId: string from: string isGroup?: boolean + groupJid?: string id: string date: Date isVideo?: boolean status: WACallUpdateType offline: boolean latencyMs?: number -} \ No newline at end of file +} From ae8395e6df4a59200c24700093ff9dae89aa0387 Mon Sep 17 00:00:00 2001 From: Bob <115008575+FortisEtMagnus@users.noreply.github.com> Date: Wed, 6 Dec 2023 07:00:15 -0300 Subject: [PATCH 2/6] Update messages-recv.ts --- src/Socket/messages-recv.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 5ed6a7a..1318fbb 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -744,7 +744,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { if(status === 'offer') { call.isVideo = !!getBinaryNodeChild(infoChild, 'video') - call.isGroup = infoChild.attrs.type === 'group' + call.isGroup = infoChild.attrs.type === 'group' || !!infoChild.attrs['group-jid'] + call.groupJid = infoChild.attrs['group-jid'] callOfferCache.set(call.id, call) } From ec6a3a93193a8bd6bc5bce8aea3d9c8e22400ce5 Mon Sep 17 00:00:00 2001 From: Bob <115008575+bobpetrov@users.noreply.github.com> Date: Sat, 23 Dec 2023 21:54:58 -0300 Subject: [PATCH 3/6] fix lint --- src/Socket/groups.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Socket/groups.ts b/src/Socket/groups.ts index cfc11a9..f1613c1 100644 --- a/src/Socket/groups.ts +++ b/src/Socket/groups.ts @@ -318,7 +318,7 @@ export const extractGroupMetadata = (result: BinaryNode) => { const groupId = group.attrs.id.includes('@') ? group.attrs.id : jidEncode(group.attrs.id, 'g.us') const eph = getBinaryNodeChild(group, 'ephemeral')?.attrs.expiration - const memberAddMode = getBinaryNodeChildString(group, 'member_add_mode') == "all_member_add" + const memberAddMode = getBinaryNodeChildString(group, 'member_add_mode') === 'all_member_add' const metadata: GroupMetadata = { id: groupId, subject: group.attrs.subject, From 745e36e60325bc893fd152da0c61c8cb85ef3f06 Mon Sep 17 00:00:00 2001 From: Bob <115008575+bobpetrov@users.noreply.github.com> Date: Sat, 23 Dec 2023 21:55:53 -0300 Subject: [PATCH 4/6] fix lint --- src/Socket/messages-recv.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 1318fbb..27f6aca 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -392,16 +392,15 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { }, } }) - } else if (child.tag === 'blocklist') { + } 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 }) + const blocklist = [attrs.jid] + const type = (attrs.action === 'block') ? 'add' : 'remove' + ev.emit('blocklist.update', { blocklist, type }) } - } + } break case 'link_code_companion_reg': From 04370b259dd94bd835fa9b478a43d68e4a5c10c3 Mon Sep 17 00:00:00 2001 From: Bob <115008575+bobpetrov@users.noreply.github.com> Date: Sat, 23 Dec 2023 21:56:59 -0300 Subject: [PATCH 5/6] fix lint --- src/Socket/messages-recv.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 27f6aca..4daa9d2 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -397,7 +397,7 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { for(const { attrs } of blocklists) { const blocklist = [attrs.jid] - const type = (attrs.action === 'block') ? 'add' : 'remove' + const type = attrs.action === 'block' ? 'add' : 'remove' ev.emit('blocklist.update', { blocklist, type }) } } From c545ed628d30dd6029e8a8ce8bb351512dc5cd91 Mon Sep 17 00:00:00 2001 From: Bob <115008575+bobpetrov@users.noreply.github.com> Date: Sat, 23 Dec 2023 22:06:26 -0300 Subject: [PATCH 6/6] fix conflict --- src/Socket/messages-recv.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Socket/messages-recv.ts b/src/Socket/messages-recv.ts index 4daa9d2..dd79b4c 100644 --- a/src/Socket/messages-recv.ts +++ b/src/Socket/messages-recv.ts @@ -397,7 +397,8 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => { for(const { attrs } of blocklists) { const blocklist = [attrs.jid] - const type = attrs.action === 'block' ? 'add' : 'remove' + const type = (attrs.action === 'block') ? 'add' : 'remove' + ev.emit('blocklist.update', { blocklist, type }) } }