mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-20 20:49:14 +00:00
feat: indicate if chat is currently muted
This commit is contained in:
2
index.d.ts
vendored
2
index.d.ts
vendored
@@ -666,6 +666,8 @@ declare namespace WAWebJS {
|
|||||||
isGroup: boolean,
|
isGroup: boolean,
|
||||||
/** Indicates if the Chat is readonly */
|
/** Indicates if the Chat is readonly */
|
||||||
isReadOnly: boolean,
|
isReadOnly: boolean,
|
||||||
|
/** Indicates if the Chat is muted */
|
||||||
|
isMuted: boolean,
|
||||||
/** Title of the chat */
|
/** Title of the chat */
|
||||||
name: string,
|
name: string,
|
||||||
/** Unix timestamp for when the last activity occurred */
|
/** Unix timestamp for when the last activity occurred */
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ class Chat extends Base {
|
|||||||
*/
|
*/
|
||||||
this.archived = data.archive;
|
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
|
* Unix timestamp for when the mute expires
|
||||||
* @type {number}
|
* @type {number}
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ exports.LoadUtils = () => {
|
|||||||
let res = chat.serialize();
|
let res = chat.serialize();
|
||||||
res.isGroup = chat.isGroup;
|
res.isGroup = chat.isGroup;
|
||||||
res.formattedTitle = chat.formattedTitle;
|
res.formattedTitle = chat.formattedTitle;
|
||||||
|
res.isMuted = chat.mute && chat.mute.isMuted;
|
||||||
|
|
||||||
if (chat.groupMetadata) {
|
if (chat.groupMetadata) {
|
||||||
await window.Store.GroupMetadata.update(chat.id._serialized);
|
await window.Store.GroupMetadata.update(chat.id._serialized);
|
||||||
|
|||||||
Reference in New Issue
Block a user