public static void QueryMsglogLocally(QueryMsglogParams args, QueryMsglogResultDelegate action) { var x = new { direction = args.Direction, reverse = args.Reverse, endtime = args.EndTimetag }; var json_ext = JsonParser.Serialize(x); var ptr = DelegateConverter.ConvertToIntPtr(action); MsglogNativeMethods.nim_msglog_query_msg_async(args.AccountId, args.SessionType, args.CountLimit, args.MsgAnchorTimttag, json_ext, QueryLogCompleted, ptr); }
/// <summary> /// 查询本地消息(按时间逆序起查,逆序排列) /// </summary> /// <param name="accountId">会话id,对方的account id或者群组tid</param> /// <param name="sType">会话类型</param> /// <param name="limit">一次查询数量,建议20</param> /// <param name="lastTimetag">上次查询最后一条消息的时间戳(按时间逆序起查,即最小的时间戳)</param> /// <param name="action"></param> public static void QueryMsglogLocally(string accountId, Session.NIMSessionType sType, int limit, long lastTimetag, QueryMsglogResultDelegate action) { var ptr = NimUtility.DelegateConverter.ConvertToIntPtr(action); MsglogNativeMethods.nim_msglog_query_msg_async(accountId, sType, limit, lastTimetag, null, QueryLogCompleted, ptr); }