getHistoryMessage static method
获取历史消息
Implementation
static Future<NIMResult<List<ChatMessage>>> getHistoryMessage(
NIMMessage anchor, QueryDirection direction, int limit,
{bool enablePin = true}) async {
var msgRes = await NimCore.instance.messageService
.queryMessageListEx(anchor, direction, limit);
if (msgRes.isSuccess && msgRes.data != null) {
List<ChatMessage> result = await fillUserInfo(msgRes.data!);
if (enablePin) {
result = _fillPin(anchor.sessionId!, anchor.sessionType!, result);
}
return NIMResult(msgRes.code, result, msgRes.errorDetails);
} else {
return NIMResult(msgRes.code, null, msgRes.errorDetails);
}
}