fetchMuteListFromServer method
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 ChatError.
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 platform_interface.Client.instance.groupManager
.callNativeMethod(ChatMethodKeys.getGroupMuteListFromServer, req);
ChatError.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;
}
}