whatsapp-web.js 1.16.4 → 1.16.5

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.2206.5](https://img.shields.io/badge/WhatsApp_Web-2.2206.5-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.2210.9](https://img.shields.io/badge/WhatsApp_Web-2.2210.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/index.d.ts CHANGED
@@ -304,7 +304,7 @@ declare namespace WAWebJS {
304
304
  * @default 0 */
305
305
  authTimeoutMs?: number,
306
306
  /** Puppeteer launch options. View docs here: https://github.com/puppeteer/puppeteer/ */
307
- puppeteer?: puppeteer.LaunchOptions & puppeteer.BrowserLaunchArgumentOptions & puppeteer.BrowserConnectOptions
307
+ puppeteer?: puppeteer.PuppeteerNodeLaunchOptions & puppeteer.ConnectOptions
308
308
  /** Determines how to save and restore sessions. Will use LegacySessionAuth if options.session is set. Otherwise, NoAuth will be used. */
309
309
  authStrategy?: AuthStrategy,
310
310
  /** How many times should the qrcode be refreshed before giving up
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatsapp-web.js",
3
- "version": "1.16.4",
3
+ "version": "1.16.5",
4
4
  "description": "Library for interacting with the WhatsApp Web API ",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
package/src/Client.js CHANGED
@@ -877,19 +877,15 @@ class Client extends EventEmitter {
877
877
  */
878
878
  async getProfilePicUrl(contactId) {
879
879
  const profilePic = await this.pupPage.evaluate(async contactId => {
880
- let asyncPic;
881
- if (window.Store.Features.features.MD_BACKEND) {
880
+ try {
882
881
  const chatWid = window.Store.WidFactory.createWid(contactId);
883
- asyncPic = await window.Store.getProfilePicFull(chatWid).catch(() => {
884
- return undefined;
885
- });
886
- } else {
887
- asyncPic = await window.Store.Wap.profilePicFind(contactId).catch(() => {
888
- return undefined;
889
- });
882
+ return await window.Store.ProfilePic.profilePicFind(chatWid);
883
+ } catch (err) {
884
+ if(err.name === 'ServerStatusCodeError') return undefined;
885
+ throw err;
890
886
  }
891
- return asyncPic;
892
887
  }, contactId);
888
+
893
889
  return profilePic ? profilePic.eurl : undefined;
894
890
  }
895
891
 
@@ -999,7 +995,7 @@ class Client extends EventEmitter {
999
995
 
1000
996
  const createRes = await this.pupPage.evaluate(async (name, participantIds) => {
1001
997
  const participantWIDs = participantIds.map(p => window.Store.WidFactory.createWid(p));
1002
- const id = window.Store.genId();
998
+ const id = window.Store.MsgKey.newId();
1003
999
  const res = await window.Store.GroupUtils.sendCreateGroup(name, participantWIDs, undefined, id);
1004
1000
  return res;
1005
1001
  }, name, participants);
@@ -43,7 +43,7 @@ class GroupNotification extends Base {
43
43
  *
44
44
  * @type {string}
45
45
  */
46
- this.chatId = typeof (data.to) === 'object' ? data.to._serialized : data.to;
46
+ this.chatId = typeof (data.id.remote) === 'object' ? data.id.remote._serialized : data.id.remote;
47
47
 
48
48
  /**
49
49
  * ContactId for the user that produced the GroupNotification.
@@ -40,7 +40,7 @@ exports.ExposeStore = (moduleRaidStr) => {
40
40
  window.Store.VCard = window.mR.findModule('vcardFromContactModel')[0];
41
41
  window.Store.Wap = window.mR.findModule('queryLinkPreview')[0].default;
42
42
  window.Store.WidFactory = window.mR.findModule('createWid')[0];
43
- window.Store.getProfilePicFull = window.mR.findModule('getProfilePicFull')[0].getProfilePicFull;
43
+ window.Store.ProfilePic = window.mR.findModule('profilePicResync')[0];
44
44
  window.Store.PresenceUtils = window.mR.findModule('sendPresenceAvailable')[0];
45
45
  window.Store.ChatState = window.mR.findModule('sendChatStateComposing')[0];
46
46
  window.Store.GroupParticipants = window.mR.findModule('sendPromoteParticipants')[0];