implement chat modifications

This commit is contained in:
Adhiraj Singh
2021-09-29 12:31:22 +05:30
parent 8b3627742e
commit 173d1ddf8b
4 changed files with 118 additions and 16 deletions

View File

@@ -10,11 +10,11 @@ export interface PresenceData {
lastSeen?: number
}
export type ChatMutation = { action: proto.ISyncActionValue, index: [string, string], indexMac: Uint8Array, valueMac: Uint8Array, operation: number }
export type ChatMutation = { action: proto.ISyncActionValue, index: string[], indexMac: Uint8Array, valueMac: Uint8Array, operation: number }
export type WAPatchCreate = {
syncAction: proto.ISyncActionValue
index: [string, string]
index: string[]
type: WAPatchName
apiVersion: number
}
@@ -38,7 +38,7 @@ export type ChatModification =
mute: number | null
} |
{
clear: 'all' | { messages: { id: string, fromMe?: boolean }[] }
clear: 'all' | { message: {id: string, fromMe?: boolean} }
} |
{
star: {

View File

@@ -16,7 +16,7 @@ import { Contact } from './Contact'
import { ConnectionState } from './State'
import { GroupMetadata, ParticipantAction } from './GroupMetadata'
import { MessageInfoUpdate, MessageUpdateType, WAMessage, WAMessageUpdate } from './Message'
import { MessageInfoUpdate, MessageUpdateType, WAMessage, WAMessageUpdate, WAMessageKey } from './Message'
export type WAVersion = [number, number, number]
export type WABrowserDescription = [string, string, string]
@@ -103,7 +103,7 @@ export type BaileysEventMap = {
'contacts.upsert': Contact[]
'contacts.update': Partial<Contact>[]
'messages.delete': { jid: string, ids: string[] } | { jid: string, all: true }
'messages.delete': { keys: WAMessageKey[] } | { jid: string, all: true }
'messages.update': WAMessageUpdate[]
/**
* add/update the given messages. If they were received while the connection was online,