mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Acknowledge type update
This commit is contained in:
@@ -18,14 +18,13 @@ export default class WhatsAppWebBase extends WAConnection {
|
|||||||
if (json.cmd === 'ack') {
|
if (json.cmd === 'ack') {
|
||||||
ids = [json.id]
|
ids = [json.id]
|
||||||
}
|
}
|
||||||
const ackTypes = [MessageStatus.sent, MessageStatus.received, MessageStatus.read]
|
|
||||||
const data: MessageStatusUpdate = {
|
const data: MessageStatusUpdate = {
|
||||||
from: json.from,
|
from: json.from,
|
||||||
to: json.to,
|
to: json.to,
|
||||||
participant: json.participant,
|
participant: json.participant,
|
||||||
timestamp: new Date(json.t * 1000),
|
timestamp: new Date(json.t * 1000),
|
||||||
ids: ids,
|
ids: ids,
|
||||||
type: ackTypes[json.ack - 1] || 'unknown (' + json.ack + ')',
|
type: json.ack,
|
||||||
}
|
}
|
||||||
callback(data)
|
callback(data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export interface MessageStatusUpdate {
|
|||||||
/** Message IDs read/delivered */
|
/** Message IDs read/delivered */
|
||||||
ids: string[]
|
ids: string[]
|
||||||
/** Status of the Message IDs */
|
/** Status of the Message IDs */
|
||||||
type: string
|
type: proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS
|
||||||
}
|
}
|
||||||
export interface PresenceUpdate {
|
export interface PresenceUpdate {
|
||||||
id: string
|
id: string
|
||||||
|
|||||||
Reference in New Issue
Block a user