fetchChatRoomMuteList method

Future<List<String>> fetchChatRoomMuteList(
  1. String roomId, {
  2. int pageNum = 1,
  3. int pageSize = 200,
})

~english Gets the list of members who are muted in the chat room from the server.

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

Param roomId The chat room ID.

Param pageNum The page number, starting from 1.

Param pageSize The number of muted members per page.

Return The muted member list.

Throws A description of the exception. See EMError. ~end

~chinese 获取聊天室禁言列表。

仅聊天室所有者和管理员可调用此方法。

Param roomId 聊天室 ID。

Param pageNum 当前页码,从 1 开始。

Param pageSize 每页返回的禁言成员数。

Return 返回的包含禁言成员 ID 列表。

Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError。 ~end

Implementation

Future<List<String>> fetchChatRoomMuteList(
  String roomId, {
  int pageNum = 1,
  int pageSize = 200,
}) async {
  Map req = {"roomId": roomId, "pageNum": pageNum, "pageSize": pageSize};
  Map result =
      await _channel.invokeMethod(ChatMethodKeys.fetchChatRoomMuteList, req);
  try {
    EMError.hasErrorFromResult(result);
    return result[ChatMethodKeys.fetchChatRoomMuteList]?.cast<String>() ?? [];
  } on EMError catch (e) {
    throw e;
  }
}