fetchMuteListFromServer method
~english Gets the group mute list from the server. Only the group owner and admins can call this method.
Param groupId The group ID.
Param pageNum The page number.
Param pageSize The number of results per page.
Returns The group mute list map.
Throws Exception description, see EMError. ~end
~chinese 获取群组禁言列表。 仅群主和管理员有权限调用。
Param groupId 群组 ID。
Param pageNum 获取第几页。
Param pageSize 每页获取的数量。
Return 群组禁言列表 Map。
Throws 如果有异常会在这里抛出,包含错误码和错误描述,详见 EMError. ~end
Implementation
Future<Map<String, int>> fetchMuteListFromServer(
String groupId, {
int pageSize = 200,
int pageNum = 1,
}) async {
try {
Map req = {'groupId': groupId, 'pageNum': pageNum, 'pageSize': pageSize};
Map result = await Client.instance.groupManager
.callNativeMethod(ChatMethodKeys.getGroupMuteListFromServer, req);
EMError.hasErrorFromResult(result);
Map? tmpMap = result[ChatMethodKeys.getGroupMuteListFromServer];
Map<String, int> ret = {};
if (tmpMap != null) {
for (var item in tmpMap.entries) {
if (item.key is String && item.value is int) {
ret[item.key] = item.value;
}
}
}
return ret;
} catch (e) {
rethrow;
}
}