Fix Reject Calls (#3909)

This commit is contained in:
BenyFilho 2025-11-04 16:13:18 -03:00 • committed by GitHub
commit 0cdfda238f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -825,22 +825,22 @@ exports.LoadUtils = () => {
}; };
window.WWebJS.rejectCall = async (peerJid, id) => { window.WWebJS.rejectCall = async (peerJid, id) => {
peerJid = peerJid.split('@')[0] + '@s.whatsapp.net'; let userId = window.Store.User.getMaybeMePnUser()._serialized;
let userId = window.Store.User.getMaybeMePnUser().user + '@s.whatsapp.net';
const stanza = window.Store.SocketWap.wap('call', { const stanza = window.Store.SocketWap.wap('call', {
id: window.Store.SocketWap.generateId(), id: window.Store.SocketWap.generateId(),
from: window.Store.SocketWap.USER_JID(userId), from: userId,
to: window.Store.SocketWap.USER_JID(peerJid), to: peerJid,
}, [ }, [
window.Store.SocketWap.wap('reject', { window.Store.SocketWap.wap('reject', {
'call-id': id, 'call-id': id,
'call-creator': window.Store.SocketWap.USER_JID(peerJid), 'call-creator': peerJid,
count: '0', count: '0',
}) })
]); ]);
await window.Store.Socket.deprecatedCastStanza(stanza); await window.Store.Socket.deprecatedCastStanza(stanza);
}; };
window.WWebJS.cropAndResizeImage = async (media, options = {}) => { window.WWebJS.cropAndResizeImage = async (media, options = {}) => {
if (!media.mimetype.includes('image')) if (!media.mimetype.includes('image'))
throw new Error('Media is not an image'); throw new Error('Media is not an image');