7#ifndef _NIM_SDK_CPP_MSGLOG_HELPER_H_
8#define _NIM_SDK_CPP_MSGLOG_HELPER_H_
36 for (
auto& it : msglogs_) {
67 std::list<DeleteMsglogSelfNotifyItemInfo>
item_list;
94 int size = values.
size();
95 for (
int i = 0; i < size; i++) {
100 results_.push_back(changed);
110 ExportBackupToRemotePackageCallback = [](
const std::string& file_path,
void* user_data) {
113 ExportBackupToRemoteEncryptCallback = [](
const std::string& file_path,
const std::string& encrypt_key,
void* user_data) {
116 ExportBackupToRemoteLogFiter = [](
const IMMessage& msg,
void* user_data) {
121 if (state >= LogsBackupRemoteState::LogsBackupRemoteState_FinalState_Begin)
122 delete CastToCPP(user_data);
127 void SetEncryptKey(
const std::string& encrypt_key) { encrypt_key_ = encrypt_key; }
188 ImportBackupFromRemoteUnPackageCallback = [](
const std::string& file_path,
void* user_data) {
191 ImportBackupFromRemoteDecryptCallback = [](
const std::string& file_path,
const std::string& encrypt_key,
void* user_data) {
196 if (state >= LogsBackupRemoteState::LogsBackupRemoteState_FinalState_Begin)
197 delete CastToCPP(user_data);
导出消息记录到云端参数定义
Definition: nim_msglog_helper.h:106
std::function< bool(const IMMessage &msg, void *user_data)> ExportBackupToRemoteLogFiter
Definition: nim_msglog_helper.h:163
void * src_user_data_
Definition: nim_msglog_helper.h:180
NIMLogsBackupExportInfo * ToCStruct() const
Definition: nim_msglog_helper.h:131
void SetEncryptKey(const std::string &encrypt_key)
Definition: nim_msglog_helper.h:127
std::function< std::string(const std::string &file_path, const std::string &encrypt_key, void *user_data)> ExportBackupToRemoteEncryptCallback
Definition: nim_msglog_helper.h:156
std::function< void(LogsBackupRemoteOperate op, float progress, void *user_data)> LogsBackupProgressCallback
Definition: nim_msglog_helper.h:170
std::function< std::string(const std::string &file_path, void *user_data)> ExportBackupToRemotePackageCallback
Definition: nim_msglog_helper.h:148
std::string GetEncryptKey() const
Definition: nim_msglog_helper.h:128
std::string encrypt_key_
Definition: nim_msglog_helper.h:179
void * GetUserData() const
Definition: nim_msglog_helper.h:130
bool cloned_
Definition: nim_msglog_helper.h:181
std::function< void(LogsBackupRemoteOperate op, LogsBackupRemoteState state, void *user_data)> LogsBackupCompleteCallback
Definition: nim_msglog_helper.h:177
static LogsBackupExportInfo * CastToCPP(void *data)
Definition: nim_msglog_helper.h:139
LogsBackupExportInfo()
Definition: nim_msglog_helper.h:108
NIMLogsBackupExportInfo * ToCStruct_i()
Definition: nim_msglog_helper.cpp:27
void SetUserData(void *user_data)
Definition: nim_msglog_helper.h:129
从云端导入消息记录参数定义
Definition: nim_msglog_helper.h:185
LogsBackupImportInfo()
Definition: nim_msglog_helper.h:187
void SetUserData(void *user_data)
Definition: nim_msglog_helper.h:202
std::function< void(LogsBackupRemoteOperate, float, void *user_data)> LogsBackupProgressCallback
Definition: nim_msglog_helper.h:237
NIMLogsBackupImportInfo * ToCStruct() const
Definition: nim_msglog_helper.h:204
std::function< std::string(const std::string &file_path, void *user_data)> ImportBackupFromRemoteUnPackageCallback
Definition: nim_msglog_helper.h:221
void * GetUserData() const
Definition: nim_msglog_helper.h:203
static LogsBackupImportInfo * CastToCPP(void *data)
Definition: nim_msglog_helper.h:213
bool cloned_
Definition: nim_msglog_helper.h:247
void * src_user_data_
Definition: nim_msglog_helper.h:248
std::function< void(LogsBackupRemoteOperate, LogsBackupRemoteState, void *user_data)> LogsBackupCompleteCallback
Definition: nim_msglog_helper.h:245
std::function< std::string(const std::string &file_path, const std::string &encrypt_key, void *user_data)> ImportBackupFromRemoteDecryptCallback
Definition: nim_msglog_helper.h:229
NIMLogsBackupImportInfo * ToCStruct_i()
Definition: nim_msglog_helper.cpp:70
Represents a JSON value.
Definition: value.h:196
bool isArray() const
Definition: json_value.cpp:1386
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
LogsBackupRemoteOperate
Definition: nim_msglog_def.h:476
NIMMsgLogStatus
Definition: nim_msglog_def.h:343
NIMMsglogQuerySource
Definition: nim_msglog_def.h:293
@ kNIMMsglogQuerySourceLocal
本地查询
Definition: nim_msglog_def.h:295
static const char * kNIMMsglogStatusChangedKeyMsgTimetag
临界的消息的时间戳
Definition: nim_msglog_def.h:267
static const char * kNIMMsglogStatusChangedKeyStatus
变更后的状态
Definition: nim_msglog_def.h:269
LogsBackupRemoteState
Definition: nim_msglog_def.h:483
static const char * kNIMMsglogStatusChangedKeyTalkID
会话ID
Definition: nim_msglog_def.h:265
#define NIM_SDK_CPPWRAPPER_DLL_API
Definition: nim_sdk_cpp_wrapper.h:38
NIMSessionType
Definition: nim_session_def.h:16
@ kNIMSessionTypeP2P
个人,即点对点
Definition: nim_session_def.h:18
NIMResCode
Definition: public_defines.h:21
@ kNIMResSuccess
没有错误,一切正常
Definition: public_defines.h:26
#define false
Definition: stdbool.h:33
unsigned char bool
Definition: stdbool.h:25
导出消息记录到云端参数定义
Definition: nim_msglog_def.h:539
void * user_data_
APP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Definition: nim_msglog_def.h:581
从云端导入消息记录参数定义
Definition: nim_msglog_def.h:584
void * user_data_
APP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Definition: nim_msglog_def.h:618
单向删除消息记录回调参数
Definition: nim_msglog_helper.h:59
std::string session_id_
Definition: nim_msglog_helper.h:60
std::string client_id_
Definition: nim_msglog_helper.h:61
std::string ext_
Definition: nim_msglog_helper.h:62
单向删除消息记录回调参数
Definition: nim_msglog_helper.h:65
std::list< DeleteMsglogSelfNotifyItemInfo > item_list
被删除的消息基本信息
Definition: nim_msglog_helper.h:67
Definition: nim_msglog_helper.h:44
std::string session_id
会话ID
Definition: nim_msglog_helper.h:48
std::vector< IMMessage > messages
历史消息列表
Definition: nim_msglog_helper.h:54
GetMessagesResult()=default
Definition: nim_talk_helper.h:339
发送消息已读回执
Definition: nim_msglog_helper.h:71
NIMMsgLogStatus status_
变更后的状态
Definition: nim_msglog_helper.h:73
MessageStatusChanged()
Definition: nim_msglog_helper.h:79
int64_t msg_timetag_
临界的消息的时间戳
Definition: nim_msglog_helper.h:77
std::string talk_id_
会话ID
Definition: nim_msglog_helper.h:75
发送消息已读回执
Definition: nim_msglog_helper.h:84
NIMResCode rescode_
错误码
Definition: nim_msglog_helper.h:86
MessageStatusChangedResult(int rescode, std::string &result)
Definition: nim_msglog_helper.h:90
std::list< MessageStatusChanged > results_
结果
Definition: nim_msglog_helper.h:88
查询到消息历史结果
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
std::string ToJsonString() const
Definition: nim_msglog_helper.h:34