Add requiresPhoneConnection to sendMessage

This commit is contained in:
Adhiraj Singh
2020-12-29 00:42:28 +05:30
parent 5fb9e8abed
commit 471ba8c23f

View File

@@ -280,7 +280,8 @@ export class WAConnection extends Base {
json,
binaryTags: [WAMetric.message, flag],
tag: mID,
expect200: true
expect200: true,
requiresPhoneConnection: true
})
.then(() => message.status = WA_MESSAGE_STATUS_TYPE.SERVER_ACK)
@@ -304,7 +305,12 @@ export class WAConnection extends Base {
if (!content) throw new BaileysError (`given message ${message.key.id} is not a media message`, message)
const query = ['query',{type: 'media', index: message.key.id, owner: message.key.fromMe ? 'true' : 'false', jid: message.key.remoteJid, epoch: this.msgCount.toString()},null]
const response = await this.query ({json: query, binaryTags: [WAMetric.queryMedia, WAFlag.ignore], expect200: true})
const response = await this.query ({
json: query,
binaryTags: [WAMetric.queryMedia, WAFlag.ignore],
expect200: true,
requiresPhoneConnection: true
})
Object.keys (response[1]).forEach (key => content[key] = response[1][key]) // update message
}
/**