Include archive/read_only in chats

This commit is contained in:
Adhiraj Singh
2020-07-08 15:26:11 +05:30
parent 1c05c75cc8
commit 2018653bca
2 changed files with 5 additions and 2 deletions

View File

@@ -113,8 +113,9 @@ export default class WAConnectionConnector extends WAConnectionValidator {
const waitForChats = async () => {
const json = await this.registerCallbackOneTime(['response', 'type: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[chats.length-1].messages = []
// store the number of unread messages for each sender
chatMap[chat[1].jid] = {index: chats.length-1, count: chat[1].count} //chat[1].count
})

View File

@@ -55,7 +55,9 @@ export interface WAContact {
}
export interface WAChat {
t: string
count: string
count: number
archive?: 'true' | 'false'
read_only?: 'true' | 'false'
spam: 'false' | 'true'
jid: string
modify_tag: string