whatsapp-web.js 1.18.3 → 1.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/structures/Message.js +7 -5
- package/src/util/Injected.js +2 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://www.npmjs.com/package/whatsapp-web.js) [](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765) ](https://www.npmjs.com/package/whatsapp-web.js) [](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765)  [](https://discord.gg/H7DqQs4)
|
|
2
2
|
|
|
3
3
|
# whatsapp-web.js
|
|
4
4
|
A WhatsApp API client that connects through the WhatsApp Web browser app
|
package/package.json
CHANGED
|
@@ -305,8 +305,9 @@ class Message extends Base {
|
|
|
305
305
|
if (!this.hasQuotedMsg) return undefined;
|
|
306
306
|
|
|
307
307
|
const quotedMsg = await this.client.pupPage.evaluate((msgId) => {
|
|
308
|
-
|
|
309
|
-
|
|
308
|
+
const msg = window.Store.Msg.get(msgId);
|
|
309
|
+
const quotedMsg = window.Store.QuotedMsg.getQuotedMsgObj(msg);
|
|
310
|
+
return window.WWebJS.getMessageModel(quotedMsg);
|
|
310
311
|
}, this.id._serialized);
|
|
311
312
|
|
|
312
313
|
return new Message(this.client, quotedMsg);
|
|
@@ -436,7 +437,8 @@ class Message extends Base {
|
|
|
436
437
|
await this.client.pupPage.evaluate((msgId, everyone) => {
|
|
437
438
|
let msg = window.Store.Msg.get(msgId);
|
|
438
439
|
|
|
439
|
-
|
|
440
|
+
const canRevoke = window.Store.MsgActionChecks.canSenderRevokeMsg(msg) || window.Store.MsgActionChecks.canAdminRevokeMsg(msg);
|
|
441
|
+
if (everyone && canRevoke) {
|
|
440
442
|
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' });
|
|
441
443
|
}
|
|
442
444
|
|
|
@@ -451,7 +453,7 @@ class Message extends Base {
|
|
|
451
453
|
await this.client.pupPage.evaluate((msgId) => {
|
|
452
454
|
let msg = window.Store.Msg.get(msgId);
|
|
453
455
|
|
|
454
|
-
if (
|
|
456
|
+
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
|
455
457
|
return window.Store.Cmd.sendStarMsgs(msg.chat, [msg], false);
|
|
456
458
|
}
|
|
457
459
|
}, this.id._serialized);
|
|
@@ -464,7 +466,7 @@ class Message extends Base {
|
|
|
464
466
|
await this.client.pupPage.evaluate((msgId) => {
|
|
465
467
|
let msg = window.Store.Msg.get(msgId);
|
|
466
468
|
|
|
467
|
-
if (
|
|
469
|
+
if (window.Store.MsgActionChecks.canStarMsg(msg)) {
|
|
468
470
|
return window.Store.Cmd.sendUnstarMsgs(msg.chat, [msg], false);
|
|
469
471
|
}
|
|
470
472
|
}, this.id._serialized);
|
package/src/util/Injected.js
CHANGED
|
@@ -51,6 +51,8 @@ exports.ExposeStore = (moduleRaidStr) => {
|
|
|
51
51
|
window.Store.createOrUpdateReactionsModule = window.mR.findModule('createOrUpdateReactions')[0];
|
|
52
52
|
window.Store.EphemeralFields = window.mR.findModule('getEphemeralFields')[0];
|
|
53
53
|
window.Store.ReplyUtils = window.mR.findModule('canReplyMsg').length > 0 && window.mR.findModule('canReplyMsg')[0];
|
|
54
|
+
window.Store.MsgActionChecks = window.mR.findModule('canSenderRevokeMsg')[0];
|
|
55
|
+
window.Store.QuotedMsg = window.mR.findModule('getQuotedMsgObj')[0];
|
|
54
56
|
window.Store.StickerTools = {
|
|
55
57
|
...window.mR.findModule('toWebpSticker')[0],
|
|
56
58
|
...window.mR.findModule('addWebpMetadata')[0]
|