mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
feat: track history being stored
This is done because sometimes we receive history after the first connect too, and to ensure the "isLatest" flag is accurate -- we ensure no history was received previously
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { proto } from '../../WAProto'
|
||||
import type { Contact } from './Contact'
|
||||
import type { MinimalMessage } from './Message'
|
||||
|
||||
export type KeyPair = { public: Uint8Array, private: Uint8Array }
|
||||
export type SignedKeyPair = { keyPair: KeyPair, signature: Uint8Array, keyId: number }
|
||||
@@ -45,6 +46,8 @@ export type AuthenticationCreds = SignalCreds & {
|
||||
|
||||
lastAccountSyncTimestamp?: number
|
||||
platform?: string
|
||||
|
||||
processedHistoryMessages: MinimalMessage[]
|
||||
accountSettings: AccountSettings
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { proto } from '../../WAProto'
|
||||
import type { MinimalMessage } from './Message'
|
||||
|
||||
/** set of statuses visible to other people; see updatePresence() in WhatsAppWeb.Send */
|
||||
export type WAPresence = 'unavailable' | 'available' | 'composing' | 'recording' | 'paused'
|
||||
@@ -32,11 +33,12 @@ export type Chat = Omit<proto.IConversation, 'messages'> & {
|
||||
pin?: number | null
|
||||
archive?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* the last messages in a chat, sorted reverse-chronologically. That is, the latest message should be first in the chat
|
||||
* for MD modifications, the last message in the array (i.e. the earlist message) must be the last message recv in the chat
|
||||
* */
|
||||
export type LastMessageList = Pick<proto.IWebMessageInfo, 'key' | 'messageTimestamp'>[] | proto.ISyncActionMessageRange
|
||||
export type LastMessageList = MinimalMessage[] | proto.ISyncActionMessageRange
|
||||
|
||||
export type ChatModification =
|
||||
{
|
||||
|
||||
@@ -188,4 +188,6 @@ export type MediaDecryptionKeyInfo = {
|
||||
iv: Buffer
|
||||
cipherKey: Buffer
|
||||
macKey?: Buffer
|
||||
}
|
||||
}
|
||||
|
||||
export type MinimalMessage = Pick<proto.IWebMessageInfo, 'key' | 'messageTimestamp'>
|
||||
Reference in New Issue
Block a user