Added message range to the clear chat action (#1534)

* chat-utils: Added message range to the clear chat action

* Chat: add field to type (thanks @Kiss from discord)

* Update src/Utils/chat-utils.ts
This commit is contained in:
Rajeh Taher
2025-07-05 23:58:44 +03:00
committed by GitHub
parent 92b4c68de0
commit 719a57b275
2 changed files with 4 additions and 1 deletions

View File

@@ -94,6 +94,7 @@ export type ChatModification =
}
| {
clear: boolean
lastMessages: LastMessageList
}
| {
deleteForMe: { deleteMedia: boolean; key: WAMessageKey; timestamp: number }

View File

@@ -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',