From 3b4632201d54146b7923a69dbc0f0f931029f206 Mon Sep 17 00:00:00 2001
From: Pedro Lopez
Date: Sun, 6 Feb 2022 16:26:25 -0400
Subject: [PATCH 01/14] fix: add missing message types
---
index.d.ts | 22 +++++++++++++++++++++-
src/util/Constants.js | 20 +++++++++++++++++++-
2 files changed, 40 insertions(+), 2 deletions(-)
diff --git a/index.d.ts b/index.d.ts
index 05e0285..d9d5ea6 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -443,7 +443,27 @@ declare namespace WAWebJS {
PAYMENT = 'payment',
UNKNOWN = 'unknown',
GROUP_INVITE = 'groups_v4_invite',
- BUTTONS_RESPONSE = 'buttons_response'
+ LIST = 'list',
+ LIST_RESPONSE = 'list_response',
+ BUTTONS_RESPONSE = 'buttons_response',
+ PAYMENT = 'payment',
+ BROADCAST_NOTIFICATION = 'broadcast_notification',
+ CALL_LOG = 'call_log',
+ CIPHERTEXT = 'ciphertext',
+ DEBUG = 'debug',
+ E2E_NOTIFICATION = 'e2e_notification',
+ GP2 = 'gp2',
+ GROUP_NOTIFICATION = 'group_notification',
+ HSM = 'hsm',
+ INTERACTIVE = 'interactive',
+ NATIVE_FLOW = 'native_flow',
+ NOTIFICATION = 'notification',
+ NOTIFICATION_TEMPLATE = 'notification_template',
+ OVERSIZED = 'oversized',
+ PROTOCOL = 'protocol',
+ PTT = 'ptt',
+ REACTION = 'reaction',
+ TEMPLATE_BUTTON_REPLY = 'template_button_reply',
}
/** Client status */
diff --git a/src/util/Constants.js b/src/util/Constants.js
index 2ff4a6f..1e02e04 100644
--- a/src/util/Constants.js
+++ b/src/util/Constants.js
@@ -77,8 +77,26 @@ exports.MessageTypes = {
UNKNOWN: 'unknown',
GROUP_INVITE: 'groups_v4_invite',
LIST: 'list',
+ LIST_RESPONSE: 'list_response',
BUTTONS_RESPONSE: 'buttons_response',
- PAYMENT: 'payment'
+ PAYMENT: 'payment',
+ BROADCAST_NOTIFICATION: 'broadcast_notification',
+ CALL_LOG: 'call_log',
+ CIPHERTEXT: 'ciphertext',
+ DEBUG: 'debug',
+ E2E_NOTIFICATION: 'e2e_notification',
+ GP2: 'gp2',
+ GROUP_NOTIFICATION: 'group_notification',
+ HSM: 'hsm',
+ INTERACTIVE: 'interactive',
+ NATIVE_FLOW: 'native_flow',
+ NOTIFICATION: 'notification',
+ NOTIFICATION_TEMPLATE: 'notification_template',
+ OVERSIZED: 'oversized',
+ PROTOCOL: 'protocol',
+ PTT: 'ptt',
+ REACTION: 'reaction',
+ TEMPLATE_BUTTON_REPLY: 'template_button_reply',
};
/**
From a9b2a1aab8df69b73fff29f259281ac93fe28262 Mon Sep 17 00:00:00 2001
From: Pedro Lopez
Date: Sun, 6 Feb 2022 16:30:44 -0400
Subject: [PATCH 02/14] remove duplicated message type
---
index.d.ts | 1 -
src/util/Constants.js | 1 -
2 files changed, 2 deletions(-)
diff --git a/index.d.ts b/index.d.ts
index d9d5ea6..42b32bd 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -461,7 +461,6 @@ declare namespace WAWebJS {
NOTIFICATION_TEMPLATE = 'notification_template',
OVERSIZED = 'oversized',
PROTOCOL = 'protocol',
- PTT = 'ptt',
REACTION = 'reaction',
TEMPLATE_BUTTON_REPLY = 'template_button_reply',
}
diff --git a/src/util/Constants.js b/src/util/Constants.js
index 1e02e04..b95ccd1 100644
--- a/src/util/Constants.js
+++ b/src/util/Constants.js
@@ -94,7 +94,6 @@ exports.MessageTypes = {
NOTIFICATION_TEMPLATE: 'notification_template',
OVERSIZED: 'oversized',
PROTOCOL: 'protocol',
- PTT: 'ptt',
REACTION: 'reaction',
TEMPLATE_BUTTON_REPLY: 'template_button_reply',
};
From d7478de68adce1b454667f5e59d7a9650aa973b3 Mon Sep 17 00:00:00 2001
From: Pedro Lopez
Date: Sun, 6 Feb 2022 18:54:10 -0400
Subject: [PATCH 03/14] fix: emit message events after ciphertext is decrypted
fixes #924
fixes #1041
---
src/Client.js | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/Client.js b/src/Client.js
index 6b761fb..3d8de39 100644
--- a/src/Client.js
+++ b/src/Client.js
@@ -239,8 +239,6 @@ class Client extends EventEmitter {
// Register events
await page.exposeFunction('onAddMessageEvent', msg => {
- if (!msg.isNewMsg) return;
-
if (msg.type === 'gp2') {
const notification = new GroupNotification(this, msg);
if (msg.subtype === 'add' || msg.subtype === 'invite') {
@@ -425,7 +423,6 @@ class Client extends EventEmitter {
});
await page.evaluate(() => {
- window.Store.Msg.on('add', (msg) => { if (msg.isNewMsg) window.onAddMessageEvent(window.WWebJS.getMessageModel(msg)); });
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(window.WWebJS.getMessageModel(msg)); });
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(window.WWebJS.getMessageModel(msg)); });
window.Store.Msg.on('change:ack', (msg,ack) => { window.onMessageAckEvent(window.WWebJS.getMessageModel(msg), ack); });
@@ -434,6 +431,16 @@ class Client extends EventEmitter {
window.Store.AppState.on('change:state', (_AppState, state) => { window.onAppStateChangedEvent(state); });
window.Store.Conn.on('change:battery', (state) => { window.onBatteryStateChangedEvent(state); });
window.Store.Call.on('add', (call) => { window.onIncomingCall(call); });
+ window.Store.Msg.on('add', (msg) => {
+ if (msg.isNewMsg) {
+ if(msg.type === 'ciphertext') {
+ // defer message event until ciphertext is resolved (type changed)
+ msg.once('change:type', (_msg) => window.onAddMessageEvent(window.WWebJS.getMessageModel(_msg)));
+ } else {
+ window.onAddMessageEvent(window.WWebJS.getMessageModel(msg));
+ }
+ }
+ });
});
/**
From 7631400de13caf872ba4e23ddcbe8af817730b2b Mon Sep 17 00:00:00 2001
From: "Pedro S. Lopez"
Date: Sun, 6 Feb 2022 19:16:57 -0400
Subject: [PATCH 04/14] add back the `pull_request` trigger on lint
---
.github/workflows/lint.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index f0228fc..82036b5 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -2,6 +2,7 @@ name: Lint
on:
push:
+ pull_request:
jobs:
eslint:
From aa9e19a19e1ee07286c10bb3a0335f98a8483d6e Mon Sep 17 00:00:00 2001
From: Azeem Haider
Date: Mon, 7 Feb 2022 04:27:38 +0500
Subject: [PATCH 05/14] fetchMessages gets currently available messages by
default (#1015)
* get chat default messages fix #1014
* fixing format
* Update src/structures/Chat.js
Co-authored-by: Pedro S. Lopez
Co-authored-by: Pedro S. Lopez
---
src/structures/Chat.js | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/structures/Chat.js b/src/structures/Chat.js
index b8aacb1..e4f59d1 100644
--- a/src/structures/Chat.js
+++ b/src/structures/Chat.js
@@ -171,30 +171,30 @@ class Chat extends Base {
/**
* Loads chat messages, sorted from earliest to latest.
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.
- * @param {Number} [searchOptions.limit=50] The amount of messages to return. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
+ * @param {Number} [searchOptions.limit] The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
* @returns {Promise>}
*/
async fetchMessages(searchOptions) {
- if (!searchOptions || !searchOptions.limit) {
- searchOptions = { limit: 50 };
- }
- let messages = await this.client.pupPage.evaluate(async (chatId, limit) => {
+ let messages = await this.client.pupPage.evaluate(async (chatId, searchOptions) => {
const msgFilter = m => !m.isNotification; // dont include notification messages
const chat = window.Store.Chat.get(chatId);
let msgs = chat.msgs.models.filter(msgFilter);
- while (msgs.length < limit) {
- const loadedMessages = await chat.loadEarlierMsgs();
- if (!loadedMessages) break;
- msgs = [...loadedMessages.filter(msgFilter), ...msgs];
+ if (searchOptions && searchOptions.limit) {
+ while (msgs.length < searchOptions.limit) {
+ const loadedMessages = await chat.loadEarlierMsgs();
+ if (!loadedMessages) break;
+ msgs = [...loadedMessages.filter(msgFilter), ...msgs];
+ }
+ if (msgs.length > searchOptions.limit)
+ msgs = msgs.splice(msgs.length - searchOptions.limit);
}
msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
- if (msgs.length > limit) msgs = msgs.splice(msgs.length - limit);
return msgs.map(m => window.WWebJS.getMessageModel(m));
- }, this.id._serialized, searchOptions.limit);
+ }, this.id._serialized, searchOptions);
return messages.map(m => new Message(this.client, m));
}
From 64803c2ba61bf4c5d97503b99a9c2d1f44d41639 Mon Sep 17 00:00:00 2001
From: Pedro Lopez
Date: Sun, 6 Feb 2022 19:30:13 -0400
Subject: [PATCH 06/14] update typings for `fetchMessages` changes
---
index.d.ts | 3 +--
src/structures/Chat.js | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/index.d.ts b/index.d.ts
index 42b32bd..65b6ea9 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -930,10 +930,9 @@ declare namespace WAWebJS {
export interface MessageSearchOptions {
/**
- * The amount of messages to return.
+ * The amount of messages to return. If no limit is specified, the available messages will be returned.
* Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation.
* Set this to Infinity to load all messages.
- * @default 50
*/
limit?: number
}
diff --git a/src/structures/Chat.js b/src/structures/Chat.js
index e4f59d1..01eec83 100644
--- a/src/structures/Chat.js
+++ b/src/structures/Chat.js
@@ -181,7 +181,7 @@ class Chat extends Base {
const chat = window.Store.Chat.get(chatId);
let msgs = chat.msgs.models.filter(msgFilter);
- if (searchOptions && searchOptions.limit) {
+ if (searchOptions && searchOptions.limit > 0) {
while (msgs.length < searchOptions.limit) {
const loadedMessages = await chat.loadEarlierMsgs();
if (!loadedMessages) break;
From 4aae8b0f32fe276aa5cf0ef890b94984ef0db371 Mon Sep 17 00:00:00 2001
From: Pedro Lopez
Date: Sun, 6 Feb 2022 20:03:59 -0400
Subject: [PATCH 07/14] fix: sort before splicing when fetching messages
---
src/structures/Chat.js | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/structures/Chat.js b/src/structures/Chat.js
index 01eec83..20aa7dc 100644
--- a/src/structures/Chat.js
+++ b/src/structures/Chat.js
@@ -187,11 +187,13 @@ class Chat extends Base {
if (!loadedMessages) break;
msgs = [...loadedMessages.filter(msgFilter), ...msgs];
}
- if (msgs.length > searchOptions.limit)
+
+ if (msgs.length > searchOptions.limit) {
+ msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
msgs = msgs.splice(msgs.length - searchOptions.limit);
+ }
}
- msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
return msgs.map(m => window.WWebJS.getMessageModel(m));
}, this.id._serialized, searchOptions);
From 303ea3ab6b5c1c1ca9a0f471090246cfc9d1afad Mon Sep 17 00:00:00 2001
From: Noam Zaks
Date: Mon, 7 Feb 2022 02:56:57 +0200
Subject: [PATCH 08/14] fix types and docs for Buttons class (#1070)
* fix: typing of buttons class
* fix remaining types
Co-authored-by: Pedro Lopez
---
index.d.ts | 4 ++--
src/structures/Buttons.js | 22 ++++++++++++++++++----
2 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/index.d.ts b/index.d.ts
index 65b6ea9..f596284 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -1211,11 +1211,11 @@ declare namespace WAWebJS {
/** Message type buttons */
export class Buttons {
body: string | MessageMedia
- buttons: Array>
+ buttons: Array<{ buttonId: string; buttonText: {displayText: string}; type: number }>
title?: string | null
footer?: string | null
- constructor(body: string, buttons: Array>, title?: string | null, footer?: string | null)
+ constructor(body: string, buttons: Array<{ id?: string; body: string }>, title?: string | null, footer?: string | null)
}
}
diff --git a/src/structures/Buttons.js b/src/structures/Buttons.js
index a67b3fa..66b7cdf 100644
--- a/src/structures/Buttons.js
+++ b/src/structures/Buttons.js
@@ -3,13 +3,27 @@
const MessageMedia = require('./MessageMedia');
const Util = require('../util/Util');
+/**
+ * Button spec used in Buttons constructor
+ * @typedef {Object} ButtonSpec
+ * @property {string=} id - Custom ID to set on the button. A random one will be generated if one is not passed.
+ * @property {string} body - The text to show on the button.
+ */
+
+/**
+ * @typedef {Object} FormattedButtonSpec
+ * @property {string} buttonId
+ * @property {number} type
+ * @property {Object} buttonText
+ */
+
/**
* Message type buttons
*/
class Buttons {
/**
* @param {string|MessageMedia} body
- * @param {Array>} buttons
+ * @param {ButtonSpec[]} buttons - See {@link ButtonSpec}
* @param {string?} title
* @param {string?} footer
*/
@@ -41,7 +55,7 @@ class Buttons {
/**
* buttons of message
- * @type {Array>}
+ * @type {FormattedButtonSpec[]}
*/
this.buttons = this._format(buttons);
if(!this.buttons.length){ throw '[BT01] No buttons';}
@@ -50,8 +64,8 @@ class Buttons {
/**
* Creates button array from simple array
- * @param {Array>} buttons
- * @returns {Array>}
+ * @param {ButtonSpec[]} buttons
+ * @returns {FormattedButtonSpec[]}
* @example
* Input: [{id:'customId',body:'button1'},{body:'button2'},{body:'button3'},{body:'button4'}]
* Returns: [{ buttonId:'customId',buttonText:{'displayText':'button1'},type: 1 },{buttonId:'n3XKsL',buttonText:{'displayText':'button2'},type:1},{buttonId:'NDJk0a',buttonText:{'displayText':'button3'},type:1}]
From 7e36cceaf0eea684bad3cc3bd1d706bf347d0de5 Mon Sep 17 00:00:00 2001
From: Shir Serlui <70711723+shirser121@users.noreply.github.com>
Date: Mon, 7 Feb 2022 03:00:10 +0200
Subject: [PATCH 09/14] `extra` options can override other options when sending
message (#1103)
* Fix the option to use special options
When we want to use some extra function we need to pass it into the options object, but because it inserted in the first line, the auto options reset some options (like 'type').
This is minor change that can help to add functionallity
* Update Injected.js
Put the special options in the end
* Update Injected.js
Fix , mistake
* only `extra` options can override everything else
Co-authored-by: Pedro Lopez
---
src/Client.js | 2 +-
src/util/Injected.js | 15 ++++++++++-----
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/Client.js b/src/Client.js
index 3d8de39..b09c2f3 100644
--- a/src/Client.js
+++ b/src/Client.js
@@ -540,7 +540,7 @@ class Client extends EventEmitter {
quotedMessageId: options.quotedMessageId,
parseVCards: options.parseVCards === false ? false : true,
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : [],
- ...options.extra
+ extraOptions: options.extra
};
const sendSeen = typeof options.sendSeen === 'undefined' ? true : options.sendSeen;
diff --git a/src/util/Injected.js b/src/util/Injected.js
index 06b7049..fe0f9c8 100644
--- a/src/util/Injected.js
+++ b/src/util/Injected.js
@@ -153,7 +153,7 @@ exports.LoadUtils = () => {
}
}
- let extraOptions = {};
+ let buttonOptions = {};
if(options.buttons){
let caption;
if(options.buttons.type === 'chat') {
@@ -162,7 +162,7 @@ exports.LoadUtils = () => {
}else{
caption = options.caption ? options.caption : ' '; //Caption can't be empty
}
- extraOptions = {
+ buttonOptions = {
productHeaderImageRejected: false,
isFromTemplate: false,
isDynamicReplyButtonsMsg: true,
@@ -175,12 +175,12 @@ exports.LoadUtils = () => {
delete options.buttons;
}
+ let listOptions = {};
if(options.list){
if(window.Store.Conn.platform === 'smba' || window.Store.Conn.platform === 'smbi'){
throw '[LT01] Whatsapp business can\'t send this yet';
}
- extraOptions = {
- ...extraOptions,
+ listOptions = {
type: 'list',
footer: options.list.footer,
list: {
@@ -190,7 +190,7 @@ exports.LoadUtils = () => {
body: options.list.description
};
delete options.list;
- delete extraOptions.list.footer;
+ delete listOptions.list.footer;
}
const newMsgId = new window.Store.MsgKey({
@@ -199,6 +199,9 @@ exports.LoadUtils = () => {
id: window.Store.genId(),
});
+ const extraOptions = options.extraOptions || {};
+ delete options.extraOptions;
+
const message = {
...options,
id: newMsgId,
@@ -215,6 +218,8 @@ exports.LoadUtils = () => {
...attOptions,
...quotedMsgOptions,
...vcardOptions,
+ ...buttonOptions,
+ ...listOptions,
...extraOptions
};
From 70ca073f3851ab72f3185c6056ccab8a5ab671d4 Mon Sep 17 00:00:00 2001
From: "Pedro S. Lopez"
Date: Sun, 6 Feb 2022 21:48:55 -0400
Subject: [PATCH 10/14] fix: send messages properly when disappearing mode is
on (#1174)
* fix: send messages properly when dissappearing mode is on
* add `isEphemeral` to message model
---
index.d.ts | 2 ++
src/structures/Message.js | 6 ++++++
src/util/Injected.js | 8 ++++++++
3 files changed, 16 insertions(+)
diff --git a/index.d.ts b/index.d.ts
index f596284..6e62c54 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -547,6 +547,8 @@ declare namespace WAWebJS {
isStatus: boolean,
/** Indicates if the message is a Gif */
isGif: boolean,
+ /** Indicates if the message will disappear after it expires */
+ isEphemeral: boolean,
/** ID for the Chat that this message was sent to, except if the message was sent by the current user */
from: string,
/** Indicates if the message was sent by the current user */
diff --git a/src/structures/Message.js b/src/structures/Message.js
index 0c582cd..d1e0e87 100644
--- a/src/structures/Message.js
+++ b/src/structures/Message.js
@@ -185,6 +185,12 @@ class Message extends Base {
*/
this.isGif = Boolean(data.isGif);
+ /**
+ * Indicates if the message will disappear after it expires
+ * @type {boolean}
+ */
+ this.isEphemeral = data.isEphemeral;
+
/** Title */
if (data.title) {
this.title = data.title;
diff --git a/src/util/Injected.js b/src/util/Injected.js
index fe0f9c8..f125f83 100644
--- a/src/util/Injected.js
+++ b/src/util/Injected.js
@@ -202,6 +202,12 @@ exports.LoadUtils = () => {
const extraOptions = options.extraOptions || {};
delete options.extraOptions;
+ const ephemeralSettings = {
+ ephemeralDuration: chat.isEphemeralSettingOn() ? chat.getEphemeralSetting() : undefined,
+ ephemeralSettingTimestamp: chat.getEphemeralSettingTimestamp() || undefined,
+ disappearingModeInitiator: chat.getDisappearingModeInitiator() || undefined,
+ };
+
const message = {
...options,
id: newMsgId,
@@ -214,6 +220,7 @@ exports.LoadUtils = () => {
t: parseInt(new Date().getTime() / 1000),
isNewMsg: true,
type: 'chat',
+ ...ephemeralSettings,
...locationOptions,
...attOptions,
...quotedMsgOptions,
@@ -318,6 +325,7 @@ exports.LoadUtils = () => {
window.WWebJS.getMessageModel = message => {
const msg = message.serialize();
+ msg.isEphemeral = message.isEphemeral;
msg.isStatusV3 = message.isStatusV3;
msg.links = (message.getLinks()).map(link => ({
link: link.href,
From 93c8a2b05e204c6d63615f3351ea87c75c4e2b6f Mon Sep 17 00:00:00 2001
From: Pedro Lopez
Date: Sun, 6 Feb 2022 22:20:08 -0400
Subject: [PATCH 11/14] chore: mark version v1.15.5
---
docs/Base.html | 6 +-
docs/BusinessContact.html | 6 +-
docs/Buttons.html | 17 +-
docs/Call.html | 6 +-
docs/Chat.html | 29 +-
docs/Client.html | 33 ++-
docs/Client.js.html | 57 ++--
docs/ClientInfo.html | 15 +-
docs/Contact.html | 6 +-
docs/GroupChat.html | 24 +-
docs/GroupNotification.html | 6 +-
docs/InterfaceController.html | 6 +-
docs/Label.html | 6 +-
docs/List.html | 6 +-
docs/Location.html | 6 +-
docs/Message.html | 20 +-
docs/MessageMedia.html | 6 +-
docs/Order.html | 6 +-
docs/PrivateChat.html | 9 +-
docs/PrivateContact.html | 6 +-
docs/Product.html | 6 +-
docs/Util.html | 15 +-
docs/global.html | 341 +++++++++++++++++++++-
docs/index.html | 116 +++++++-
docs/structures_Base.js.html | 6 +-
docs/structures_BusinessContact.js.html | 6 +-
docs/structures_Buttons.js.html | 28 +-
docs/structures_Call.js.html | 6 +-
docs/structures_Chat.js.html | 34 ++-
docs/structures_ClientInfo.js.html | 6 +-
docs/structures_Contact.js.html | 6 +-
docs/structures_GroupChat.js.html | 6 +-
docs/structures_GroupNotification.js.html | 6 +-
docs/structures_Label.js.html | 6 +-
docs/structures_List.js.html | 6 +-
docs/structures_Location.js.html | 6 +-
docs/structures_Message.js.html | 14 +-
docs/structures_MessageMedia.js.html | 6 +-
docs/structures_Order.js.html | 6 +-
docs/structures_Payment.js.html | 6 +-
docs/structures_PrivateChat.js.html | 6 +-
docs/structures_PrivateContact.js.html | 6 +-
docs/structures_Product.js.html | 6 +-
docs/structures_ProductMetadata.js.html | 6 +-
docs/util_Constants.js.html | 25 +-
docs/util_InterfaceController.js.html | 6 +-
docs/util_Util.js.html | 6 +-
package.json | 2 +-
48 files changed, 743 insertions(+), 228 deletions(-)
diff --git a/docs/Base.html b/docs/Base.html
index f82b9d5..53e96d3 100644
--- a/docs/Base.html
+++ b/docs/Base.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Base
+ whatsapp-web.js 1.15.5 » Class: Base
@@ -15,7 +15,7 @@
@@ -50,7 +50,7 @@
diff --git a/docs/BusinessContact.html b/docs/BusinessContact.html
index 35359d5..27444b8 100644
--- a/docs/BusinessContact.html
+++ b/docs/BusinessContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: BusinessContact
+ whatsapp-web.js 1.15.5 » Class: BusinessContact
@@ -15,7 +15,7 @@
@@ -314,7 +314,7 @@
diff --git a/docs/Buttons.html b/docs/Buttons.html
index 185feb7..782fd95 100644
--- a/docs/Buttons.html
+++ b/docs/Buttons.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Buttons
+ whatsapp-web.js 1.15.5 » Class: Buttons
@@ -15,7 +15,7 @@
@@ -26,7 +26,7 @@
@@ -424,7 +426,8 @@
Returns
- Promise containing Message
Message that was just sent
+ Promise containing Message
+
Message that was just sent
@@ -434,7 +437,8 @@
Returns
- Promise containing Boolean
result
+ Promise containing Boolean
+
result
@@ -464,7 +468,8 @@
Returns
- Promise containing boolean
New pin state
+ Promise containing boolean
+
New pin state
@@ -478,7 +483,7 @@
diff --git a/docs/Client.html b/docs/Client.html
index 59c8448..377d2a5 100644
--- a/docs/Client.html
+++ b/docs/Client.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Client
+ whatsapp-web.js 1.15.5 » Class: Client
@@ -15,7 +15,7 @@
@@ -617,7 +617,8 @@
Returns
- Promise containing string
Id of the joined Chat
+ Promise containing string
+
Id of the joined Chat
@@ -679,15 +680,18 @@
Returns
- Object
createRes
+ Object
+
createRes
- string
createRes.gid - ID for the group that was just created
+ string
+
createRes.gid - ID for the group that was just created
- Object with string properties
createRes.missingParticipants - participants that were not added to the group. Keys represent the ID for participant that was not added and its value is a status code that represents the reason why participant could not be added. This is usually 403 if the user's privacy settings don't allow you to add them to groups.
+ Object with string properties
+
createRes.missingParticipants - participants that were not added to the group. Keys represent the ID for participant that was not added and its value is a status code that represents the reason why participant could not be added. This is usually 403 if the user's privacy settings don't allow you to add them to groups.
@@ -981,7 +985,8 @@
Returns
- Promise containing object
Invite information
+ Promise containing object
+
Invite information
@@ -1263,7 +1268,8 @@
Returns
- Promise containing boolean
New pin state. Could be false if the max number of pinned chats was reached.
+ Promise containing boolean
+
New pin state. Could be false if the max number of pinned chats was reached.
@@ -1435,7 +1441,8 @@
Returns
- Promise containing Message
Message that was just sent
+ Promise containing Message
+
Message that was just sent
@@ -1478,7 +1485,8 @@
Returns
- Promise containing boolean
result
+ Promise containing boolean
+
result
@@ -1600,7 +1608,8 @@
Returns
- Promise containing boolean
New pin state
+ Promise containing boolean
+
New pin state
@@ -2407,7 +2416,7 @@
diff --git a/docs/Client.js.html b/docs/Client.js.html
index 0380311..af18091 100644
--- a/docs/Client.js.html
+++ b/docs/Client.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: Client.js
+ whatsapp-web.js 1.15.5 » Source: Client.js
@@ -15,7 +15,7 @@
@@ -107,7 +107,7 @@ class Client extends EventEmitter {
page = (await browser.pages())[0];
}
- page.setUserAgent(this.options.userAgent);
+ await page.setUserAgent(this.options.userAgent);
this.pupBrowser = browser;
this.pupPage = page;
@@ -140,7 +140,7 @@ class Client extends EventEmitter {
const KEEP_PHONE_CONNECTED_IMG_SELECTOR = '[data-icon="intro-md-beta-logo-dark"], [data-icon="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]';
if (this.options.session) {
- // Check if session restore was successfull
+ // Check if session restore was successful
try {
await page.waitForSelector(KEEP_PHONE_CONNECTED_IMG_SELECTOR, { timeout: this.options.authTimeoutMs });
} catch (err) {
@@ -199,10 +199,22 @@ class Client extends EventEmitter {
this._qrRefreshInterval = setInterval(getQrCode, this.options.qrRefreshIntervalMs);
// Wait for code scan
- await page.waitForSelector(KEEP_PHONE_CONNECTED_IMG_SELECTOR, { timeout: 0 });
- clearInterval(this._qrRefreshInterval);
- this._qrRefreshInterval = undefined;
+ try {
+ await page.waitForSelector(KEEP_PHONE_CONNECTED_IMG_SELECTOR, { timeout: 0 });
+ clearInterval(this._qrRefreshInterval);
+ this._qrRefreshInterval = undefined;
+ } catch(error) {
+ if (
+ error.name === 'ProtocolError' &&
+ error.message &&
+ error.message.match(/Target closed/)
+ ) {
+ // something has called .destroy() while waiting
+ return;
+ }
+ throw error;
+ }
}
await page.evaluate(ExposeStore, moduleRaid.toString());
@@ -258,8 +270,6 @@ class Client extends EventEmitter {
// Register events
await page.exposeFunction('onAddMessageEvent', msg => {
- if (!msg.isNewMsg) return;
-
if (msg.type === 'gp2') {
const notification = new GroupNotification(this, msg);
if (msg.subtype === 'add' || msg.subtype === 'invite') {
@@ -444,7 +454,6 @@ class Client extends EventEmitter {
});
await page.evaluate(() => {
- window.Store.Msg.on('add', (msg) => { if (msg.isNewMsg) window.onAddMessageEvent(window.WWebJS.getMessageModel(msg)); });
window.Store.Msg.on('change', (msg) => { window.onChangeMessageEvent(window.WWebJS.getMessageModel(msg)); });
window.Store.Msg.on('change:type', (msg) => { window.onChangeMessageTypeEvent(window.WWebJS.getMessageModel(msg)); });
window.Store.Msg.on('change:ack', (msg,ack) => { window.onMessageAckEvent(window.WWebJS.getMessageModel(msg), ack); });
@@ -453,6 +462,16 @@ class Client extends EventEmitter {
window.Store.AppState.on('change:state', (_AppState, state) => { window.onAppStateChangedEvent(state); });
window.Store.Conn.on('change:battery', (state) => { window.onBatteryStateChangedEvent(state); });
window.Store.Call.on('add', (call) => { window.onIncomingCall(call); });
+ window.Store.Msg.on('add', (msg) => {
+ if (msg.isNewMsg) {
+ if(msg.type === 'ciphertext') {
+ // defer message event until ciphertext is resolved (type changed)
+ msg.once('change:type', (_msg) => window.onAddMessageEvent(window.WWebJS.getMessageModel(_msg)));
+ } else {
+ window.onAddMessageEvent(window.WWebJS.getMessageModel(msg));
+ }
+ }
+ });
});
/**
@@ -461,11 +480,13 @@ class Client extends EventEmitter {
*/
this.emit(Events.READY);
- // Disconnect when navigating away
- // Because WhatsApp Web now reloads when logging out from the device, this also covers that case
+ // Disconnect when navigating away when in PAIRING state (detect logout)
this.pupPage.on('framenavigated', async () => {
- this.emit(Events.DISCONNECTED, 'NAVIGATION');
- await this.destroy();
+ const appState = await this.getState();
+ if(appState === WAState.PAIRING) {
+ this.emit(Events.DISCONNECTED, 'NAVIGATION');
+ await this.destroy();
+ }
});
}
@@ -550,7 +571,7 @@ class Client extends EventEmitter {
quotedMessageId: options.quotedMessageId,
parseVCards: options.parseVCards === false ? false : true,
mentionedJidList: Array.isArray(options.mentions) ? options.mentions.map(contact => contact.id._serialized) : [],
- ...options.extra
+ extraOptions: options.extra
};
const sendSeen = typeof options.sendSeen === 'undefined' ? true : options.sendSeen;
@@ -758,7 +779,7 @@ class Client extends EventEmitter {
return await this.pupPage.evaluate(async chatId => {
let chat = await window.Store.Chat.get(chatId);
await window.Store.Cmd.archiveChat(chat, true);
- return chat.archive;
+ return true;
}, chatId);
}
@@ -770,7 +791,7 @@ class Client extends EventEmitter {
return await this.pupPage.evaluate(async chatId => {
let chat = await window.Store.Chat.get(chatId);
await window.Store.Cmd.archiveChat(chat, false);
- return chat.archive;
+ return false;
}, chatId);
}
@@ -1044,7 +1065,7 @@ module.exports = Client;
diff --git a/docs/ClientInfo.html b/docs/ClientInfo.html
index acfbe0a..ebd3915 100644
--- a/docs/ClientInfo.html
+++ b/docs/ClientInfo.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: ClientInfo
+ whatsapp-web.js 1.15.5 » Class: ClientInfo
@@ -15,7 +15,7 @@
@@ -213,15 +213,18 @@
Returns
- object
batteryStatus
+ object
+
batteryStatus
- number
batteryStatus.battery - The current battery percentage
+ number
+
batteryStatus.battery - The current battery percentage
- boolean
batteryStatus.plugged - Indicates if the phone is plugged in (true) or not (false)
+ boolean
+
batteryStatus.plugged - Indicates if the phone is plugged in (true) or not (false)
@@ -235,7 +238,7 @@
diff --git a/docs/Contact.html b/docs/Contact.html
index 0230a6c..fefc8a4 100644
--- a/docs/Contact.html
+++ b/docs/Contact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Contact
+ whatsapp-web.js 1.15.5 » Class: Contact
@@ -15,7 +15,7 @@
@@ -281,7 +281,7 @@
diff --git a/docs/GroupChat.html b/docs/GroupChat.html
index 632c96b..77840d8 100644
--- a/docs/GroupChat.html
+++ b/docs/GroupChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: GroupChat
+ whatsapp-web.js 1.15.5 » Class: GroupChat
@@ -15,7 +15,7 @@
@@ -405,7 +405,8 @@
Returns
- Promise containing {status: number}
Object with status code indicating if the operation was successful
+ Promise containing {status: number}
+
Object with status code indicating if the operation was successful
@@ -458,8 +459,7 @@
Yes
- The amount of messages to return. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
- Defaults to 50.
+ The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
@@ -490,7 +490,8 @@
Returns
- Promise containing string
Group's invite code
+ Promise containing string
+
Group's invite code
@@ -601,7 +602,8 @@
Returns
- Promise containing {status: number}
Object with status code indicating if the operation was successful
+ Promise containing {status: number}
+
Object with status code indicating if the operation was successful
@@ -801,7 +803,8 @@
Returns
- Promise containing boolean
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
+ Promise containing boolean
+
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
@@ -841,7 +844,8 @@
Returns
- Promise containing boolean
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
+ Promise containing boolean
+
Returns true if the setting was properly updated. This can return false if the user does not have the necessary permissions.
@@ -917,7 +921,7 @@
diff --git a/docs/GroupNotification.html b/docs/GroupNotification.html
index 1b3e807..014b483 100644
--- a/docs/GroupNotification.html
+++ b/docs/GroupNotification.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: GroupNotification
+ whatsapp-web.js 1.15.5 » Class: GroupNotification
@@ -15,7 +15,7 @@
@@ -233,7 +233,7 @@
diff --git a/docs/InterfaceController.html b/docs/InterfaceController.html
index 70d7fe2..16ef127 100644
--- a/docs/InterfaceController.html
+++ b/docs/InterfaceController.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: InterfaceController
+ whatsapp-web.js 1.15.5 » Class: InterfaceController
@@ -15,7 +15,7 @@
@@ -382,7 +382,7 @@
diff --git a/docs/Label.html b/docs/Label.html
index 31e1df1..8393b50 100644
--- a/docs/Label.html
+++ b/docs/Label.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Label
+ whatsapp-web.js 1.15.5 » Class: Label
@@ -15,7 +15,7 @@
@@ -163,7 +163,7 @@
diff --git a/docs/List.html b/docs/List.html
index bfbc4d6..2e26fb1 100644
--- a/docs/List.html
+++ b/docs/List.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: List
+ whatsapp-web.js 1.15.5 » Class: List
@@ -15,7 +15,7 @@
@@ -256,7 +256,7 @@ Returns: [{'title':'sectionTitle','rows':[{'r
diff --git a/docs/Location.html b/docs/Location.html
index 97d1cb2..1c7447b 100644
--- a/docs/Location.html
+++ b/docs/Location.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Location
+ whatsapp-web.js 1.15.5 » Class: Location
@@ -15,7 +15,7 @@
@@ -149,7 +149,7 @@
diff --git a/docs/Message.html b/docs/Message.html
index e9c746b..72da777 100644
--- a/docs/Message.html
+++ b/docs/Message.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Message
+ whatsapp-web.js 1.15.5 » Class: Message
@@ -15,7 +15,7 @@
@@ -79,6 +79,9 @@
inviteV4
+ isEphemeral
+
+
isForwarded
@@ -94,13 +97,13 @@
links
- location
-
-
+ location
+
+
mediaKey
@@ -260,6 +263,11 @@
Group Invite Data
+ isEphemeral
+ boolean
+ Indicates if the message will disappear after it expires
+
+
isForwarded
boolean
Indicates if the message was forwarded
@@ -572,7 +580,7 @@
diff --git a/docs/MessageMedia.html b/docs/MessageMedia.html
index 6bab41c..c8e2222 100644
--- a/docs/MessageMedia.html
+++ b/docs/MessageMedia.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: MessageMedia
+ whatsapp-web.js 1.15.5 » Class: MessageMedia
@@ -15,7 +15,7 @@
@@ -343,7 +343,7 @@
diff --git a/docs/Order.html b/docs/Order.html
index ba94b62..1286a62 100644
--- a/docs/Order.html
+++ b/docs/Order.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Order
+ whatsapp-web.js 1.15.5 » Class: Order
@@ -15,7 +15,7 @@
@@ -102,7 +102,7 @@
diff --git a/docs/PrivateChat.html b/docs/PrivateChat.html
index 0c133cc..f7fd2bc 100644
--- a/docs/PrivateChat.html
+++ b/docs/PrivateChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: PrivateChat
+ whatsapp-web.js 1.15.5 » Class: PrivateChat
@@ -15,7 +15,7 @@
@@ -318,8 +318,7 @@
Yes
- The amount of messages to return. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
- Defaults to 50.
+ The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
@@ -520,7 +519,7 @@
diff --git a/docs/PrivateContact.html b/docs/PrivateContact.html
index bfb5bbf..b43118f 100644
--- a/docs/PrivateContact.html
+++ b/docs/PrivateContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: PrivateContact
+ whatsapp-web.js 1.15.5 » Class: PrivateContact
@@ -15,7 +15,7 @@
@@ -307,7 +307,7 @@
diff --git a/docs/Product.html b/docs/Product.html
index d8847d7..8cc011b 100644
--- a/docs/Product.html
+++ b/docs/Product.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Product
+ whatsapp-web.js 1.15.5 » Class: Product
@@ -15,7 +15,7 @@
@@ -127,7 +127,7 @@
diff --git a/docs/Util.html b/docs/Util.html
index 06fac76..03f11e2 100644
--- a/docs/Util.html
+++ b/docs/Util.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Class: Util
+ whatsapp-web.js 1.15.5 » Class: Util
@@ -15,7 +15,7 @@
@@ -104,7 +104,8 @@
Returns
- Promise containing MessageMedia
media in webp format
+ Promise containing MessageMedia
+
media in webp format
@@ -155,7 +156,8 @@
Returns
- Promise containing MessageMedia
media in webp format
+ Promise containing MessageMedia
+
media in webp format
@@ -193,7 +195,8 @@
Returns
- Promise containing MessageMedia
media in webp format
+ Promise containing MessageMedia
+
media in webp format
@@ -240,7 +243,7 @@
diff --git a/docs/global.html b/docs/global.html
index 7e20759..dd44936 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Globals
+ whatsapp-web.js 1.15.5 » Globals
@@ -15,7 +15,7 @@
@@ -68,16 +68,22 @@
+ GroupParticipant
+
+
MessageInfo
@@ -862,6 +868,19 @@
+
+
+ LIST_RESPONSE
+
+
+
+
+
+
+
+
+
+
BUTTONS_RESPONSE
@@ -888,6 +907,214 @@
+
+
+ BROADCAST_NOTIFICATION
+
+
+
+
+
+
+
+
+
+
+
+
+ CALL_LOG
+
+
+
+
+
+
+
+
+
+
+
+
+ CIPHERTEXT
+
+
+
+
+
+
+
+
+
+
+
+
+ DEBUG
+
+
+
+
+
+
+
+
+
+
+
+
+ E2E_NOTIFICATION
+
+
+
+
+
+
+
+
+
+
+
+
+ GP2
+
+
+
+
+
+
+
+
+
+
+
+
+ GROUP_NOTIFICATION
+
+
+
+
+
+
+
+
+
+
+
+
+ HSM
+
+
+
+
+
+
+
+
+
+
+
+
+ INTERACTIVE
+
+
+
+
+
+
+
+
+
+
+
+
+ NATIVE_FLOW
+
+
+
+
+
+
+
+
+
+
+
+
+ NOTIFICATION
+
+
+
+
+
+
+
+
+
+
+
+
+ NOTIFICATION_TEMPLATE
+
+
+
+
+
+
+
+
+
+
+
+
+ OVERSIZED
+
+
+
+
+
+
+
+
+
+
+
+
+ PROTOCOL
+
+
+
+
+
+
+
+
+
+
+
+
+ REACTION
+
+
+
+
+
+
+
+
+
+
+
+
+ TEMPLATE_BUTTON_REPLY
+
+
+
+
+
+
+
+
+
+
@@ -1133,6 +1360,54 @@
Abstract types
+
+ Button spec used in Buttons constructor
+
+ Properties
+
+
+
+ Name
+ Type
+ Optional
+ Description
+
+
+
+
+
+ id
+
+
+ string
+
+
+ Yes
+
+
+ Custom ID to set on the button. A random one will be generated if one is not passed.
+
+
+
+
+ body
+
+
+ string
+
+
+
+
+
+ The text to show on the button.
+
+
+
+
+
+
+
ID that represents a contact
@@ -1192,6 +1467,64 @@
+
+
+ Properties
+
+
+
+ Name
+ Type
+ Optional
+ Description
+
+
+
+
+
+ buttonId
+
+
+ string
+
+
+
+
+
+
+
+
+
+ type
+
+
+ number
+
+
+
+
+
+
+
+
+
+ buttonText
+
+
+ Object
+
+
+
+
+
+
+
+
+
+
+
+
GroupParticipant
Object
Group participant information
@@ -1647,7 +1980,7 @@
diff --git a/docs/index.html b/docs/index.html
index ae60120..00df7b1 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Home
+ whatsapp-web.js 1.15.5 » Home
@@ -15,7 +15,7 @@
@@ -27,11 +27,11 @@
+
-
+
-
-
+
+ MessageTypes.PROTOCOL
+
+
+
+
+ MessageTypes.REACTION
+
+
+
MessageTypes.REVOKED
@@ -2266,6 +2351,11 @@ client.initialize();
+
+ MessageTypes.TEMPLATE_BUTTON_REPLY
+
+
+
MessageTypes.TEXT
@@ -2941,7 +3031,7 @@ client.initialize();
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html
index 1734407..49d7a9c 100644
--- a/docs/structures_Base.js.html
+++ b/docs/structures_Base.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Base.js
+ whatsapp-web.js 1.15.5 » Source: structures/Base.js
@@ -15,7 +15,7 @@
@@ -60,7 +60,7 @@ module.exports = Base;
diff --git a/docs/structures_BusinessContact.js.html b/docs/structures_BusinessContact.js.html
index 0107e07..f857e70 100644
--- a/docs/structures_BusinessContact.js.html
+++ b/docs/structures_BusinessContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/BusinessContact.js
+ whatsapp-web.js 1.15.5 » Source: structures/BusinessContact.js
@@ -15,7 +15,7 @@
@@ -59,7 +59,7 @@ module.exports = BusinessContact;
diff --git a/docs/structures_Buttons.js.html b/docs/structures_Buttons.js.html
index 1cd7a29..603fa19 100644
--- a/docs/structures_Buttons.js.html
+++ b/docs/structures_Buttons.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Buttons.js
+ whatsapp-web.js 1.15.5 » Source: structures/Buttons.js
@@ -15,7 +15,7 @@
@@ -34,13 +34,27 @@
const MessageMedia = require('./MessageMedia');
const Util = require('../util/Util');
+/**
+ * Button spec used in Buttons constructor
+ * @typedef {Object} ButtonSpec
+ * @property {string=} id - Custom ID to set on the button. A random one will be generated if one is not passed.
+ * @property {string} body - The text to show on the button.
+ */
+
+/**
+ * @typedef {Object} FormattedButtonSpec
+ * @property {string} buttonId
+ * @property {number} type
+ * @property {Object} buttonText
+ */
+
/**
* Message type buttons
*/
class Buttons {
/**
* @param {string|MessageMedia} body
- * @param {Array<Array<string>>} buttons
+ * @param {ButtonSpec[]} buttons - See {@link ButtonSpec}
* @param {string?} title
* @param {string?} footer
*/
@@ -72,7 +86,7 @@ class Buttons {
/**
* buttons of message
- * @type {Array<Array<string>>}
+ * @type {FormattedButtonSpec[]}
*/
this.buttons = this._format(buttons);
if(!this.buttons.length){ throw '[BT01] No buttons';}
@@ -81,8 +95,8 @@ class Buttons {
/**
* Creates button array from simple array
- * @param {Array<Array<string>>} buttons
- * @returns {Array<Array<string>>}
+ * @param {ButtonSpec[]} buttons
+ * @returns {FormattedButtonSpec[]}
* @example
* Input: [{id:'customId',body:'button1'},{body:'button2'},{body:'button3'},{body:'button4'}]
* Returns: [{ buttonId:'customId',buttonText:{'displayText':'button1'},type: 1 },{buttonId:'n3XKsL',buttonText:{'displayText':'button2'},type:1},{buttonId:'NDJk0a',buttonText:{'displayText':'button3'},type:1}]
@@ -106,7 +120,7 @@ module.exports = Buttons;
diff --git a/docs/structures_Call.js.html b/docs/structures_Call.js.html
index d3e4b3b..0169422 100644
--- a/docs/structures_Call.js.html
+++ b/docs/structures_Call.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Call.js
+ whatsapp-web.js 1.15.5 » Source: structures/Call.js
@@ -15,7 +15,7 @@
@@ -106,7 +106,7 @@ module.exports = Call;
diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html
index f02e790..1bd0a93 100644
--- a/docs/structures_Chat.js.html
+++ b/docs/structures_Chat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Chat.js
+ whatsapp-web.js 1.15.5 » Source: structures/Chat.js
@@ -15,7 +15,7 @@
@@ -96,7 +96,7 @@ class Chat extends Base {
/**
* Indicates if the chat is muted or not
- * @type {number}
+ * @type {boolean}
*/
this.isMuted = data.isMuted;
@@ -202,30 +202,32 @@ class Chat extends Base {
/**
* Loads chat messages, sorted from earliest to latest.
* @param {Object} searchOptions Options for searching messages. Right now only limit is supported.
- * @param {Number} [searchOptions.limit=50] The amount of messages to return. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
+ * @param {Number} [searchOptions.limit] The amount of messages to return. If no limit is specified, the available messages will be returned. Note that the actual number of returned messages may be smaller if there aren't enough messages in the conversation. Set this to Infinity to load all messages.
* @returns {Promise<Array<Message>>}
*/
async fetchMessages(searchOptions) {
- if (!searchOptions || !searchOptions.limit) {
- searchOptions = { limit: 50 };
- }
- let messages = await this.client.pupPage.evaluate(async (chatId, limit) => {
+ let messages = await this.client.pupPage.evaluate(async (chatId, searchOptions) => {
const msgFilter = m => !m.isNotification; // dont include notification messages
const chat = window.Store.Chat.get(chatId);
let msgs = chat.msgs.models.filter(msgFilter);
- while (msgs.length < limit) {
- const loadedMessages = await chat.loadEarlierMsgs();
- if (!loadedMessages) break;
- msgs = [...loadedMessages.filter(msgFilter), ...msgs];
+ if (searchOptions && searchOptions.limit > 0) {
+ while (msgs.length < searchOptions.limit) {
+ const loadedMessages = await chat.loadEarlierMsgs();
+ if (!loadedMessages) break;
+ msgs = [...loadedMessages.filter(msgFilter), ...msgs];
+ }
+
+ if (msgs.length > searchOptions.limit) {
+ msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
+ msgs = msgs.splice(msgs.length - searchOptions.limit);
+ }
}
- msgs.sort((a, b) => (a.t > b.t) ? 1 : -1);
- if (msgs.length > limit) msgs = msgs.splice(msgs.length - limit);
return msgs.map(m => window.WWebJS.getMessageModel(m));
- }, this.id._serialized, searchOptions.limit);
+ }, this.id._serialized, searchOptions);
return messages.map(m => new Message(this.client, m));
}
@@ -288,7 +290,7 @@ module.exports = Chat;
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html
index 152d87e..27594ea 100644
--- a/docs/structures_ClientInfo.js.html
+++ b/docs/structures_ClientInfo.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/ClientInfo.js
+ whatsapp-web.js 1.15.5 » Source: structures/ClientInfo.js
@@ -15,7 +15,7 @@
@@ -108,7 +108,7 @@ module.exports = ClientInfo;
diff --git a/docs/structures_Contact.js.html b/docs/structures_Contact.js.html
index 7b3f383..203c3ea 100644
--- a/docs/structures_Contact.js.html
+++ b/docs/structures_Contact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Contact.js
+ whatsapp-web.js 1.15.5 » Source: structures/Contact.js
@@ -15,7 +15,7 @@
@@ -236,7 +236,7 @@ module.exports = Contact;
diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html
index 3b25141..94e206f 100644
--- a/docs/structures_GroupChat.js.html
+++ b/docs/structures_GroupChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/GroupChat.js
+ whatsapp-web.js 1.15.5 » Source: structures/GroupChat.js
@@ -15,7 +15,7 @@
@@ -239,7 +239,7 @@ module.exports = GroupChat;
diff --git a/docs/structures_GroupNotification.js.html b/docs/structures_GroupNotification.js.html
index 7eae0cf..0911156 100644
--- a/docs/structures_GroupNotification.js.html
+++ b/docs/structures_GroupNotification.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/GroupNotification.js
+ whatsapp-web.js 1.15.5 » Source: structures/GroupNotification.js
@@ -15,7 +15,7 @@
@@ -143,7 +143,7 @@ module.exports = GroupNotification;
diff --git a/docs/structures_Label.js.html b/docs/structures_Label.js.html
index b4e3a2a..223cc7a 100644
--- a/docs/structures_Label.js.html
+++ b/docs/structures_Label.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Label.js
+ whatsapp-web.js 1.15.5 » Source: structures/Label.js
@@ -15,7 +15,7 @@
@@ -88,7 +88,7 @@ module.exports = Label;
diff --git a/docs/structures_List.js.html b/docs/structures_List.js.html
index 7ec83c2..dfbdb35 100644
--- a/docs/structures_List.js.html
+++ b/docs/structures_List.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/List.js
+ whatsapp-web.js 1.15.5 » Source: structures/List.js
@@ -15,7 +15,7 @@
@@ -118,7 +118,7 @@ module.exports = List;
diff --git a/docs/structures_Location.js.html b/docs/structures_Location.js.html
index 8f3baed..9479935 100644
--- a/docs/structures_Location.js.html
+++ b/docs/structures_Location.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Location.js
+ whatsapp-web.js 1.15.5 » Source: structures/Location.js
@@ -15,7 +15,7 @@
@@ -71,7 +71,7 @@ module.exports = Location;
diff --git a/docs/structures_Message.js.html b/docs/structures_Message.js.html
index 01057f0..d25e780 100644
--- a/docs/structures_Message.js.html
+++ b/docs/structures_Message.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Message.js
+ whatsapp-web.js 1.15.5 » Source: structures/Message.js
@@ -15,7 +15,7 @@
@@ -216,6 +216,12 @@ class Message extends Base {
*/
this.isGif = Boolean(data.isGif);
+ /**
+ * Indicates if the message will disappear after it expires
+ * @type {boolean}
+ */
+ this.isEphemeral = data.isEphemeral;
+
/** Title */
if (data.title) {
this.title = data.title;
@@ -413,7 +419,7 @@ class Message extends Base {
await this.client.pupPage.evaluate((msgId, everyone) => {
let msg = window.Store.Msg.get(msgId);
- if (everyone && msg.id.fromMe && msg.canRevoke()) {
+ if (everyone && msg.id.fromMe && msg._canRevoke()) {
return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], true);
}
@@ -519,7 +525,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html
index ca61004..1c20f5a 100644
--- a/docs/structures_MessageMedia.js.html
+++ b/docs/structures_MessageMedia.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/MessageMedia.js
+ whatsapp-web.js 1.15.5 » Source: structures/MessageMedia.js
@@ -15,7 +15,7 @@
@@ -142,7 +142,7 @@ module.exports = MessageMedia;
diff --git a/docs/structures_Order.js.html b/docs/structures_Order.js.html
index 75524f3..b6f6fd7 100644
--- a/docs/structures_Order.js.html
+++ b/docs/structures_Order.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Order.js
+ whatsapp-web.js 1.15.5 » Source: structures/Order.js
@@ -15,7 +15,7 @@
@@ -90,7 +90,7 @@ module.exports = Order;
diff --git a/docs/structures_Payment.js.html b/docs/structures_Payment.js.html
index 589f606..c5a8dcc 100644
--- a/docs/structures_Payment.js.html
+++ b/docs/structures_Payment.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Payment.js
+ whatsapp-web.js 1.15.5 » Source: structures/Payment.js
@@ -15,7 +15,7 @@
@@ -118,7 +118,7 @@ module.exports = Payment;
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html
index dea4e78..b651081 100644
--- a/docs/structures_PrivateChat.js.html
+++ b/docs/structures_PrivateChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/PrivateChat.js
+ whatsapp-web.js 1.15.5 » Source: structures/PrivateChat.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateChat;
diff --git a/docs/structures_PrivateContact.js.html b/docs/structures_PrivateContact.js.html
index 82e09c8..c5c5519 100644
--- a/docs/structures_PrivateContact.js.html
+++ b/docs/structures_PrivateContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/PrivateContact.js
+ whatsapp-web.js 1.15.5 » Source: structures/PrivateContact.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateContact;
diff --git a/docs/structures_Product.js.html b/docs/structures_Product.js.html
index 469726f..c0cd2d4 100644
--- a/docs/structures_Product.js.html
+++ b/docs/structures_Product.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/Product.js
+ whatsapp-web.js 1.15.5 » Source: structures/Product.js
@@ -15,7 +15,7 @@
@@ -106,7 +106,7 @@ module.exports = Product;
diff --git a/docs/structures_ProductMetadata.js.html b/docs/structures_ProductMetadata.js.html
index 2f0ab6b..ed19db0 100644
--- a/docs/structures_ProductMetadata.js.html
+++ b/docs/structures_ProductMetadata.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: structures/ProductMetadata.js
+ whatsapp-web.js 1.15.5 » Source: structures/ProductMetadata.js
@@ -15,7 +15,7 @@
@@ -63,7 +63,7 @@ module.exports = ProductMetadata;
diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html
index f6dd416..1d8d37d 100644
--- a/docs/util_Constants.js.html
+++ b/docs/util_Constants.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: util/Constants.js
+ whatsapp-web.js 1.15.5 » Source: util/Constants.js
@@ -15,7 +15,7 @@
@@ -108,8 +108,25 @@ exports.MessageTypes = {
UNKNOWN: 'unknown',
GROUP_INVITE: 'groups_v4_invite',
LIST: 'list',
+ LIST_RESPONSE: 'list_response',
BUTTONS_RESPONSE: 'buttons_response',
- PAYMENT: 'payment'
+ PAYMENT: 'payment',
+ BROADCAST_NOTIFICATION: 'broadcast_notification',
+ CALL_LOG: 'call_log',
+ CIPHERTEXT: 'ciphertext',
+ DEBUG: 'debug',
+ E2E_NOTIFICATION: 'e2e_notification',
+ GP2: 'gp2',
+ GROUP_NOTIFICATION: 'group_notification',
+ HSM: 'hsm',
+ INTERACTIVE: 'interactive',
+ NATIVE_FLOW: 'native_flow',
+ NOTIFICATION: 'notification',
+ NOTIFICATION_TEMPLATE: 'notification_template',
+ OVERSIZED: 'oversized',
+ PROTOCOL: 'protocol',
+ REACTION: 'reaction',
+ TEMPLATE_BUTTON_REPLY: 'template_button_reply',
};
/**
@@ -183,7 +200,7 @@ exports.MessageAck = {
diff --git a/docs/util_InterfaceController.js.html b/docs/util_InterfaceController.js.html
index fbbe312..81233f6 100644
--- a/docs/util_InterfaceController.js.html
+++ b/docs/util_InterfaceController.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: util/InterfaceController.js
+ whatsapp-web.js 1.15.5 » Source: util/InterfaceController.js
@@ -15,7 +15,7 @@
@@ -160,7 +160,7 @@ module.exports = InterfaceController;
diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html
index dae5c54..4edf4c1 100644
--- a/docs/util_Util.js.html
+++ b/docs/util_Util.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.4 » Source: util/Util.js
+ whatsapp-web.js 1.15.5 » Source: util/Util.js
@@ -15,7 +15,7 @@
@@ -242,7 +242,7 @@ module.exports = Util;
diff --git a/package.json b/package.json
index 4d9331f..f325999 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
- "version": "1.15.4",
+ "version": "1.15.5",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"typings": "./index.d.ts",
From 20f3bc7a8b31b3c874e7f23efc3e3aa133832fa8 Mon Sep 17 00:00:00 2001
From: "Pedro S. Lopez"
Date: Tue, 8 Feb 2022 22:33:20 -0400
Subject: [PATCH 12/14] fix: dont cause redirect loop due to session restore
(#1181)
* fix: dont cause redirect loop due to session restore
* back to `state` in docs
* use referer to determine first injection
* bring bzck disconnect on nav
* revert some changes
---
index.d.ts | 2 +-
src/Client.js | 18 +++++++++++-------
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/index.d.ts b/index.d.ts
index 6e62c54..0f14faf 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -166,7 +166,7 @@ declare namespace WAWebJS {
/** Emitted when the client has been disconnected */
on(event: 'disconnected', listener: (
/** reason that caused the disconnect */
- reason: WAState | "NAVIGATED"
+ reason: WAState | "NAVIGATION"
) => void): this
/** Emitted when a user joins the chat via invite link or is added by an admin */
diff --git a/src/Client.js b/src/Client.js
index b09c2f3..27c2079 100644
--- a/src/Client.js
+++ b/src/Client.js
@@ -74,7 +74,7 @@ class Client extends EventEmitter {
} else {
browser = await puppeteer.launch(this.options.puppeteer);
page = (await browser.pages())[0];
- }
+ }
await page.setUserAgent(this.options.userAgent);
@@ -89,11 +89,13 @@ class Client extends EventEmitter {
if (this.options.session) {
await page.evaluateOnNewDocument(
session => {
- localStorage.clear();
- localStorage.setItem('WABrowserId', session.WABrowserId);
- localStorage.setItem('WASecretBundle', session.WASecretBundle);
- localStorage.setItem('WAToken1', session.WAToken1);
- localStorage.setItem('WAToken2', session.WAToken2);
+ if(document.referrer === 'https://whatsapp.com/') {
+ localStorage.clear();
+ localStorage.setItem('WABrowserId', session.WABrowserId);
+ localStorage.setItem('WASecretBundle', session.WASecretBundle);
+ localStorage.setItem('WAToken1', session.WAToken1);
+ localStorage.setItem('WAToken2', session.WAToken2);
+ }
}, this.options.session);
}
@@ -104,6 +106,7 @@ class Client extends EventEmitter {
await page.goto(WhatsWebURL, {
waitUntil: 'load',
timeout: 0,
+ referer: 'https://whatsapp.com/'
});
const KEEP_PHONE_CONNECTED_IMG_SELECTOR = '[data-icon="intro-md-beta-logo-dark"], [data-icon="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]';
@@ -452,7 +455,7 @@ class Client extends EventEmitter {
// Disconnect when navigating away when in PAIRING state (detect logout)
this.pupPage.on('framenavigated', async () => {
const appState = await this.getState();
- if(appState === WAState.PAIRING) {
+ if(!appState || appState === WAState.PAIRING) {
this.emit(Events.DISCONNECTED, 'NAVIGATION');
await this.destroy();
}
@@ -727,6 +730,7 @@ class Client extends EventEmitter {
*/
async getState() {
return await this.pupPage.evaluate(() => {
+ if(!window.Store) return null;
return window.Store.AppState.state;
});
}
From 444abc2c76e09518c84adbd0e362edf1e8189f37 Mon Sep 17 00:00:00 2001
From: "Md. Fahim Bin Amin"
Date: Wed, 9 Feb 2022 08:34:33 +0600
Subject: [PATCH 13/14] added the Code of Conduct, closing #1156 (#1176)
---
CODE_OF_CONDUCT.md | 133 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 133 insertions(+)
create mode 100644 CODE_OF_CONDUCT.md
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..e73010a
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,133 @@
+
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the
+ overall community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or
+ advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email
+ address, without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+[pedroslopez@me.com](mailto:pedroslopez@me.com).
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series
+of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or
+permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.0, available at
+[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
+
+Community Impact Guidelines were inspired by
+[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
+
+For answers to common questions about this code of conduct, see the FAQ at
+[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
+at [https://www.contributor-covenant.org/translations][translations].
+
+[homepage]: https://www.contributor-covenant.org
+[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
+[Mozilla CoC]: https://github.com/mozilla/diversity
+[FAQ]: https://www.contributor-covenant.org/faq
+[translations]: https://www.contributor-covenant.org/translations
From 11955e9f03986f0c2583b133690a7c2622b7a5d9 Mon Sep 17 00:00:00 2001
From: Pedro Lopez
Date: Tue, 8 Feb 2022 22:38:33 -0400
Subject: [PATCH 14/14] chore: mark version v1.15.6
---
docs/Base.html | 6 +++---
docs/BusinessContact.html | 6 +++---
docs/Buttons.html | 6 +++---
docs/Call.html | 6 +++---
docs/Chat.html | 6 +++---
docs/Client.html | 6 +++---
docs/Client.js.html | 24 +++++++++++++----------
docs/ClientInfo.html | 6 +++---
docs/Contact.html | 6 +++---
docs/GroupChat.html | 6 +++---
docs/GroupNotification.html | 6 +++---
docs/InterfaceController.html | 6 +++---
docs/Label.html | 6 +++---
docs/List.html | 6 +++---
docs/Location.html | 6 +++---
docs/Message.html | 6 +++---
docs/MessageMedia.html | 6 +++---
docs/Order.html | 6 +++---
docs/PrivateChat.html | 6 +++---
docs/PrivateContact.html | 6 +++---
docs/Product.html | 6 +++---
docs/Util.html | 6 +++---
docs/global.html | 6 +++---
docs/index.html | 8 ++++----
docs/structures_Base.js.html | 6 +++---
docs/structures_BusinessContact.js.html | 6 +++---
docs/structures_Buttons.js.html | 6 +++---
docs/structures_Call.js.html | 6 +++---
docs/structures_Chat.js.html | 6 +++---
docs/structures_ClientInfo.js.html | 6 +++---
docs/structures_Contact.js.html | 6 +++---
docs/structures_GroupChat.js.html | 6 +++---
docs/structures_GroupNotification.js.html | 6 +++---
docs/structures_Label.js.html | 6 +++---
docs/structures_List.js.html | 6 +++---
docs/structures_Location.js.html | 6 +++---
docs/structures_Message.js.html | 6 +++---
docs/structures_MessageMedia.js.html | 6 +++---
docs/structures_Order.js.html | 6 +++---
docs/structures_Payment.js.html | 6 +++---
docs/structures_PrivateChat.js.html | 6 +++---
docs/structures_PrivateContact.js.html | 6 +++---
docs/structures_Product.js.html | 6 +++---
docs/structures_ProductMetadata.js.html | 6 +++---
docs/util_Constants.js.html | 6 +++---
docs/util_InterfaceController.js.html | 6 +++---
docs/util_Util.js.html | 6 +++---
package.json | 2 +-
48 files changed, 154 insertions(+), 150 deletions(-)
diff --git a/docs/Base.html b/docs/Base.html
index 53e96d3..431e533 100644
--- a/docs/Base.html
+++ b/docs/Base.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Base
+ whatsapp-web.js 1.15.6 » Class: Base
@@ -15,7 +15,7 @@
@@ -50,7 +50,7 @@
diff --git a/docs/BusinessContact.html b/docs/BusinessContact.html
index 27444b8..32f1ef2 100644
--- a/docs/BusinessContact.html
+++ b/docs/BusinessContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: BusinessContact
+ whatsapp-web.js 1.15.6 » Class: BusinessContact
@@ -15,7 +15,7 @@
@@ -314,7 +314,7 @@
diff --git a/docs/Buttons.html b/docs/Buttons.html
index 782fd95..a6e6b29 100644
--- a/docs/Buttons.html
+++ b/docs/Buttons.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Buttons
+ whatsapp-web.js 1.15.6 » Class: Buttons
@@ -15,7 +15,7 @@
@@ -234,7 +234,7 @@ Returns: [{ buttonId:'customId',buttonText:{'displayText':
diff --git a/docs/Call.html b/docs/Call.html
index 67aec23..5e027ba 100644
--- a/docs/Call.html
+++ b/docs/Call.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Call
+ whatsapp-web.js 1.15.6 » Class: Call
@@ -15,7 +15,7 @@
@@ -144,7 +144,7 @@
diff --git a/docs/Chat.html b/docs/Chat.html
index 3106161..ba808ca 100644
--- a/docs/Chat.html
+++ b/docs/Chat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Chat
+ whatsapp-web.js 1.15.6 » Class: Chat
@@ -15,7 +15,7 @@
@@ -483,7 +483,7 @@
diff --git a/docs/Client.html b/docs/Client.html
index 377d2a5..e05aad7 100644
--- a/docs/Client.html
+++ b/docs/Client.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Client
+ whatsapp-web.js 1.15.6 » Class: Client
@@ -15,7 +15,7 @@
@@ -2416,7 +2416,7 @@
diff --git a/docs/Client.js.html b/docs/Client.js.html
index af18091..5616fe9 100644
--- a/docs/Client.js.html
+++ b/docs/Client.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: Client.js
+ whatsapp-web.js 1.15.6 » Source: Client.js
@@ -15,7 +15,7 @@
@@ -105,7 +105,7 @@ class Client extends EventEmitter {
} else {
browser = await puppeteer.launch(this.options.puppeteer);
page = (await browser.pages())[0];
- }
+ }
await page.setUserAgent(this.options.userAgent);
@@ -120,11 +120,13 @@ class Client extends EventEmitter {
if (this.options.session) {
await page.evaluateOnNewDocument(
session => {
- localStorage.clear();
- localStorage.setItem('WABrowserId', session.WABrowserId);
- localStorage.setItem('WASecretBundle', session.WASecretBundle);
- localStorage.setItem('WAToken1', session.WAToken1);
- localStorage.setItem('WAToken2', session.WAToken2);
+ if(document.referrer === 'https://whatsapp.com/') {
+ localStorage.clear();
+ localStorage.setItem('WABrowserId', session.WABrowserId);
+ localStorage.setItem('WASecretBundle', session.WASecretBundle);
+ localStorage.setItem('WAToken1', session.WAToken1);
+ localStorage.setItem('WAToken2', session.WAToken2);
+ }
}, this.options.session);
}
@@ -135,6 +137,7 @@ class Client extends EventEmitter {
await page.goto(WhatsWebURL, {
waitUntil: 'load',
timeout: 0,
+ referer: 'https://whatsapp.com/'
});
const KEEP_PHONE_CONNECTED_IMG_SELECTOR = '[data-icon="intro-md-beta-logo-dark"], [data-icon="intro-md-beta-logo-light"], [data-asset-intro-image-light="true"], [data-asset-intro-image-dark="true"]';
@@ -483,7 +486,7 @@ class Client extends EventEmitter {
// Disconnect when navigating away when in PAIRING state (detect logout)
this.pupPage.on('framenavigated', async () => {
const appState = await this.getState();
- if(appState === WAState.PAIRING) {
+ if(!appState || appState === WAState.PAIRING) {
this.emit(Events.DISCONNECTED, 'NAVIGATION');
await this.destroy();
}
@@ -758,6 +761,7 @@ class Client extends EventEmitter {
*/
async getState() {
return await this.pupPage.evaluate(() => {
+ if(!window.Store) return null;
return window.Store.AppState.state;
});
}
@@ -1065,7 +1069,7 @@ module.exports = Client;
diff --git a/docs/ClientInfo.html b/docs/ClientInfo.html
index ebd3915..1ea8a5e 100644
--- a/docs/ClientInfo.html
+++ b/docs/ClientInfo.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: ClientInfo
+ whatsapp-web.js 1.15.6 » Class: ClientInfo
@@ -15,7 +15,7 @@
@@ -238,7 +238,7 @@
diff --git a/docs/Contact.html b/docs/Contact.html
index fefc8a4..e5d77bc 100644
--- a/docs/Contact.html
+++ b/docs/Contact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Contact
+ whatsapp-web.js 1.15.6 » Class: Contact
@@ -15,7 +15,7 @@
@@ -281,7 +281,7 @@
diff --git a/docs/GroupChat.html b/docs/GroupChat.html
index 77840d8..b697aca 100644
--- a/docs/GroupChat.html
+++ b/docs/GroupChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: GroupChat
+ whatsapp-web.js 1.15.6 » Class: GroupChat
@@ -15,7 +15,7 @@
@@ -921,7 +921,7 @@
diff --git a/docs/GroupNotification.html b/docs/GroupNotification.html
index 014b483..f446b0b 100644
--- a/docs/GroupNotification.html
+++ b/docs/GroupNotification.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: GroupNotification
+ whatsapp-web.js 1.15.6 » Class: GroupNotification
@@ -15,7 +15,7 @@
@@ -233,7 +233,7 @@
diff --git a/docs/InterfaceController.html b/docs/InterfaceController.html
index 16ef127..d351316 100644
--- a/docs/InterfaceController.html
+++ b/docs/InterfaceController.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: InterfaceController
+ whatsapp-web.js 1.15.6 » Class: InterfaceController
@@ -15,7 +15,7 @@
@@ -382,7 +382,7 @@
diff --git a/docs/Label.html b/docs/Label.html
index 8393b50..fa8a910 100644
--- a/docs/Label.html
+++ b/docs/Label.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Label
+ whatsapp-web.js 1.15.6 » Class: Label
@@ -15,7 +15,7 @@
@@ -163,7 +163,7 @@
diff --git a/docs/List.html b/docs/List.html
index 2e26fb1..1d8156c 100644
--- a/docs/List.html
+++ b/docs/List.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: List
+ whatsapp-web.js 1.15.6 » Class: List
@@ -15,7 +15,7 @@
@@ -256,7 +256,7 @@ Returns: [{'title':'sectionTitle','rows':[{'r
diff --git a/docs/Location.html b/docs/Location.html
index 1c7447b..6a672e8 100644
--- a/docs/Location.html
+++ b/docs/Location.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Location
+ whatsapp-web.js 1.15.6 » Class: Location
@@ -15,7 +15,7 @@
@@ -149,7 +149,7 @@
diff --git a/docs/Message.html b/docs/Message.html
index 72da777..d9b2f59 100644
--- a/docs/Message.html
+++ b/docs/Message.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Message
+ whatsapp-web.js 1.15.6 » Class: Message
@@ -15,7 +15,7 @@
@@ -580,7 +580,7 @@
diff --git a/docs/MessageMedia.html b/docs/MessageMedia.html
index c8e2222..0442fd7 100644
--- a/docs/MessageMedia.html
+++ b/docs/MessageMedia.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: MessageMedia
+ whatsapp-web.js 1.15.6 » Class: MessageMedia
@@ -15,7 +15,7 @@
@@ -343,7 +343,7 @@
diff --git a/docs/Order.html b/docs/Order.html
index 1286a62..39a3668 100644
--- a/docs/Order.html
+++ b/docs/Order.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Order
+ whatsapp-web.js 1.15.6 » Class: Order
@@ -15,7 +15,7 @@
@@ -102,7 +102,7 @@
diff --git a/docs/PrivateChat.html b/docs/PrivateChat.html
index f7fd2bc..0990185 100644
--- a/docs/PrivateChat.html
+++ b/docs/PrivateChat.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: PrivateChat
+ whatsapp-web.js 1.15.6 » Class: PrivateChat
@@ -15,7 +15,7 @@
@@ -519,7 +519,7 @@
diff --git a/docs/PrivateContact.html b/docs/PrivateContact.html
index b43118f..388084a 100644
--- a/docs/PrivateContact.html
+++ b/docs/PrivateContact.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: PrivateContact
+ whatsapp-web.js 1.15.6 » Class: PrivateContact
@@ -15,7 +15,7 @@
@@ -307,7 +307,7 @@
diff --git a/docs/Product.html b/docs/Product.html
index 8cc011b..6359b7a 100644
--- a/docs/Product.html
+++ b/docs/Product.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Product
+ whatsapp-web.js 1.15.6 » Class: Product
@@ -15,7 +15,7 @@
@@ -127,7 +127,7 @@
diff --git a/docs/Util.html b/docs/Util.html
index 03f11e2..696d76d 100644
--- a/docs/Util.html
+++ b/docs/Util.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Class: Util
+ whatsapp-web.js 1.15.6 » Class: Util
@@ -15,7 +15,7 @@
@@ -243,7 +243,7 @@
diff --git a/docs/global.html b/docs/global.html
index dd44936..b373bf7 100644
--- a/docs/global.html
+++ b/docs/global.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Globals
+ whatsapp-web.js 1.15.6 » Globals
@@ -15,7 +15,7 @@
@@ -1980,7 +1980,7 @@
diff --git a/docs/index.html b/docs/index.html
index 00df7b1..aa8315c 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Home
+ whatsapp-web.js 1.15.6 » Home
@@ -15,7 +15,7 @@
@@ -27,7 +27,7 @@
@@ -3031,7 +3031,7 @@ client.initialize();
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html
index 49d7a9c..d2a8249 100644
--- a/docs/structures_Base.js.html
+++ b/docs/structures_Base.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Base.js
+ whatsapp-web.js 1.15.6 » Source: structures/Base.js
@@ -15,7 +15,7 @@
@@ -60,7 +60,7 @@ module.exports = Base;
diff --git a/docs/structures_BusinessContact.js.html b/docs/structures_BusinessContact.js.html
index f857e70..9f69b7e 100644
--- a/docs/structures_BusinessContact.js.html
+++ b/docs/structures_BusinessContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/BusinessContact.js
+ whatsapp-web.js 1.15.6 » Source: structures/BusinessContact.js
@@ -15,7 +15,7 @@
@@ -59,7 +59,7 @@ module.exports = BusinessContact;
diff --git a/docs/structures_Buttons.js.html b/docs/structures_Buttons.js.html
index 603fa19..1fb8ace 100644
--- a/docs/structures_Buttons.js.html
+++ b/docs/structures_Buttons.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Buttons.js
+ whatsapp-web.js 1.15.6 » Source: structures/Buttons.js
@@ -15,7 +15,7 @@
@@ -120,7 +120,7 @@ module.exports = Buttons;
diff --git a/docs/structures_Call.js.html b/docs/structures_Call.js.html
index 0169422..77a86e1 100644
--- a/docs/structures_Call.js.html
+++ b/docs/structures_Call.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Call.js
+ whatsapp-web.js 1.15.6 » Source: structures/Call.js
@@ -15,7 +15,7 @@
@@ -106,7 +106,7 @@ module.exports = Call;
diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html
index 1bd0a93..917d234 100644
--- a/docs/structures_Chat.js.html
+++ b/docs/structures_Chat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Chat.js
+ whatsapp-web.js 1.15.6 » Source: structures/Chat.js
@@ -15,7 +15,7 @@
@@ -290,7 +290,7 @@ module.exports = Chat;
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html
index 27594ea..1bea899 100644
--- a/docs/structures_ClientInfo.js.html
+++ b/docs/structures_ClientInfo.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/ClientInfo.js
+ whatsapp-web.js 1.15.6 » Source: structures/ClientInfo.js
@@ -15,7 +15,7 @@
@@ -108,7 +108,7 @@ module.exports = ClientInfo;
diff --git a/docs/structures_Contact.js.html b/docs/structures_Contact.js.html
index 203c3ea..951e985 100644
--- a/docs/structures_Contact.js.html
+++ b/docs/structures_Contact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Contact.js
+ whatsapp-web.js 1.15.6 » Source: structures/Contact.js
@@ -15,7 +15,7 @@
@@ -236,7 +236,7 @@ module.exports = Contact;
diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html
index 94e206f..cc2daf6 100644
--- a/docs/structures_GroupChat.js.html
+++ b/docs/structures_GroupChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/GroupChat.js
+ whatsapp-web.js 1.15.6 » Source: structures/GroupChat.js
@@ -15,7 +15,7 @@
@@ -239,7 +239,7 @@ module.exports = GroupChat;
diff --git a/docs/structures_GroupNotification.js.html b/docs/structures_GroupNotification.js.html
index 0911156..c36ffb4 100644
--- a/docs/structures_GroupNotification.js.html
+++ b/docs/structures_GroupNotification.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/GroupNotification.js
+ whatsapp-web.js 1.15.6 » Source: structures/GroupNotification.js
@@ -15,7 +15,7 @@
@@ -143,7 +143,7 @@ module.exports = GroupNotification;
diff --git a/docs/structures_Label.js.html b/docs/structures_Label.js.html
index 223cc7a..d0ddbda 100644
--- a/docs/structures_Label.js.html
+++ b/docs/structures_Label.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Label.js
+ whatsapp-web.js 1.15.6 » Source: structures/Label.js
@@ -15,7 +15,7 @@
@@ -88,7 +88,7 @@ module.exports = Label;
diff --git a/docs/structures_List.js.html b/docs/structures_List.js.html
index dfbdb35..600a35a 100644
--- a/docs/structures_List.js.html
+++ b/docs/structures_List.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/List.js
+ whatsapp-web.js 1.15.6 » Source: structures/List.js
@@ -15,7 +15,7 @@
@@ -118,7 +118,7 @@ module.exports = List;
diff --git a/docs/structures_Location.js.html b/docs/structures_Location.js.html
index 9479935..351ab27 100644
--- a/docs/structures_Location.js.html
+++ b/docs/structures_Location.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Location.js
+ whatsapp-web.js 1.15.6 » Source: structures/Location.js
@@ -15,7 +15,7 @@
@@ -71,7 +71,7 @@ module.exports = Location;
diff --git a/docs/structures_Message.js.html b/docs/structures_Message.js.html
index d25e780..38ec6bd 100644
--- a/docs/structures_Message.js.html
+++ b/docs/structures_Message.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Message.js
+ whatsapp-web.js 1.15.6 » Source: structures/Message.js
@@ -15,7 +15,7 @@
@@ -525,7 +525,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html
index 1c20f5a..da84bcd 100644
--- a/docs/structures_MessageMedia.js.html
+++ b/docs/structures_MessageMedia.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/MessageMedia.js
+ whatsapp-web.js 1.15.6 » Source: structures/MessageMedia.js
@@ -15,7 +15,7 @@
@@ -142,7 +142,7 @@ module.exports = MessageMedia;
diff --git a/docs/structures_Order.js.html b/docs/structures_Order.js.html
index b6f6fd7..fd519bd 100644
--- a/docs/structures_Order.js.html
+++ b/docs/structures_Order.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Order.js
+ whatsapp-web.js 1.15.6 » Source: structures/Order.js
@@ -15,7 +15,7 @@
@@ -90,7 +90,7 @@ module.exports = Order;
diff --git a/docs/structures_Payment.js.html b/docs/structures_Payment.js.html
index c5a8dcc..d513f0f 100644
--- a/docs/structures_Payment.js.html
+++ b/docs/structures_Payment.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Payment.js
+ whatsapp-web.js 1.15.6 » Source: structures/Payment.js
@@ -15,7 +15,7 @@
@@ -118,7 +118,7 @@ module.exports = Payment;
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html
index b651081..0db9881 100644
--- a/docs/structures_PrivateChat.js.html
+++ b/docs/structures_PrivateChat.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/PrivateChat.js
+ whatsapp-web.js 1.15.6 » Source: structures/PrivateChat.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateChat;
diff --git a/docs/structures_PrivateContact.js.html b/docs/structures_PrivateContact.js.html
index c5c5519..17ced7e 100644
--- a/docs/structures_PrivateContact.js.html
+++ b/docs/structures_PrivateContact.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/PrivateContact.js
+ whatsapp-web.js 1.15.6 » Source: structures/PrivateContact.js
@@ -15,7 +15,7 @@
@@ -51,7 +51,7 @@ module.exports = PrivateContact;
diff --git a/docs/structures_Product.js.html b/docs/structures_Product.js.html
index c0cd2d4..ec9a754 100644
--- a/docs/structures_Product.js.html
+++ b/docs/structures_Product.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/Product.js
+ whatsapp-web.js 1.15.6 » Source: structures/Product.js
@@ -15,7 +15,7 @@
@@ -106,7 +106,7 @@ module.exports = Product;
diff --git a/docs/structures_ProductMetadata.js.html b/docs/structures_ProductMetadata.js.html
index ed19db0..856fd1d 100644
--- a/docs/structures_ProductMetadata.js.html
+++ b/docs/structures_ProductMetadata.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: structures/ProductMetadata.js
+ whatsapp-web.js 1.15.6 » Source: structures/ProductMetadata.js
@@ -15,7 +15,7 @@
@@ -63,7 +63,7 @@ module.exports = ProductMetadata;
diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html
index 1d8d37d..165cd8b 100644
--- a/docs/util_Constants.js.html
+++ b/docs/util_Constants.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: util/Constants.js
+ whatsapp-web.js 1.15.6 » Source: util/Constants.js
@@ -15,7 +15,7 @@
@@ -200,7 +200,7 @@ exports.MessageAck = {
diff --git a/docs/util_InterfaceController.js.html b/docs/util_InterfaceController.js.html
index 81233f6..bac96c8 100644
--- a/docs/util_InterfaceController.js.html
+++ b/docs/util_InterfaceController.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: util/InterfaceController.js
+ whatsapp-web.js 1.15.6 » Source: util/InterfaceController.js
@@ -15,7 +15,7 @@
@@ -160,7 +160,7 @@ module.exports = InterfaceController;
diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html
index 4edf4c1..8d4eb75 100644
--- a/docs/util_Util.js.html
+++ b/docs/util_Util.js.html
@@ -4,7 +4,7 @@
- whatsapp-web.js 1.15.5 » Source: util/Util.js
+ whatsapp-web.js 1.15.6 » Source: util/Util.js
@@ -15,7 +15,7 @@
@@ -242,7 +242,7 @@ module.exports = Util;
diff --git a/package.json b/package.json
index f325999..9e45e3a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "whatsapp-web.js",
- "version": "1.15.5",
+ "version": "1.15.6",
"description": "Library for interacting with the WhatsApp Web API ",
"main": "./index.js",
"typings": "./index.d.ts",