getSessionList static method
查询会话列表,支持传入Comparator对会话列表进行排序
Implementation
static Future<List<ConversationInfo>?> getSessionList(
Comparator<ConversationInfo> comparator) async {
final _result = await NimCore.instance.messageService.querySessionList();
if (_result.isSuccess) {
List<ConversationInfo>? conversationList =
await fillSessionInfo(_result.data);
Alog.i(
tag: 'ConversationKit',
moduleName: 'ConversationRepo',
content: 'getSessionList size:${conversationList?.length}');
conversationList = _filterSession(conversationList);
conversationList?.sort(comparator);
return conversationList;
}
return null;
}