defaults, index: change shouldSyncHistoryMessage behavior
This commit is contained in:
@@ -62,7 +62,9 @@ export const DEFAULT_CONNECTION_CONFIG: SocketConfig = {
|
||||
markOnlineOnConnect: true,
|
||||
syncFullHistory: true,
|
||||
patchMessageBeforeSending: msg => msg,
|
||||
shouldSyncHistoryMessage: () => true,
|
||||
shouldSyncHistoryMessage: ({ syncType }: proto.Message.IHistorySyncNotification) => {
|
||||
return syncType !== proto.HistorySync.HistorySyncType.FULL
|
||||
},
|
||||
shouldIgnoreJid: () => false,
|
||||
linkPreviewImageThumbnailWidth: 192,
|
||||
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 },
|
||||
|
||||
@@ -9,13 +9,6 @@ const makeWASocket = (config: UserFacingSocketConfig) => {
|
||||
...config
|
||||
}
|
||||
|
||||
// If the user hasn't provided their own history sync function,
|
||||
// let's create a default one that respects the syncFullHistory flag.
|
||||
// TODO: Change
|
||||
if (config.shouldSyncHistoryMessage === undefined) {
|
||||
newConfig.shouldSyncHistoryMessage = () => !!newConfig.syncFullHistory
|
||||
}
|
||||
|
||||
return makeCommunitiesSocket(newConfig)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user