fix: Delete Message For Me (#1718)

* Add Timestamp for deleteMessageForMe

* Fix Typo Readme

* Add Timestamp for deleteMessageForMe

* fix: Typo type timestamp
This commit is contained in:
Dwi Rizqi
2022-06-13 21:43:52 +07:00
committed by GitHub
parent c22b4c9c89
commit e7087cabf5
3 changed files with 9 additions and 8 deletions

View File

@@ -641,10 +641,10 @@ WA uses an encrypted form of communication to send chat/app updates. This has be
- Delete message for me - Delete message for me
``` ts ``` ts
await sock.chatModify( await sock.chatModify(
{ clear: { message: { id: 'ATWYHDNNWU81732J', fromMe: true } } }, { clear: { messages: [{ id: 'ATWYHDNNWU81732J', fromMe: true, timestamp: "1654823909" }] } },
'123456@s.whatsapp.net', '123456@s.whatsapp.net',
[] []
) )
``` ```
Note: if you mess up one of your updates, WA can log you out of all your devices and you'll have to login again. Note: if you mess up one of your updates, WA can log you out of all your devices and you'll have to login again.

View File

@@ -75,7 +75,7 @@ export type ChatModification =
mute: number | null mute: number | null
} | } |
{ {
clear: 'all' | { messages: {id: string, fromMe?: boolean}[] } clear: 'all' | { messages: {id: string, fromMe?: boolean, timestamp: number}[] }
} | } |
{ {
star: { star: {
@@ -96,4 +96,4 @@ export type InitialReceivedChatsState = {
export type InitialAppStateSyncOptions = { export type InitialAppStateSyncOptions = {
recvChats: InitialReceivedChatsState recvChats: InitialReceivedChatsState
accountSettings: AccountSettings accountSettings: AccountSettings
} }

View File

@@ -557,7 +557,8 @@ export const chatModificationToAppPatch = (
patch = { patch = {
syncAction: { syncAction: {
deleteMessageForMeAction: { deleteMessageForMeAction: {
deleteMedia: false deleteMedia: false,
messageTimestamp: key.timestamp
} }
}, },
index: ['deleteMessageForMe', jid, key.id, key.fromMe ? '1' : '0', '0'], index: ['deleteMessageForMe', jid, key.id, key.fromMe ? '1' : '0', '0'],
@@ -744,4 +745,4 @@ export const syncActionUpdatesToEventMap = (
} }
return map return map
} }