Skip to content

Commit

Permalink
fix pushname undefined in client.info
Browse files Browse the repository at this point in the history
  • Loading branch information
DikaArdnt committed Dec 9, 2023
1 parent f014299 commit 6b766d9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 35 deletions.
22 changes: 0 additions & 22 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,6 @@ declare namespace WAJS {
me: ContactId
/** Current user ID */
wid: ContactId
/**
* Information about the phone this client is connected to. Not available in multi-device.
* @deprecated
*/
phone: ClientInfoPhone
/** Platform the phone is running on */
platform: string
/** Name configured to be shown in push notifications */
Expand All @@ -371,23 +366,6 @@ declare namespace WAJS {
getBatteryStatus: () => Promise<BatteryInfo>
}

/**
* Information about the phone this client is connected to
* @deprecated
*/
export interface ClientInfoPhone {
/** WhatsApp Version running on the phone */
wa_version: string
/** OS Version running on the phone (iOS or Android version) */
os_version: string
/** Device manufacturer */
device_manufacturer: string
/** Device model */
device_model: string
/** OS build number */
os_build_number: string
}

/** Options for initializing the whatsapp client */
export interface ClientOptions {
/**
Expand Down
4 changes: 3 additions & 1 deletion src/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,9 @@ class Client extends EventEmitter {
* @type {ClientInfo}
*/
this.info = new ClientInfo(this, await page.evaluate(() => {
return { ...window.WPP.whatsapp.Conn.serialize(), wid: window.WPP.whatsapp.UserPrefs.getMeUser() };
const pushname = window.WPP.whatsapp.Conn.pushname

Check failure on line 433 in src/Client.js

View workflow job for this annotation

GitHub Actions / ESLint

Missing semicolon
const platform = window.WPP.whatsapp.Conn.platform

Check failure on line 434 in src/Client.js

View workflow job for this annotation

GitHub Actions / ESLint

Missing semicolon
return { pushname, platform, wid: window.WPP.whatsapp.UserPrefs.getMeUser() };
}));

// Add InterfaceController
Expand Down
12 changes: 0 additions & 12 deletions src/Structures/ClientInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,6 @@ class ClientInfo extends Base {
*/
this.me = data.wid;

/**
* Information about the phone this client is connected to. Not available in multi-device.
* @type {object}
* @property {string} wa_version WhatsApp Version running on the phone
* @property {string} os_version OS Version running on the phone (iOS or Android version)
* @property {string} device_manufacturer Device manufacturer
* @property {string} device_model Device model
* @property {string} os_build_number OS build number
* @deprecated
*/
this.phone = data.phone;

/**
* Platform WhatsApp is running on
* @type {string}
Expand Down

0 comments on commit 6b766d9

Please sign in to comment.