mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Minor updates
This commit is contained in:
@@ -215,7 +215,7 @@ export class WAConnection extends Base {
|
|||||||
|
|
||||||
if (this.state === 'open' && json[0] === 'Pong') {
|
if (this.state === 'open' && json[0] === 'Pong') {
|
||||||
if (!json[1]) {
|
if (!json[1]) {
|
||||||
this.closeInternal(DisconnectReason.close)
|
this.unexpectedDisconnect(DisconnectReason.close)
|
||||||
this.logger.info('Connection terminated by phone, closing...')
|
this.logger.info('Connection terminated by phone, closing...')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,9 +172,6 @@ export class WAConnection extends Base {
|
|||||||
*/
|
*/
|
||||||
@Mutex (jid => jid)
|
@Mutex (jid => jid)
|
||||||
async blockUser (jid: string, type: 'add' | 'remove' = 'add') {
|
async blockUser (jid: string, type: 'add' | 'remove' = 'add') {
|
||||||
jid.replace('@s.whatsapp.net', '@c.us')
|
|
||||||
|
|
||||||
const tag = this.generateMessageTag()
|
|
||||||
const json: WANode = [
|
const json: WANode = [
|
||||||
'block',
|
'block',
|
||||||
{
|
{
|
||||||
@@ -184,7 +181,7 @@ export class WAConnection extends Base {
|
|||||||
['user', { jid }, null]
|
['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 (result.status === 200) {
|
||||||
if (type === 'add') {
|
if (type === 'add') {
|
||||||
|
|||||||
Reference in New Issue
Block a user