From 6c3f10e1d2717a3637f687991f7db0b12537e04a Mon Sep 17 00:00:00 2001 From: alessandrocampos224 <68436185+alessandrocampos224@users.noreply.github.com> Date: Thu, 29 Jan 2026 22:58:08 -0300 Subject: [PATCH] fix: update call handling for recent WhatsApp Web changes (#5775) * fix: update call handling for recent WhatsApp Web changes Updated the call handling logic to accommodate the renaming of Store.Call to WAWebCallCollection in recent WhatsApp Web versions. This ensures that incoming calls are properly managed without breaking functionality. * Update Client.js --------- Co-authored-by: BenyFilho <168232825+BenyFilho@users.noreply.github.com> Co-authored-by: tuyuribr <45042245+tuyuribr@users.noreply.github.com> --- src/Client.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Client.js b/src/Client.js index 1cb4ef8..a6393e6 100644 --- a/src/Client.js +++ b/src/Client.js @@ -756,7 +756,10 @@ class Client extends EventEmitter { window.Store.Msg.on('change:body change:caption', (msg, newBody, prevBody) => { window.onEditMessageEvent(window.WWebJS.getMessageModel(msg), newBody, prevBody); }); window.Store.AppState.on('change:state', (_AppState, state) => { window.onAppStateChangedEvent(state); }); window.Store.Conn.on('change:battery', (state) => { window.onBatteryStateChangedEvent(state); }); - window.Store.Call.on('add', (call) => { window.onIncomingCall(call); }); + const callCollection = (window.Store && window.Store.Call) || (window.Store && window.Store.WAWebCallCollection); + if (callCollection && typeof callCollection.on === 'function') { + callCollection.on('add', (call) => { window.onIncomingCall(call); }); + } window.Store.Chat.on('remove', async (chat) => { window.onRemoveChatEvent(await window.WWebJS.getChatModel(chat)); }); window.Store.Chat.on('change:archive', async (chat, currState, prevState) => { window.onArchiveChatEvent(await window.WWebJS.getChatModel(chat), currState, prevState); }); window.Store.Msg.on('add', (msg) => {