Skip to content

Commit

Permalink
fix: Fixed revoke messages for list type
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jun 6, 2022
1 parent d1d9654 commit 7938ae7
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/chat/functions/deleteMessage.ts
Expand Up @@ -90,17 +90,27 @@ export async function deleteMessage(
sendMsgResult = SendMsgResult.ERROR_UNKNOWN;
isRevoked = true;
} else if (revoke) {
if (msg.type === 'list') {
(msg as any).__x_isUserCreatedType = true;
}

Cmd.sendRevokeMsgs(chat, [msg], { clearMedia: deleteMediaInDevice });

if (chat.promises.sendRevokeMsgs) {
await chat.promises.sendRevokeMsgs;
const result = await chat.promises.sendRevokeMsgs;
if (Array.isArray(result)) {
sendMsgResult = result[0];
}
}
isRevoked = msg.isRevokedByMe;
} else {
Cmd.sendDeleteMsgs(chat, [msg], deleteMediaInDevice);

if (chat.promises.sendDeleteMsgs) {
await chat.promises.sendDeleteMsgs;
const result = await chat.promises.sendDeleteMsgs;
if (Array.isArray(result)) {
sendMsgResult = result[0];
}
}
isDeleted = Boolean(chat.msgs.get(msg.id));
}
Expand Down

0 comments on commit 7938ae7

Please sign in to comment.