Skip to content

Commit

Permalink
fix: Fixed group.participant_changed event for join action
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Sep 1, 2023
1 parent 209c994 commit d23c557
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/group/events/registerParticipantsChangedEvent.ts
Expand Up @@ -38,7 +38,10 @@ function register() {
return p;
});

if (actionType === 'add' && action.isInvite) {
if (
actionType === 'add' &&
(action.isInvite || action.reason === 'invite')
) {
actionType = 'join';
} else if (
actionType === 'remove' &&
Expand Down
2 changes: 2 additions & 0 deletions src/whatsapp/functions/updateDBForGroupAction.ts
Expand Up @@ -29,13 +29,15 @@ export interface GroupActionParticipant {
export interface GroupActionChange {
action: string;
actionType: string; // @whatsapp >= 2.2224.6
isLidAddressingMode?: boolean;
isInvite?: boolean;
isLinkedGroupJoin?: boolean;
/**
* GroupActionParticipant for @whatsapp >= 2.2234.6
*/
participants: Wid[] | GroupActionParticipant[];
prevVersion: number;
reason: string;
version: number;
}

Expand Down

0 comments on commit d23c557

Please sign in to comment.