From 032b2a314b3fdbc4d7e407594df113200bcec46f Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Thu, 25 Nov 2021 13:35:57 +0530 Subject: [PATCH] refactor: include full sync action in chatmutation --- src/Socket/chats.ts | 2 +- src/Types/Chat.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Socket/chats.ts b/src/Socket/chats.ts index a025f9b..31cc424 100644 --- a/src/Socket/chats.ts +++ b/src/Socket/chats.ts @@ -354,7 +354,7 @@ export const makeChatsSocket = (config: SocketConfig) => { const contactUpdates: { [jid: string]: Contact } = {} const msgDeletes: proto.IMessageKey[] = [] - for(const { action, index: [_, id, msgId, fromMe] } of actions) { + for(const { syncAction: { value: action }, index: [_, id, msgId, fromMe] } of actions) { const update: Partial = { id } if(action?.muteAction) { update.mute = action.muteAction?.muted ? diff --git a/src/Types/Chat.ts b/src/Types/Chat.ts index 2214381..86e86ad 100644 --- a/src/Types/Chat.ts +++ b/src/Types/Chat.ts @@ -10,7 +10,7 @@ export interface PresenceData { lastSeen?: number } -export type ChatMutation = { action: proto.ISyncActionValue, index: string[], indexMac: Uint8Array, valueMac: Uint8Array, operation: number } +export type ChatMutation = { syncAction: proto.ISyncActionData, index: string[], indexMac: Uint8Array, valueMac: Uint8Array, operation: number } export type WAPatchCreate = { syncAction: proto.ISyncActionValue