Files
Baileys/src/Types/State.ts
Adhiraj Singh 6824a203d0 feat: correctly handle presence being offline for receipts
When sendPresenceUpdate('unavailable') is called, it should allow notifications to be received on the phone
2022-06-01 13:20:21 +05:30

29 lines
792 B
TypeScript

import { Contact } from './Contact'
export type WAConnectionState = 'open' | 'connecting' | 'close'
export type ConnectionState = {
/** connection is now open, connecting or closed */
connection: WAConnectionState
/** the error that caused the connection to close */
lastDisconnect?: {
error: Error
date: Date
}
/** is this a new login */
isNewLogin?: boolean
/** the current QR code */
qr?: string
/** has the device received all pending notifications while it was offline */
receivedPendingNotifications?: boolean
/** legacy connection options */
legacy?: {
phoneConnected: boolean
user?: Contact
}
/**
* if the client is shown as an active, online client.
* If this is false, the primary phone and other devices will receive notifs
* */
isOnline?: boolean
}