diff --git a/src/Types/Chat.ts b/src/Types/Chat.ts index f5d008a..c3542dd 100644 --- a/src/Types/Chat.ts +++ b/src/Types/Chat.ts @@ -94,6 +94,7 @@ export type ChatModification = } | { clear: boolean + lastMessages: LastMessageList } | { deleteForMe: { deleteMedia: boolean; key: WAMessageKey; timestamp: number } diff --git a/src/Utils/chat-utils.ts b/src/Utils/chat-utils.ts index 3556591..2a1f0b6 100644 --- a/src/Utils/chat-utils.ts +++ b/src/Utils/chat-utils.ts @@ -584,7 +584,9 @@ export const chatModificationToAppPatch = (mod: ChatModification, jid: string) = } else if ('clear' in mod) { patch = { syncAction: { - clearChatAction: {} // add message range later + clearChatAction: { + messageRange: getMessageRange(mod.lastMessages) + } }, index: ['clearChat', jid, '1' /*the option here is 0 when keep starred messages is enabled*/, '0'], type: 'regular_high',