Skip to content

Commit

Permalink
feat: boolean for indicating Status update messages (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroslopez committed Oct 26, 2020
1 parent 20e07c4 commit 42dd866
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,8 @@ declare namespace WAWebJS {
body: string,
/** Indicates if the message was a broadcast */
broadcast: boolean,
/** Indicates if the message was a status update */
isStatus: 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 */
Expand Down
6 changes: 6 additions & 0 deletions src/structures/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ class Message extends Base {
*/
this.isForwarded = data.isForwarded;

/**
* Indicates if the message is a status update
* @type {boolean}
*/
this.isStatus = data.isStatusV3;

/**
* Indicates if the message was a broadcast
* @type {boolean}
Expand Down
2 changes: 2 additions & 0 deletions src/util/Injected.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ exports.LoadUtils = () => {

window.WWebJS.getMessageModel = message => {
const msg = message.serialize();
msg.isStatusV3 = message.isStatusV3;

delete msg.pendingAckUpdate;
return msg;
};
Expand Down

0 comments on commit 42dd866

Please sign in to comment.