Acknowledge type update

This commit is contained in:
Adhiraj
2020-07-13 23:13:13 +05:30
parent 41c486422d
commit 3f84325bad
2 changed files with 2 additions and 3 deletions

View File

@@ -18,14 +18,13 @@ export default class WhatsAppWebBase extends WAConnection {
if (json.cmd === 'ack') {
ids = [json.id]
}
const ackTypes = [MessageStatus.sent, MessageStatus.received, MessageStatus.read]
const data: MessageStatusUpdate = {
from: json.from,
to: json.to,
participant: json.participant,
timestamp: new Date(json.t * 1000),
ids: ids,
type: ackTypes[json.ack - 1] || 'unknown (' + json.ack + ')',
type: json.ack,
}
callback(data)
}

View File

@@ -100,7 +100,7 @@ export interface MessageStatusUpdate {
/** Message IDs read/delivered */
ids: string[]
/** Status of the Message IDs */
type: string
type: proto.WebMessageInfo.WEB_MESSAGE_INFO_STATUS
}
export interface PresenceUpdate {
id: string