mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Presence fixes
This commit is contained in:
@@ -51,18 +51,15 @@ export class WAConnection extends Base {
|
||||
* @param jid the ID of the person/group who you are updating
|
||||
* @param type your presence
|
||||
*/
|
||||
updatePresence = (jid: string | null, type: Presence) =>
|
||||
this.query(
|
||||
{
|
||||
json: [
|
||||
'action',
|
||||
{ epoch: this.msgCount.toString(), type: 'set' },
|
||||
[['presence', { type: type, to: jid }, null]],
|
||||
],
|
||||
binaryTags: [WAMetric.group, WAFlag.acknowledge],
|
||||
expect200: true
|
||||
}
|
||||
) as Promise<{status: number}>
|
||||
updatePresence = (jid: string | null, type: Presence) => this.sendBinary(
|
||||
[ 'action',
|
||||
{epoch: this.msgCount.toString(), type: 'set'},
|
||||
[ ['presence', { type: type, to: jid }, null] ]
|
||||
],
|
||||
[WAMetric.presence, WAFlag[type] ], // weird stuff WA does
|
||||
undefined,
|
||||
true
|
||||
)
|
||||
/** Request an update on the presence of a user */
|
||||
requestPresenceUpdate = async (jid: string) => this.query({ json: ['action', 'presence', 'subscribe', jid] })
|
||||
/** Query the status of the person (see groupMetadata() for groups) */
|
||||
|
||||
Reference in New Issue
Block a user