mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: readonly chats on sync
This commit is contained in:
@@ -2,6 +2,7 @@ import { promisify } from 'util'
|
|||||||
import { inflate } from 'zlib'
|
import { inflate } from 'zlib'
|
||||||
import { proto } from '../../WAProto'
|
import { proto } from '../../WAProto'
|
||||||
import { Chat, Contact } from '../Types'
|
import { Chat, Contact } from '../Types'
|
||||||
|
import { isJidUser } from '../WABinary'
|
||||||
import { downloadContentFromMessage } from './messages-media'
|
import { downloadContentFromMessage } from './messages-media'
|
||||||
|
|
||||||
const inflatePromise = promisify(inflate)
|
const inflatePromise = promisify(inflate)
|
||||||
@@ -45,6 +46,10 @@ export const processHistoryMessage = (item: proto.IHistorySync, historyCache: Se
|
|||||||
|
|
||||||
delete chat.messages
|
delete chat.messages
|
||||||
if(!historyCache.has(chat.id)) {
|
if(!historyCache.has(chat.id)) {
|
||||||
|
if(isJidUser(chat.id) && chat.readOnly && chat.archived) {
|
||||||
|
chat.readOnly = false
|
||||||
|
}
|
||||||
|
|
||||||
chats.push(chat)
|
chats.push(chat)
|
||||||
historyCache.add(chat.id)
|
historyCache.add(chat.id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ const processMessage = async(
|
|||||||
|
|
||||||
if(accountSettings?.unarchiveChats) {
|
if(accountSettings?.unarchiveChats) {
|
||||||
chat.archive = false
|
chat.archive = false
|
||||||
|
chat.readOnly = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user