7#ifndef _NIM_SDK_CPP_MSGLOG_HELPER_H_
8#define _NIM_SDK_CPP_MSGLOG_HELPER_H_
34 std::string ToJsonString()
const {
36 for (
auto& it : msglogs_) {
46 std::string session_id_;
47 std::string client_id_;
53 std::list<DeleteMsglogSelfNotifyItemInfo>
item_list;
80 int size = values.
size();
81 for (
int i = 0; i < size; i++) {
86 results_.push_back(changed);
96 ExportBackupToRemotePackageCallback = [](
const std::string& file_path,
void* user_data) {
99 ExportBackupToRemoteEncryptCallback = [](
const std::string& file_path,
const std::string& encrypt_key,
void* user_data) {
102 ExportBackupToRemoteLogFiter = [](
const IMMessage& msg,
void* user_data) {
108 delete CastToCPP(user_data);
113 void SetEncryptKey(
const std::string& encrypt_key) { encrypt_key_ = encrypt_key; }
114 std::string GetEncryptKey()
const {
return encrypt_key_; }
119 temp->SetUserData(GetUserData());
120 temp->cloned_ =
true;
121 return temp->ToCStruct_i();
149 std::function<bool(
const IMMessage& msg,
void* user_data)> ExportBackupToRemoteLogFiter;
165 std::string encrypt_key_;
166 void* src_user_data_;
174 ImportBackupFromRemoteUnPackageCallback = [](
const std::string& file_path,
void* user_data) {
177 ImportBackupFromRemoteDecryptCallback = [](
const std::string& file_path,
const std::string& encrypt_key,
void* user_data) {
183 delete CastToCPP(user_data);
192 temp->SetUserData(GetUserData());
193 temp->cloned_ =
true;
194 return temp->ToCStruct_i();
234 void* src_user_data_;
导出消息记录到云端参数定义
Definition: nim_msglog_helper.h:92
std::function< std::string(const std::string &file_path, const std::string &encrypt_key, void *user_data)> ExportBackupToRemoteEncryptCallback
Definition: nim_msglog_helper.h:142
std::function< void(LogsBackupRemoteOperate op, float progress, void *user_data)> LogsBackupProgressCallback
Definition: nim_msglog_helper.h:156
std::function< std::string(const std::string &file_path, void *user_data)> ExportBackupToRemotePackageCallback
Definition: nim_msglog_helper.h:134
std::function< void(LogsBackupRemoteOperate op, LogsBackupRemoteState state, void *user_data)> LogsBackupCompleteCallback
Definition: nim_msglog_helper.h:163
从云端导入消息记录参数定义
Definition: nim_msglog_helper.h:171
std::function< void(LogsBackupRemoteOperate, float, void *user_data)> LogsBackupProgressCallback
Definition: nim_msglog_helper.h:223
std::function< std::string(const std::string &file_path, void *user_data)> ImportBackupFromRemoteUnPackageCallback
Definition: nim_msglog_helper.h:207
std::function< void(LogsBackupRemoteOperate, LogsBackupRemoteState, void *user_data)> LogsBackupCompleteCallback
Definition: nim_msglog_helper.h:231
std::function< std::string(const std::string &file_path, const std::string &encrypt_key, void *user_data)> ImportBackupFromRemoteDecryptCallback
Definition: nim_msglog_helper.h:215
Represents a JSON value.
Definition: value.h:196
Value & append(const Value &value)
Append value to array at the end.
Definition: json_value.cpp:1142
String asString() const
Embedded zeroes are possible.
Definition: json_value.cpp:632
ArrayIndex size() const
Number of values in array or object.
Definition: json_value.cpp:885
bool ParseJsonValue(const std::string &content, nim_cpp_wrapper_util::Json::Value &values)
解析JsonString
Definition: nim_json_util.cpp:70
bool ParseMsglogs(const std::string &msgs_json, QueryMsglogResult &res)
解析查询到的消息历史结果
Definition: nim_msglog_helper.cpp:11
std::string GetJsonStringWithNoStyled(const nim_cpp_wrapper_util::Json::Value &values)
获得非格式化的Json string,传入SDK的json string格式要求为非格式化的,如果是格式化的json string可能会影响功能
Definition: nim_json_util.cpp:89
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
LogsBackupRemoteOperate
Definition: nim_msglog_def.h:445
NIMMsgLogStatus
Definition: nim_msglog_def.h:312
NIMMsglogQuerySource
Definition: nim_msglog_def.h:261
@ kNIMMsglogQuerySourceLocal
本地查询
Definition: nim_msglog_def.h:263
static const char * kNIMMsglogStatusChangedKeyMsgTimetag
临界的消息的时间戳
Definition: nim_msglog_def.h:238
static const char * kNIMMsglogStatusChangedKeyStatus
变更后的状态
Definition: nim_msglog_def.h:240
LogsBackupRemoteState
Definition: nim_msglog_def.h:452
@ LogsBackupRemoteState_FinalState_Begin
是否已是最终状态的一个标识,可以判断state是否为终态(state >= LogsBackupRemoteState_FinalState_Begin)
Definition: nim_msglog_def.h:491
static const char * kNIMMsglogStatusChangedKeyTalkID
会话ID
Definition: nim_msglog_def.h:236
导出消息记录到云端参数定义
Definition: nim_msglog_def.h:498
void * user_data_
APP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Definition: nim_msglog_def.h:540
从云端导入消息记录参数定义
Definition: nim_msglog_def.h:543
void * user_data_
APP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Definition: nim_msglog_def.h:577
单向删除消息记录回调参数
Definition: nim_msglog_helper.h:45
单向删除消息记录回调参数
Definition: nim_msglog_helper.h:51
std::list< DeleteMsglogSelfNotifyItemInfo > item_list
被删除的消息基本信息
Definition: nim_msglog_helper.h:53
Definition: nim_talk_helper.h:281
发送消息已读回执
Definition: nim_msglog_helper.h:57
NIMMsgLogStatus status_
变更后的状态
Definition: nim_msglog_helper.h:59
int64_t msg_timetag_
临界的消息的时间戳
Definition: nim_msglog_helper.h:63
std::string talk_id_
会话ID
Definition: nim_msglog_helper.h:61
发送消息已读回执
Definition: nim_msglog_helper.h:70
NIMResCode rescode_
错误码
Definition: nim_msglog_helper.h:72
std::list< MessageStatusChanged > results_
结果
Definition: nim_msglog_helper.h:74
查询到消息历史结果
Definition: nim_msglog_helper.h:22
int count_
消息历史数
Definition: nim_msglog_helper.h:24
std::list< IMMessage > msglogs_
消息历史
Definition: nim_msglog_helper.h:28
NIMMsglogQuerySource source_
消息历史查询来源
Definition: nim_msglog_helper.h:26
QueryMsglogResult()
Definition: nim_msglog_helper.h:31