chore: mark version v1.11.0

This commit is contained in:
Pedro Lopez
2020-11-05 01:51:39 -04:00
parent 43aa6b3716
commit 6b3c8465e9
34 changed files with 385 additions and 132 deletions

View File

@@ -4,7 +4,7 @@
<head>
<meta name="generator" content="JSDoc 3.6.4">
<meta charset="utf-8">
<title>whatsapp-web.js 1.10.0 &raquo; Source: structures/Contact.js</title>
<title>whatsapp-web.js 1.11.0 &raquo; Source: structures/Contact.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>10.<wbr>0</a>
<a href="index.html" class="jsdoc-navbar-package-name">whatsapp-web.<wbr>js 1.<wbr>11.<wbr>0</a>
</div>
</div>
</nav>
@@ -126,6 +126,12 @@ class Contact extends Base {
*/
this.isMyContact &#x3D; data.isMyContact;
/**
* Indicates if you have blocked this contact
* @type {boolean}
*/
this.isBlocked &#x3D; data.isBlocked;
return super._patch(data);
}
@@ -147,6 +153,36 @@ class Contact extends Base {
return await this.client.getChatById(this.id._serialized);
}
/**
* Blocks this contact from WhatsApp
* @returns {Promise&amp;lt;boolean&gt;}
*/
async block() {
if(this.isGroup) return false;
await this.client.pupPage.evaluate(async (contactId) &#x3D;&gt; {
const contact &#x3D; window.Store.Contact.get(contactId);
await window.Store.BlockContact.blockContact(contact);
}, this.id._serialized);
return true;
}
/**
* Unblocks this contact from WhatsApp
* @returns {Promise&amp;lt;boolean&gt;}
*/
async unblock() {
if(this.isGroup) return false;
await this.client.pupPage.evaluate(async (contactId) &#x3D;&gt; {
const contact &#x3D; window.Store.Contact.get(contactId);
await window.Store.BlockContact.unblockContact(contact);
}, this.id._serialized);
return true;
}
}
@@ -160,7 +196,7 @@ module.exports &#x3D; Contact;</code></pre>
<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.4 on October 21, 2020.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc</a> 3.6.4 on November 5, 2020.
</p>
</div>
</footer>