parent
46c2918ff3
commit
33f88ac150
1 changed files with 22 additions and 5 deletions
|
|
@ -1020,8 +1020,7 @@ class Client extends EventEmitter {
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.pupPage.evaluate(() => {
|
await this.pupPage.evaluate(() => {
|
||||||
const { Msg, Chat, WAWebCallCollection } =
|
const { Msg, Chat } = window.require('WAWebCollections');
|
||||||
window.require('WAWebCollections');
|
|
||||||
const AppState = window.require('WAWebSocketModel').Socket;
|
const AppState = window.require('WAWebSocketModel').Socket;
|
||||||
|
|
||||||
// Enable placeholder message resend (recovery for ciphertext messages)
|
// Enable placeholder message resend (recovery for ciphertext messages)
|
||||||
|
|
@ -1069,13 +1068,31 @@ class Client extends EventEmitter {
|
||||||
.Conn.on('change:battery', (state) => {
|
.Conn.on('change:battery', (state) => {
|
||||||
window.onBatteryStateChangedEvent(state);
|
window.onBatteryStateChangedEvent(state);
|
||||||
});
|
});
|
||||||
|
const WAWebCallCollection = window.require('WAWebCallCollection');
|
||||||
if (
|
if (
|
||||||
WAWebCallCollection &&
|
WAWebCallCollection &&
|
||||||
typeof WAWebCallCollection.on === 'function'
|
typeof WAWebCallCollection.on === 'function'
|
||||||
) {
|
) {
|
||||||
WAWebCallCollection.on('add', (call) => {
|
const mapKey = Object.keys(WAWebCallCollection).find(
|
||||||
window.onIncomingCall(call);
|
(k) => WAWebCallCollection[k] instanceof Map,
|
||||||
});
|
);
|
||||||
|
const internalCallMap = WAWebCallCollection[mapKey];
|
||||||
|
const originalMapSet =
|
||||||
|
internalCallMap.set.bind(internalCallMap);
|
||||||
|
|
||||||
|
internalCallMap.set = function (key, value) {
|
||||||
|
window.onIncomingCall({
|
||||||
|
id: value.id,
|
||||||
|
peerJid: value.peerJid,
|
||||||
|
isVideo: value.isVideo,
|
||||||
|
isGroup: value.isGroup,
|
||||||
|
canHandleLocally: value.canHandleLocally,
|
||||||
|
outgoing: value.outgoing,
|
||||||
|
webClientShouldHandle: value.webClientShouldHandle,
|
||||||
|
participants: value.participants,
|
||||||
|
});
|
||||||
|
return originalMapSet(key, value);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
Chat.on('remove', async (chat) => {
|
Chat.on('remove', async (chat) => {
|
||||||
window.onRemoveChatEvent(
|
window.onRemoveChatEvent(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue