refactor: chats.set event

This commit is contained in:
Adhiraj Singh
2022-01-16 13:02:38 +05:30
parent 09553def8a
commit 7bb6e3ceeb
7 changed files with 30 additions and 21 deletions

View File

@@ -13,8 +13,12 @@ export type BaileysEventMap<T> = {
'connection.update': Partial<ConnectionState>
/** credentials updated -- some metadata, keys or something */
'creds.update': Partial<T>
/** set chats (history sync), messages are reverse chronologically sorted */
'chats.set': { chats: Chat[], messages: WAMessage[], contacts: Contact[], isLatest: boolean }
/** set chats (history sync), chats are reverse chronologically sorted */
'chats.set': { chats: Chat[], isLatest: boolean }
/** set messages (history sync), messages are reverse chronologically sorted */
'messages.set': { messages: WAMessage[], isLatest: boolean }
/** set contacts (history sync) */
'contacts.set': { contacts: Contact[] }
/** upsert chats */
'chats.upsert': Chat[]
/** update the given chats */

View File

@@ -165,7 +165,7 @@ export type MessageContentGenerationOptions = MediaGenerationOptions & {
}
export type MessageGenerationOptions = MessageContentGenerationOptions & MessageGenerationOptionsFromContent
export type MessageUpdateType = 'append' | 'notify' | 'prepend' | 'last' | 'replace'
export type MessageUpdateType = 'append' | 'notify' | 'replace'
export type MessageInfoEventMap = { [jid: string]: Date }
export interface MessageInfo {