Fix Group getInviteCode (#3492)

* Update Store.js add new require to fix getInviteCode method

* Update GroupChat.js adjusting method getInviteCode
This commit is contained in:
BenyFilho 2025-03-26 01:56:32 -03:00 • committed by GitHub
commit 441a3a6d6c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -381,9 +381,9 @@ class GroupChat extends Chat {
const codeRes = await this.client.pupPage.evaluate(async chatId => {
const chatWid = window.Store.WidFactory.createWid(chatId);
try {
return window.compareWwebVersions(window.Debug.VERSION, '>=', '2.3000.0')
? await window.Store.GroupInvite.queryGroupInviteCode(chatWid, true)
: await window.Store.GroupInvite.queryGroupInviteCode(chatWid);
return window.compareWwebVersions(window.Debug.VERSION, '>=', '2.3000.1020730154')
? await window.Store.GroupInvite.fetchMexGroupInviteCode(chatId)
: await window.Store.GroupInvite.queryGroupInviteCode(chatWid, true);
}
catch (err) {
if(err.name === 'ServerStatusCodeError') return undefined;
@ -391,7 +391,9 @@ class GroupChat extends Chat {
}
}, this.id._serialized);
return codeRes?.code;
return codeRes?.code
? codeRes?.code
: codeRes;
}
/**

View file

@ -122,7 +122,8 @@ exports.ExposeStore = () => {
};
window.Store.GroupInvite = {
...window.require('WAWebGroupInviteJob'),
...window.require('WAWebGroupQueryJob')
...window.require('WAWebGroupQueryJob'),
...window.require('WAWebMexFetchGroupInviteCodeJob')
};
window.Store.GroupInviteV4 = {
...window.require('WAWebGroupInviteV4Job'),