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 CHANGED
@@ -1,4 +1,4 @@
1
- [![npm](https://img.shields.io/npm/v/whatsapp-web.js.svg)](https://www.npmjs.com/package/whatsapp-web.js) [![Depfu](https://badges.depfu.com/badges/4a65a0de96ece65fdf39e294e0c8dcba/overview.svg)](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765) ![WhatsApp_Web 2.2241.6](https://img.shields.io/badge/WhatsApp_Web-2.2241.6-brightgreen.svg) [![Discord Chat](https://img.shields.io/discord/698610475432411196.svg?logo=discord)](https://discord.gg/H7DqQs4)
1
+ [![npm](https://img.shields.io/npm/v/whatsapp-web.js.svg)](https://www.npmjs.com/package/whatsapp-web.js) [![Depfu](https://badges.depfu.com/badges/4a65a0de96ece65fdf39e294e0c8dcba/overview.svg)](https://depfu.com/github/pedroslopez/whatsapp-web.js?project_id=9765) ![WhatsApp_Web 2.2245.9](https://img.shields.io/badge/WhatsApp_Web-2.2245.9-brightgreen.svg) [![Discord Chat](https://img.shields.io/discord/698610475432411196.svg?logo=discord)](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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatsapp-web.js",
3
- "version": "1.18.3",
3
+ "version": "1.18.4",
4
4
  "description": "Library for interacting with the WhatsApp Web API ",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
@@ -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
- let msg = window.Store.Msg.get(msgId);
309
- return msg.quotedMsgObj().serialize();
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
- if (everyone && msg._canRevoke()) {
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 (msg.canStar()) {
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 (msg.canStar()) {
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);
@@ -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]