Skip to content

Commit 441a3a6

Browse files
authored
Fix Group getInviteCode (#3492)
* Update Store.js add new require to fix getInviteCode method * Update GroupChat.js adjusting method getInviteCode
1 parent f56d25f commit 441a3a6

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/structures/GroupChat.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,17 +381,19 @@ class GroupChat extends Chat {
381381
const codeRes = await this.client.pupPage.evaluate(async chatId => {
382382
const chatWid = window.Store.WidFactory.createWid(chatId);
383383
try {
384-
return window.compareWwebVersions(window.Debug.VERSION, '>=', '2.3000.0')
385-
? await window.Store.GroupInvite.queryGroupInviteCode(chatWid, true)
386-
: await window.Store.GroupInvite.queryGroupInviteCode(chatWid);
384+
return window.compareWwebVersions(window.Debug.VERSION, '>=', '2.3000.1020730154')
385+
? await window.Store.GroupInvite.fetchMexGroupInviteCode(chatId)
386+
: await window.Store.GroupInvite.queryGroupInviteCode(chatWid, true);
387387
}
388388
catch (err) {
389389
if(err.name === 'ServerStatusCodeError') return undefined;
390390
throw err;
391391
}
392392
}, this.id._serialized);
393393

394-
return codeRes?.code;
394+
return codeRes?.code
395+
? codeRes?.code
396+
: codeRes;
395397
}
396398

397399
/**

src/util/Injected/Store.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ exports.ExposeStore = () => {
122122
};
123123
window.Store.GroupInvite = {
124124
...window.require('WAWebGroupInviteJob'),
125-
...window.require('WAWebGroupQueryJob')
125+
...window.require('WAWebGroupQueryJob'),
126+
...window.require('WAWebMexFetchGroupInviteCodeJob')
126127
};
127128
window.Store.GroupInviteV4 = {
128129
...window.require('WAWebGroupInviteV4Job'),

0 commit comments

Comments
 (0)