Skip to content

Commit

Permalink
fix: Fixed join group via invite (close #1986)
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jun 10, 2024
1 parent 12899c8 commit e3d26fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/whatsapp/functions/sendJoinGroupViaInvite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/

import { getGroupInfoFromInviteCode, iAmMember } from '../../group';
import * as webpack from '../../webpack';
import { Wid } from '..';
import { exportModule } from '../exportModule';
Expand All @@ -37,6 +38,9 @@ exportModule(
*/
webpack.injectFallbackModule('sendJoinGroupViaInvite', {
sendJoinGroupViaInvite: async (groupId: Wid) => {
const group = await getGroupInfoFromInviteCode(groupId as any);
const isMember = await iAmMember(group.id.toString());
if (isMember) return group.id;
return await joinGroupViaInvite(groupId).then((value) => value.gid);
},
});

0 comments on commit e3d26fa

Please sign in to comment.