From 85987a574d3859d1f81f0433f769516504416ed0 Mon Sep 17 00:00:00 2001 From: Adhiraj Date: Wed, 29 Jul 2020 22:56:12 +0530 Subject: [PATCH] Forwarding other people's messages only --- src/WAClient/Messages.ts | 5 ++++- src/WAClient/Tests.ts | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/WAClient/Messages.ts b/src/WAClient/Messages.ts index b5b30b3..69c4fd6 100644 --- a/src/WAClient/Messages.ts +++ b/src/WAClient/Messages.ts @@ -213,7 +213,10 @@ export default class WhatsAppWebMessages extends WhatsAppWebGroups { key = MessageType.extendedText } - content[key].contextInfo = { forwardingScore: (score+1), isForwarded: true } + + if (!message.key.fromMe) content[key].contextInfo = { forwardingScore: (score+1), isForwarded: true } + else content[key].contextInfo = {} + return this.sendGenericMessage (id, content, {}) } async sendMessage( diff --git a/src/WAClient/Tests.ts b/src/WAClient/Tests.ts index 7f042df..667278c 100644 --- a/src/WAClient/Tests.ts +++ b/src/WAClient/Tests.ts @@ -146,6 +146,10 @@ WAClientTest('Misc', (client) => { assert.ok(response) assert.rejects(client.getProfilePicture('abcd@s.whatsapp.net')) }) + it('should send typing indicator', async () => { + const response = await client.updatePresence(testJid, Presence.composing) + assert.ok(response) + }) it('should mark a chat unread', async () => { await client.sendReadReceipt(testJid, null, 'unread') })