mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: only sync app state on one batch of history
This commit is contained in:
@@ -157,6 +157,10 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
ev.emit('contacts.set', { contacts })
|
||||
}
|
||||
|
||||
if(isLatest) {
|
||||
resyncMainAppState()
|
||||
}
|
||||
|
||||
break
|
||||
case proto.ProtocolMessage.ProtocolMessageType.APP_STATE_SYNC_KEY_SHARE:
|
||||
const keys = protocolMsg.appStateSyncKeyShare!.keys
|
||||
@@ -172,8 +176,6 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||
}
|
||||
|
||||
ev.emit('creds.update', { myAppStateKeyId: newAppStateSyncKeyId })
|
||||
|
||||
resyncMainAppState()
|
||||
} else {
|
||||
logger.info({ protocolMsg }, 'recv app state sync with 0 keys')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user