Skip to main content

Mute Chatroom

Muting a chatroom in LikeMinds Flutter Chat SDK ensures that you won't receive any notifications for new posts within that chatroom. This feature allows you to customize your notification preferences and avoid interruptions when you don't wish to be notified of new messages.

Steps to Mute a Chatroom

  1. Create an object of the MuteChatroomRequest class.
  2. Call the muteChatroom() function using the instance of the LMChatClient class.
  3. Process the response LMResponse<void> as per your requirement.

Example Usage

MuteChatroomRequest request = (MuteChatroomRequestBuilder()
..chatroomId("ENTER_CHATROOM_ID")
..value(true)) // Set to false for unmute the chatroom
.build();

LMResponse<void> response = await lmChatClient.muteChatroom(request);

if (response.success) {
// your function to handle successful muting
handleMuteSuccess();
} else {
// your function to handle mute error
handleMuteError(response.errorMessage);
}

Models

MuteChatroomRequest

List of parameters for the MuteChatroomRequest class

VariableTypeDescriptionOptional
chatroomIdintUnique ID of the chatroom
valueboolSet to true to mute, false to unmute