Skip to content

Commit 0447c5a

Browse files
committed
Fixed contact_changed event to get the correct newId and oldId
1 parent 9899f40 commit 0447c5a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/Client.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,8 @@ class Client extends EventEmitter {
700700
/** @type {GroupNotification} object does not provide enough information about this event, so a @type {Message} object is used. */
701701
const message = new Message(this, msg);
702702

703-
const newId = isParticipant ? msg.recipients[0] : msg.to;
704-
const oldId = isParticipant
705-
? msg.author
706-
: msg.templateParams.find((id) => id !== newId);
703+
const newId = isParticipant ? msg.recipients[0] : msg._data.templateParams[1];
704+
const oldId = isParticipant ? msg.author : msg._data.templateParams[0];
707705

708706
/**
709707
* Emitted when a contact or a group participant changes their phone number.

0 commit comments

Comments
 (0)