diff --git a/src/client.js b/src/client.js index acf5331fb..99bde3878 100644 --- a/src/client.js +++ b/src/client.js @@ -1164,13 +1164,17 @@ export class StreamChat { /** muteUser - mutes a user * * @param targetID - * @param [userID] Only used with serverside auth + * @param options * @returns {Promise<*>} */ - async muteUser(targetID, userID = null) { + async muteUser(targetID, options) { + // WARNING: this is a backwards incompatible change + const userID = options ? options.userID : undefined; + const timeout = options ? options.timeout : undefined; return await this.post(this.baseURL + '/moderation/mute', { target_id: targetID, ...(userID ? { user_id: userID } : {}), + ...(timeout ? { timeout } : {}), }); } diff --git a/types/stream-chat/index.d.ts b/types/stream-chat/index.d.ts index bf543ad8d..27a874392 100644 --- a/types/stream-chat/index.d.ts +++ b/types/stream-chat/index.d.ts @@ -295,7 +295,7 @@ export class StreamChat { banUser(targetUserID: string, options: object): Promise; unbanUser(targetUserID: string, options: object): Promise; - muteUser(targetUserID: string): Promise; + muteUser(targetUserID: string, options?: object): Promise; unmuteUser(targetUserID: string): Promise; flagUser(userID: string, options?: object): Promise;