From 5fb9e8abed1002a66ffdf945f1c34135fb6df06a Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Mon, 28 Dec 2020 11:44:02 +0530 Subject: [PATCH] Minor updates --- src/WAConnection/3.Connect.ts | 2 +- src/WAConnection/5.User.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/WAConnection/3.Connect.ts b/src/WAConnection/3.Connect.ts index 62e8811..e71034f 100644 --- a/src/WAConnection/3.Connect.ts +++ b/src/WAConnection/3.Connect.ts @@ -215,7 +215,7 @@ export class WAConnection extends Base { if (this.state === 'open' && json[0] === 'Pong') { if (!json[1]) { - this.closeInternal(DisconnectReason.close) + this.unexpectedDisconnect(DisconnectReason.close) this.logger.info('Connection terminated by phone, closing...') return } diff --git a/src/WAConnection/5.User.ts b/src/WAConnection/5.User.ts index 3248ac6..46222df 100644 --- a/src/WAConnection/5.User.ts +++ b/src/WAConnection/5.User.ts @@ -172,9 +172,6 @@ export class WAConnection extends Base { */ @Mutex (jid => jid) async blockUser (jid: string, type: 'add' | 'remove' = 'add') { - jid.replace('@s.whatsapp.net', '@c.us') - - const tag = this.generateMessageTag() const json: WANode = [ 'block', { @@ -184,7 +181,7 @@ export class WAConnection extends Base { ['user', { jid }, null] ], ] - const result = await this.setQuery ([json], [WAMetric.block, WAFlag.ignore], tag) + const result = await this.setQuery ([json], [WAMetric.block, WAFlag.ignore]) if (result.status === 200) { if (type === 'add') {