mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-17 19:26:20 +00:00
fix: delete messages for everyone (#1842)
This commit is contained in:
@@ -437,7 +437,8 @@ class Message extends Base {
|
|||||||
await this.client.pupPage.evaluate((msgId, everyone) => {
|
await this.client.pupPage.evaluate((msgId, everyone) => {
|
||||||
let msg = window.Store.Msg.get(msgId);
|
let msg = window.Store.Msg.get(msgId);
|
||||||
|
|
||||||
if (everyone && msg._canRevoke()) {
|
const canRevoke = window.Store.MsgActionChecks.canSenderRevokeMsg(msg) || window.Store.MsgActionChecks.canAdminRevokeMsg(msg);
|
||||||
|
if (everyone && canRevoke) {
|
||||||
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' });
|
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ exports.ExposeStore = (moduleRaidStr) => {
|
|||||||
window.Store.createOrUpdateReactionsModule = window.mR.findModule('createOrUpdateReactions')[0];
|
window.Store.createOrUpdateReactionsModule = window.mR.findModule('createOrUpdateReactions')[0];
|
||||||
window.Store.EphemeralFields = window.mR.findModule('getEphemeralFields')[0];
|
window.Store.EphemeralFields = window.mR.findModule('getEphemeralFields')[0];
|
||||||
window.Store.ReplyUtils = window.mR.findModule('canReplyMsg').length > 0 && window.mR.findModule('canReplyMsg')[0];
|
window.Store.ReplyUtils = window.mR.findModule('canReplyMsg').length > 0 && window.mR.findModule('canReplyMsg')[0];
|
||||||
|
window.Store.MsgActionChecks = window.mR.findModule('canSenderRevokeMsg')[0];
|
||||||
window.Store.QuotedMsg = window.mR.findModule('getQuotedMsgObj')[0];
|
window.Store.QuotedMsg = window.mR.findModule('getQuotedMsgObj')[0];
|
||||||
window.Store.StickerTools = {
|
window.Store.StickerTools = {
|
||||||
...window.mR.findModule('toWebpSticker')[0],
|
...window.mR.findModule('toWebpSticker')[0],
|
||||||
|
|||||||
Reference in New Issue
Block a user