mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-20 20:49:14 +00:00
fix: address removal of Conn.me
This change on WhatsApp Web v2.2045.15 caused errors when sending messages and getting the current user id
This commit is contained in:
7
index.d.ts
vendored
7
index.d.ts
vendored
@@ -203,8 +203,13 @@ declare namespace WAWebJS {
|
|||||||
|
|
||||||
/** Current connection information */
|
/** Current connection information */
|
||||||
export interface ClientInfo {
|
export interface ClientInfo {
|
||||||
/** Current user ID */
|
/**
|
||||||
|
* Current user ID
|
||||||
|
* @deprecated Use .wid instead
|
||||||
|
*/
|
||||||
me: ContactId
|
me: ContactId
|
||||||
|
/** Current user ID */
|
||||||
|
wid: ContactId
|
||||||
/** Information about the phone this client is connected to */
|
/** Information about the phone this client is connected to */
|
||||||
phone: ClientInfoPhone
|
phone: ClientInfoPhone
|
||||||
/** Platform the phone is running on */
|
/** Platform the phone is running on */
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class ClientInfo extends Base {
|
|||||||
constructor(client, data) {
|
constructor(client, data) {
|
||||||
super(client);
|
super(client);
|
||||||
|
|
||||||
if(data) this._patch(data);
|
if (data) this._patch(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
_patch(data) {
|
_patch(data) {
|
||||||
@@ -20,11 +20,17 @@ class ClientInfo extends Base {
|
|||||||
*/
|
*/
|
||||||
this.pushname = data.pushname;
|
this.pushname = data.pushname;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {object}
|
||||||
|
* @deprecated Use .wid instead
|
||||||
|
*/
|
||||||
|
this.me = data.wid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Current user ID
|
* Current user ID
|
||||||
* @type {object}
|
* @type {object}
|
||||||
*/
|
*/
|
||||||
this.me = data.me;
|
this.wid = data.wid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Information about the phone this client is connected to
|
* Information about the phone this client is connected to
|
||||||
|
|||||||
@@ -126,8 +126,8 @@ exports.LoadUtils = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const newMsgId = new window.Store.MsgKey({
|
const newMsgId = new window.Store.MsgKey({
|
||||||
from: window.Store.Conn.me,
|
fromMe: true,
|
||||||
to: chat.id,
|
remote: chat.id,
|
||||||
id: window.Store.genId(),
|
id: window.Store.genId(),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -136,7 +136,7 @@ exports.LoadUtils = () => {
|
|||||||
id: newMsgId,
|
id: newMsgId,
|
||||||
ack: 0,
|
ack: 0,
|
||||||
body: content,
|
body: content,
|
||||||
from: window.Store.Conn.me,
|
from: window.Store.Conn.wid,
|
||||||
to: chat.id,
|
to: chat.id,
|
||||||
local: true,
|
local: true,
|
||||||
self: 'out',
|
self: 'out',
|
||||||
|
|||||||
Reference in New Issue
Block a user