mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: only update last account sync when required
This commit is contained in:
@@ -648,6 +648,7 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
|||||||
const type = attrs.type
|
const type = attrs.type
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'account_sync':
|
case 'account_sync':
|
||||||
|
if(attrs.timestamp) {
|
||||||
let { lastAccountSyncTimestamp } = authState.creds
|
let { lastAccountSyncTimestamp } = authState.creds
|
||||||
if(lastAccountSyncTimestamp) {
|
if(lastAccountSyncTimestamp) {
|
||||||
await updateAccountSyncTimestamp(lastAccountSyncTimestamp)
|
await updateAccountSyncTimestamp(lastAccountSyncTimestamp)
|
||||||
@@ -655,6 +656,8 @@ export const makeChatsSocket = (config: SocketConfig) => {
|
|||||||
|
|
||||||
lastAccountSyncTimestamp = +attrs.timestamp
|
lastAccountSyncTimestamp = +attrs.timestamp
|
||||||
ev.emit('creds.update', { lastAccountSyncTimestamp })
|
ev.emit('creds.update', { lastAccountSyncTimestamp })
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
logger.info({ node }, 'received unknown sync')
|
logger.info({ node }, 'received unknown sync')
|
||||||
|
|||||||
Reference in New Issue
Block a user