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>
This commit is contained in:
alessandrocampos224 2026-01-29 22:58:08 -03:00 • committed by GitHub
commit 6c3f10e1d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) => {