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:
parent
f56d25f1c4
commit
441a3a6d6c
2 changed files with 8 additions and 5 deletions
|
|
@ -381,9 +381,9 @@ class GroupChat extends Chat {
|
||||||
const codeRes = await this.client.pupPage.evaluate(async chatId => {
|
const codeRes = await this.client.pupPage.evaluate(async chatId => {
|
||||||
const chatWid = window.Store.WidFactory.createWid(chatId);
|
const chatWid = window.Store.WidFactory.createWid(chatId);
|
||||||
try {
|
try {
|
||||||
return window.compareWwebVersions(window.Debug.VERSION, '>=', '2.3000.0')
|
return window.compareWwebVersions(window.Debug.VERSION, '>=', '2.3000.1020730154')
|
||||||
? await window.Store.GroupInvite.queryGroupInviteCode(chatWid, true)
|
? await window.Store.GroupInvite.fetchMexGroupInviteCode(chatId)
|
||||||
: await window.Store.GroupInvite.queryGroupInviteCode(chatWid);
|
: await window.Store.GroupInvite.queryGroupInviteCode(chatWid, true);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
if(err.name === 'ServerStatusCodeError') return undefined;
|
if(err.name === 'ServerStatusCodeError') return undefined;
|
||||||
|
|
@ -391,7 +391,9 @@ class GroupChat extends Chat {
|
||||||
}
|
}
|
||||||
}, this.id._serialized);
|
}, this.id._serialized);
|
||||||
|
|
||||||
return codeRes?.code;
|
return codeRes?.code
|
||||||
|
? codeRes?.code
|
||||||
|
: codeRes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,8 @@ exports.ExposeStore = () => {
|
||||||
};
|
};
|
||||||
window.Store.GroupInvite = {
|
window.Store.GroupInvite = {
|
||||||
...window.require('WAWebGroupInviteJob'),
|
...window.require('WAWebGroupInviteJob'),
|
||||||
...window.require('WAWebGroupQueryJob')
|
...window.require('WAWebGroupQueryJob'),
|
||||||
|
...window.require('WAWebMexFetchGroupInviteCodeJob')
|
||||||
};
|
};
|
||||||
window.Store.GroupInviteV4 = {
|
window.Store.GroupInviteV4 = {
|
||||||
...window.require('WAWebGroupInviteV4Job'),
|
...window.require('WAWebGroupInviteV4Job'),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue