diff --git a/index.d.ts b/index.d.ts index d9ffc8c..d26755b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -666,6 +666,8 @@ declare namespace WAWebJS { isGroup: boolean, /** Indicates if the Chat is readonly */ isReadOnly: boolean, + /** Indicates if the Chat is muted */ + isMuted: boolean, /** Title of the chat */ name: string, /** Unix timestamp for when the last activity occurred */ diff --git a/src/structures/Chat.js b/src/structures/Chat.js index 214c43e..8a451db 100644 --- a/src/structures/Chat.js +++ b/src/structures/Chat.js @@ -57,6 +57,12 @@ class Chat extends Base { */ this.archived = data.archive; + /** + * Indicates if the chat is muted or not + * @type {number} + */ + this.isMuted = data.isMuted; + /** * Unix timestamp for when the mute expires * @type {number} diff --git a/src/util/Injected.js b/src/util/Injected.js index 9a2ed1b..bcff32c 100644 --- a/src/util/Injected.js +++ b/src/util/Injected.js @@ -170,6 +170,7 @@ exports.LoadUtils = () => { let res = chat.serialize(); res.isGroup = chat.isGroup; res.formattedTitle = chat.formattedTitle; + res.isMuted = chat.mute && chat.mute.isMuted; if (chat.groupMetadata) { await window.Store.GroupMetadata.update(chat.id._serialized);