Require phone connection in required places

This commit is contained in:
Adhiraj Singh
2020-12-23 09:31:00 +05:30
parent 523f0341ed
commit bc3cb6c178
4 changed files with 18 additions and 7 deletions

View File

@@ -19,7 +19,12 @@ export class WAConnection extends Base {
@Mutex ((jid, messageID) => jid+messageID)
async messageInfo (jid: string, messageID: string) {
const query = ['query', {type: 'message_info', index: messageID, jid: jid, epoch: this.msgCount.toString()}, null]
const [,,response] = await this.query ({json: query, binaryTags: [WAMetric.queryRead, WAFlag.ignore], expect200: true})
const [,,response] = await this.query ({
json: query,
binaryTags: [WAMetric.queryRead, WAFlag.ignore],
expect200: true,
requiresPhoneConnection: true
})
const info: MessageInfo = {reads: [], deliveries: []}
if (response) {
@@ -87,7 +92,7 @@ export class WAConnection extends Base {
},
null,
]
const response = await this.query({json, binaryTags: [WAMetric.queryMessages, WAFlag.ignore], expect200: false})
const response = await this.query({json, binaryTags: [WAMetric.queryMessages, WAFlag.ignore], expect200: false, requiresPhoneConnection: true})
return (response[2] as WANode[])?.map(item => item[2] as WAMessage) || []
}
/**