Skip to main content

Mute/Unmute Chatroom

Mutes or unmutes notifications for a specific chatroom. This function allows users to toggle the mute status of a chatroom.

Steps to mute or unmute a chatroom

  1. Create a MuteChatroomRequest object using the builder pattern.
  2. Call the muteChatroom() function using the instance of LMChatClient, passing the request object and an optional response handler.
  3. Process the response LMResponse<NoData> to confirm whether the operation was successful or handle any errors.
let request = MuteChatroomRequest.builder()
.chatroomId("ENTER_CHATROOM_ID")
.value(true) // true to mute, false to unmute
.build()

LMChatClient.shared.muteChatroom(request: request) { response in
if response?.error == nil {
// Handle success
print("Chatroom mute status updated successfully.")
} else {
// Handle error
print("Error updating chatroom mute status: \(response?.error?.localizedDescription ?? "Unknown error")")
}
}

Models

MuteChatroomRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
chatroomIdStringID of the chatroom to be muted or unmuted
valueBoolSet to true to mute the chatroom, false to unmute