chore: mark version v1.22.0

This commit is contained in:
Pedro S Lopez 2023-08-10 00:49:50 -04:00
commit a1bbd25fd3

View file

@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.11">
<meta charset="utf-8">
<title>whatsapp-web.js 1.21.0 &raquo; Source: structures/Message.js</title>
<title>whatsapp-web.js 1.22.0 &raquo; Source: structures/Message.js</title>
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Karla:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Noto+Serif:400,400i,700,700i" type="text/css">
<link rel="stylesheet" href="https://brick.a.ssl.fastly.net/Inconsolata:500" type="text/css">
@ -15,7 +15,7 @@
<nav id="jsdoc-navbar" role="navigation" class="jsdoc-navbar">
<div id="jsdoc-navbar-container">
<div id="jsdoc-navbar-content">
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>21.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>22.<wbr>0</a>
</div>
</div>
</nav>
@ -38,6 +38,7 @@ const Order &#x3D; require(&#x27;./Order&#x27;);
const Payment &#x3D; require(&#x27;./Payment&#x27;);
const Reaction &#x3D; require(&#x27;./Reaction&#x27;);
const {MessageTypes} &#x3D; require(&#x27;../util/Constants&#x27;);
const {Contact} &#x3D; require(&#x27;./Contact&#x27;);
/**
* Represents a Message on WhatsApp
@ -198,8 +199,8 @@ class Message extends Base {
inviteCodeExp: data.inviteCodeExp,
groupId: data.inviteGrp,
groupName: data.inviteGrpName,
fromId: data.from._serialized,
toId: data.to._serialized
fromId: data.from?._serialized ? data.from._serialized : data.from,
toId: data.to?._serialized ? data.to._serialized : data.to
} : undefined;
/**
@ -255,6 +256,16 @@ class Message extends Base {
this.productId &#x3D; data.productId;
}
/** Last edit time */
if (data.latestEditSenderTimestampMs) {
this.latestEditSenderTimestampMs &#x3D; data.latestEditSenderTimestampMs;
}
/** Last edit message author */
if (data.latestEditMsgKey) {
this.latestEditMsgKey &#x3D; data.latestEditMsgKey;
}
/**
* Links included in the message.
* @type {Array&amp;lt;{link: string, isSuspicious: boolean}&gt;}
@ -607,6 +618,42 @@ class Message extends Base {
return reaction;
});
}
/**
* Edits the current message.
* @param {string} content
* @param {MessageEditOptions} [options] - Options used when editing the message
* @returns {Promise&amp;lt;?Message&gt;}
*/
async edit(content, options &#x3D; {}) {
if (options.mentions &amp;amp;&amp;amp; options.mentions.some(possiblyContact &#x3D;&gt; possiblyContact instanceof Contact)) {
options.mentions &#x3D; options.mentions.map(a &#x3D;&gt; a.id._serialized);
}
let internalOptions &#x3D; {
linkPreview: options.linkPreview &#x3D;&#x3D;&#x3D; false ? undefined : true,
mentionedJidList: Array.isArray(options.mentions) ? options.mentions : [],
extraOptions: options.extra
};
if (!this.fromMe) {
return null;
}
const messageEdit &#x3D; await this.client.pupPage.evaluate(async (msgId, message, options) &#x3D;&gt; {
let msg &#x3D; window.Store.Msg.get(msgId);
if (!msg) return null;
let catEdit &#x3D; (msg.type &#x3D;&#x3D;&#x3D; &#x27;chat&#x27; &amp;amp;&amp;amp; window.Store.MsgActionChecks.canEditText(msg));
if (catEdit) {
const msgEdit &#x3D; await window.WWebJS.editMessage(msg, message, options);
return msgEdit.serialize();
}
return null;
}, this.id._serialized, content, internalOptions);
if (messageEdit) {
return new Message(this.client, messageEdit);
}
return null;
}
}
module.exports &#x3D; Message;
@ -620,7 +667,7 @@ module.exports &#x3D; Message;
<footer id="jsdoc-footer" class="jsdoc-footer">
<div id="jsdoc-footer-container">
<p>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on May 29, 2023.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.11 on August 10, 2023.
</p>
</div>
</footer>