muteChatRoomMembers method

Future<void> muteChatRoomMembers(
  1. String roomId,
  2. List<String> muteMembers,
  3. {int duration = -1}
)

Mutes the specified members in a chat room.

Only the chat room owner or admin can call this method.

Param roomId The chat room ID.

Param muteMembers The list of members to be muted.

Param duration The mute duration in milliseconds.

Throws A description of the exception. See ChatError.

Implementation

Future<void> muteChatRoomMembers(
  String roomId,
  List<String> muteMembers, {
  int duration = -1,
}) async {
  Map req = {
    "roomId": roomId,
    "muteMembers": muteMembers,
    "duration": duration
  };
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.muteChatRoomMembers, req);
  try {
    ChatError.hasErrorFromResult(result);
  } on ChatError catch (e) {
    throw e;
  }
}