mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
Include archive/read_only in chats
This commit is contained in:
@@ -113,8 +113,9 @@ export default class WAConnectionConnector extends WAConnectionValidator {
|
|||||||
const waitForChats = async () => {
|
const waitForChats = async () => {
|
||||||
const json = await this.registerCallbackOneTime(['response', 'type:chat'])
|
const json = await this.registerCallbackOneTime(['response', 'type:chat'])
|
||||||
json[2].forEach(chat => {
|
json[2].forEach(chat => {
|
||||||
|
chat[1].count = parseInt(chat[1].count)
|
||||||
|
chat[1].messages = []
|
||||||
chats.push(chat[1]) // chats data (log json to see what it looks like)
|
chats.push(chat[1]) // chats data (log json to see what it looks like)
|
||||||
chats[chats.length-1].messages = []
|
|
||||||
// store the number of unread messages for each sender
|
// store the number of unread messages for each sender
|
||||||
chatMap[chat[1].jid] = {index: chats.length-1, count: chat[1].count} //chat[1].count
|
chatMap[chat[1].jid] = {index: chats.length-1, count: chat[1].count} //chat[1].count
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -55,7 +55,9 @@ export interface WAContact {
|
|||||||
}
|
}
|
||||||
export interface WAChat {
|
export interface WAChat {
|
||||||
t: string
|
t: string
|
||||||
count: string
|
count: number
|
||||||
|
archive?: 'true' | 'false'
|
||||||
|
read_only?: 'true' | 'false'
|
||||||
spam: 'false' | 'true'
|
spam: 'false' | 'true'
|
||||||
jid: string
|
jid: string
|
||||||
modify_tag: string
|
modify_tag: string
|
||||||
|
|||||||
Reference in New Issue
Block a user