whatsapp-web.js 1.18.1 → 1.18.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatsapp-web.js",
3
- "version": "1.18.1",
3
+ "version": "1.18.2",
4
4
  "description": "Library for interacting with the WhatsApp Web API ",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
@@ -50,6 +50,7 @@ exports.ExposeStore = (moduleRaidStr) => {
50
50
  window.Store.sendReactionToMsg = window.mR.findModule('sendReactionToMsg')[0].sendReactionToMsg;
51
51
  window.Store.createOrUpdateReactionsModule = window.mR.findModule('createOrUpdateReactions')[0];
52
52
  window.Store.EphemeralFields = window.mR.findModule('getEphemeralFields')[0];
53
+ window.Store.ReplyUtils = window.mR.findModule('canReplyMsg').length > 0 && window.mR.findModule('canReplyMsg')[0];
53
54
  window.Store.StickerTools = {
54
55
  ...window.mR.findModule('toWebpSticker')[0],
55
56
  ...window.mR.findModule('addWebpMetadata')[0]
@@ -116,7 +117,13 @@ exports.LoadUtils = () => {
116
117
  let quotedMsgOptions = {};
117
118
  if (options.quotedMessageId) {
118
119
  let quotedMessage = window.Store.Msg.get(options.quotedMessageId);
119
- if (quotedMessage.canReply()) {
120
+
121
+ // TODO remove .canReply() once all clients are updated to >= v2.2241.6
122
+ const canReply = window.Store.ReplyUtils ?
123
+ window.Store.ReplyUtils.canReplyMsg(quotedMessage.unsafe()) :
124
+ quotedMessage.canReply();
125
+
126
+ if (canReply) {
120
127
  quotedMsgOptions = quotedMessage.msgContextInfo(chat);
121
128
  }
122
129
  delete options.quotedMessageId;