From 7b2aa7dd8a2bc0810553cb5f93134b14331e091f Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 29 Oct 2020 16:44:29 +0530 Subject: [PATCH] Ensure @s.whatsapp.net for message-update --- src/WAConnection/4.Events.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/WAConnection/4.Events.ts b/src/WAConnection/4.Events.ts index ce1dbf9..9a019fd 100644 --- a/src/WAConnection/4.Events.ts +++ b/src/WAConnection/4.Events.ts @@ -141,7 +141,7 @@ export class WAConnection extends Base { if (json.type === 'error') { const update: WAMessageStatusUpdate = { from: this.user.jid, - to: json.jid, + to: whatsappID(json.jid), participant: this.user.jid, timestamp: new Date(), ids: [ json.index ], @@ -158,9 +158,9 @@ export class WAConnection extends Base { if (json.cmd === 'ack') ids = [json.id] const update: WAMessageStatusUpdate = { - from: json.from, - to: json.to, - participant: json.participant, + from: whatsappID(json.from), + to: whatsappID(json.to), + participant: whatsappID(json.participant), timestamp: new Date(json.t * 1000), ids: ids, type: (+json.ack)+1,