mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
refactor!: cleaner message history sync
This is a breaking change, 1. three events (chats.set, contacts.set, messages.set) are now just one `messaging-history.set` event 2. no need to debounce for app state sync 3. added a new "conditional" chat update to allow for correct app state sync despite not having the chat available on hand
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { proto } from '../../WAProto'
|
||||
import type { MediaType, SocketConfig } from '../Types'
|
||||
import { Browsers } from '../Utils'
|
||||
import logger from '../Utils/logger'
|
||||
@@ -26,6 +27,13 @@ export const WA_CERT_DETAILS = {
|
||||
SERIAL: 0,
|
||||
}
|
||||
|
||||
export const PROCESSABLE_HISTORY_TYPES = [
|
||||
proto.Message.HistorySyncNotification.HistorySyncType.INITIAL_BOOTSTRAP,
|
||||
proto.Message.HistorySyncNotification.HistorySyncType.PUSH_NAME,
|
||||
proto.Message.HistorySyncNotification.HistorySyncType.RECENT,
|
||||
proto.Message.HistorySyncNotification.HistorySyncType.FULL
|
||||
]
|
||||
|
||||
export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
|
||||
version: version as any,
|
||||
browser: Browsers.baileys('Chrome'),
|
||||
@@ -40,9 +48,9 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
|
||||
retryRequestDelayMs: 250,
|
||||
fireInitQueries: true,
|
||||
auth: undefined as any,
|
||||
downloadHistory: true,
|
||||
markOnlineOnConnect: true,
|
||||
syncFullHistory: false,
|
||||
shouldSyncHistoryMessage: () => true,
|
||||
linkPreviewImageThumbnailWidth: 192,
|
||||
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
||||
generateHighQualityLinkPreview: false,
|
||||
|
||||
Reference in New Issue
Block a user