NIM PC Cross Platform SDK
载入中...
搜索中...
未找到
nim_msglog.h 文件参考

消息历史 接口头文件 更多...

#include "nim_msglog_def.h"

浏览源代码.

函数

NIM_SDK_DLL_API void nim_msglog_register_delete_msgs_self_callback (const nim_msglog_delete_message_self_notify_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_register_delete_history_messages_callback (const nim_msglog_delete_history_online_notify_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_msg_by_id_async (const char *client_msg_id, const char *json_extension, nim_msglog_query_single_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_msg_async (const char *account_id, enum NIMSessionType to_type, int limit_count, int64_t anchor_msg_time, const char *json_extension, nim_msglog_query_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_get_messages_dynamically (const char *session_id, enum NIMSessionType to_type, uint64_t from_time, uint64_t to_time, int limit_count, const char *anchor_client_msg_id, uint64_t anchor_server_msg_id, NIMMsglogSearchDirection direction, const char *json_extension, nim_msglog_query_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_msg_online_async (const char *id, enum NIMSessionType to_type, int limit_count, int64_t from_time, int64_t end_time, int64_t end_msg_id, bool reverse, bool need_save_to_local, const char *json_extension, nim_msglog_query_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_msg_online_async2 (const char *id, NIMQueryMsgOnlineAsyncParam query_param, nim_msglog_query_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_msg_by_keyword_online_async (const char *id, const char *keyword, NIMQueryMsgByKeywordOnlineAsyncParam query_param, nim_msglog_query_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_the_message_of_the_specified_type_async (enum NIMSessionType to_type, const char *id, int limit_count, int64_t from_time, int64_t end_time, const char *end_client_msg_id, bool reverse, const char *msg_types, const char *json_extension, nim_msglog_query_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_msg_by_options_async (enum NIMMsgLogQueryRange query_range, const char *ids, int limit_count, int64_t from_time, int64_t end_time, const char *end_client_msg_id, bool reverse, enum NIMMessageType msg_type, const char *search_content, const char *json_extension, nim_msglog_query_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_msg_by_options_async_ex (const char *json_param, nim_msglog_query_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_full_text_search_online_async (const char *keyword, uint64_t from_time, uint64_t to_time, uint32_t session_limit, uint32_t msg_limit, uint32_t search_rule, const char *p2p_filter_list, const char *team_filter_list, const char *sender_filter_list, const char *msg_type_filter_list, const char *msg_sub_type_filter_list, nim_msglog_full_text_search_online_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_batch_status_read_async (const char *account_id, enum NIMSessionType to_type, const char *json_extension, nim_msglog_res_ex_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_set_status_async (const char *msg_id, enum NIMMsgLogStatus msglog_status, const char *json_extension, nim_msglog_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_set_sub_status_async (const char *msg_id, enum NIMMsgLogSubStatus msglog_sub_status, const char *json_extension, nim_msglog_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_insert_msglog_async (const char *talk_id, const char *json_msg, bool need_update_session, const char *json_extension, nim_msglog_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_batch_status_delete_async (const char *account_id, enum NIMSessionType to_type, const char *json_extension, nim_msglog_res_ex_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_batch_status_delete_async_ex (const char *account_id, enum NIMSessionType to_type, bool revert_by_query_online, const char *json_extension, nim_msglog_res_ex_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_by_session_type_async (bool delete_sessions, enum NIMSessionType to_type, const char *json_extension, nim_msglog_res_ex_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_by_session_type_async_ex (bool delete_sessions, enum NIMSessionType to_type, bool revert_by_query_online, const char *json_extension, nim_msglog_res_ex_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_async (const char *account_id, enum NIMSessionType to_type, const char *msg_id, const char *json_extension, nim_msglog_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_all_async (bool delete_sessions, const char *json_extension, nim_msglog_modify_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_all_async_ex (bool delete_sessions, bool revert_by_query_online, const char *json_extension, nim_msglog_modify_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_by_time_async (const char *account_id, enum NIMSessionType to_type, uint64_t timestamp1, uint64_t timestamp2, const char *json_extension, nim_msglog_modify_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_by_time_async_ex (const char *account_id, enum NIMSessionType to_type, bool revert_by_query_online, uint64_t timestamp1, uint64_t timestamp2, const char *json_extension, nim_msglog_modify_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_export_db_async (const char *dst_path, const char *json_extension, nim_msglog_modify_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_import_db_async (const char *src_path, const char *json_extension, nim_msglog_modify_res_cb_func res_cb, const void *res_user_data, nim_msglog_import_prg_cb_func prg_cb, const void *prg_user_data)
 
NIM_SDK_DLL_API void nim_msglog_send_receipt_async (const char *json_msg, const char *json_extension, nim_msglog_status_changed_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API bool nim_msglog_query_be_readed (const char *json_msg, const char *json_extension)
 
NIM_SDK_DLL_API bool nim_msglog_query_receipt_sent (const char *json_msg, const char *json_extension)
 
NIM_SDK_DLL_API void nim_msglog_query_unread_messages (const char *account_id, enum NIMSessionType to_type, const char *json_extension, nim_msglog_query_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_reg_status_changed_cb (const char *json_extension, nim_msglog_status_changed_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_update_localext_async (const char *msg_id, const char *local_ext, const char *json_extension, nim_msglog_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_read_all_async (const char *json_extension, nim_msglog_modify_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API bool nim_export_backup_to_remote (const NIMLogsBackupExportInfo *export_info)
 
NIM_SDK_DLL_API bool nim_import_backup_from_remote (const NIMLogsBackupImportInfo *import_info)
 
NIM_SDK_DLL_API void nim_cancel_import_backup_from_remote ()
 
NIM_SDK_DLL_API void nim_cancel_export_backup_to_remote ()
 
NIM_SDK_DLL_API void nim_msglog_delete_history_online_async (const char *account_id, bool delete_roaming, const char *json_extension, nim_msglog_delete_history_online_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_history_online_async_ex (const char *account_id, enum NIMSessionType to_type, bool notify_self, const char *ext, nim_msglog_delete_history_online_res_cb_func_ex cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_message_self_async (const char *json_msg, const char *ext, const char *json_extension, nim_msglog_delete_message_self_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_delete_messages_self_async (NIMDeleteMessagesSelfParam *param, int param_count, nim_msglog_delete_message_self_res_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_message_is_thread_root_async (const char *msg_client_id, nim_msglog_query_message_is_thread_root_async_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_message_online (const NIMQueryMsgAsyncParam &param, nim_msglog_query_single_cb_func cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_thread_history_msg (const char *json_msg, const NIMQueryThreadHistoryMsgAsyncParam &param, const nim_msglog_query_thread_history_msg_cb_func &cb, const void *user_data)
 
NIM_SDK_DLL_API void nim_msglog_query_local_thread_history_msg (const char *json_msg, const nim_msglog_query_cb_func &cb, const void *user_data)
 

详细描述

消息历史 接口头文件

作者
Oleg
日期
2015/2/1

函数说明

◆ nim_cancel_export_backup_to_remote()

void nim_cancel_export_backup_to_remote ( )

取消导出本地消息记录到云端

返回
void

◆ nim_cancel_import_backup_from_remote()

void nim_cancel_import_backup_from_remote ( )

取消导入已备份在云端的消息记录

返回
void

◆ nim_export_backup_to_remote()

bool nim_export_backup_to_remote ( const NIMLogsBackupExportInfo export_info)

导出本地消息记录到云端

参数
[in]export_info导出需要的参数参考NIMLogsBackupExportInfo定义
返回
bool false : 当前有导入/导出操作正在进行中

◆ nim_import_backup_from_remote()

bool nim_import_backup_from_remote ( const NIMLogsBackupImportInfo import_info)

导入已备份在云端的消息记录

参数
[in]export_info导入需要的参数参考NIMLogsBackupImportInfo定义
返回
bool false : 当前有导入/导出操作正在进行中

◆ nim_msglog_batch_status_delete_async()

void nim_msglog_batch_status_delete_async ( const char *  account_id,
enum NIMSessionType  to_type,
const char *  json_extension,
nim_msglog_res_ex_cb_func  cb,
const void *  user_data 
)

批量删除指定对话的消息。删除成功后,将相应会话项的最后一条消息的状态kNIMSessionMsgStatus设置为已删除状态,并通过nim_session_reg_change_cb注册的回调通知上层相应会话项的kNIMSessionCommandMsgDeleted事件。

参数
[in]account_id会话id,对方的account id或者群组tid
[in]to_type会话类型
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_res_ex_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_batch_status_delete_async_ex()

void nim_msglog_batch_status_delete_async_ex ( const char *  account_id,
enum NIMSessionType  to_type,
bool  revert_by_query_online,
const char *  json_extension,
nim_msglog_res_ex_cb_func  cb,
const void *  user_data 
)

批量删除指定对话的消息。删除成功后,将相应会话项的最后一条消息的状态kNIMSessionMsgStatus设置为已删除状态,并通过nim_session_reg_change_cb注册的回调通知上层相应会话项的kNIMSessionCommandMsgDeleted事件。

参数
[in]account_id会话id,对方的account id或者群组tid
[in]to_type会话类型
[in]revert_by_online_query是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_res_ex_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_batch_status_read_async()

void nim_msglog_batch_status_read_async ( const char *  account_id,
enum NIMSessionType  to_type,
const char *  json_extension,
nim_msglog_res_ex_cb_func  cb,
const void *  user_data 
)

批量设置未读状态为已读消息状态

参数
[in]account_id会话id,对方的account id或者群组tid
[in]to_type会话类型
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_res_ex_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_delete_all_async()

void nim_msglog_delete_all_async ( bool  delete_sessions,
const char *  json_extension,
nim_msglog_modify_res_cb_func  cb,
const void *  user_data 
)

删除全部消息历史

参数
[in]delete_sessions是否删除所有会话列表项(即全部最近联系人)。 ture则删除,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandRemoveAll事件(不会触发每个会话项的kNIMSessionCommandRemove事件); false则不删除,并将所有会话项的最后一条消息的状态kNIMSessionMsgStatus设置为已删除状态,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandAllMsgDeleted事件(不会触发每个会话项的kNIMSessionCommandUpdate事件,避免频繁通知上层)。
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_modify_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_delete_all_async_ex()

void nim_msglog_delete_all_async_ex ( bool  delete_sessions,
bool  revert_by_query_online,
const char *  json_extension,
nim_msglog_modify_res_cb_func  cb,
const void *  user_data 
)

删除全部消息历史

参数
[in]delete_sessions是否删除所有会话列表项(即全部最近联系人)。 ture则删除,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandRemoveAll事件(不会触发每个会话项的kNIMSessionCommandRemove事件); false则不删除,并将所有会话项的最后一条消息的状态kNIMSessionMsgStatus设置为已删除状态,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandAllMsgDeleted事件(不会触发每个会话项的kNIMSessionCommandUpdate事件,避免频繁通知上层)。
[in]revert_by_online_query是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_modify_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_delete_async()

nim_msglog_delete_async ( const char *  account_id,
enum NIMSessionType  to_type,
const char *  msg_id,
const char *  json_extension,
nim_msglog_res_cb_func  cb,
const void *  user_data 
)

删除指定一条消息

参数
[in]account_id会话id,对方的account id或者群组tid
[in]to_type会话类型
[in]msg_id消息id
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_delete_by_session_type_async()

void nim_msglog_delete_by_session_type_async ( bool  delete_sessions,
enum NIMSessionType  to_type,
const char *  json_extension,
nim_msglog_res_ex_cb_func  cb,
const void *  user_data 
)

删除指定会话类型的所有消息

参数
[in]delete_sessions是否删除指定会话类型的所有会话列表项。 ture则删除,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandRemoveAllP2P或kNIMSessionCommandRemoveAllTeam事件(不会触发每个会话项的kNIMSessionCommandRemove事件); false则不删除,并将指定会话类型的所有会话项的最后一条消息的状态kNIMSessionMsgStatus设置为已删除状态,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandAllP2PMsgDeleted或kNIMSessionCommandAllTeamMsgDeleted事件(不会触发每个会话项的kNIMSessionCommandUpdate事件,避免频繁通知上层)。
[in]to_type会话类型
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_res_ex_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_delete_by_session_type_async_ex()

void nim_msglog_delete_by_session_type_async_ex ( bool  delete_sessions,
enum NIMSessionType  to_type,
bool  revert_by_query_online,
const char *  json_extension,
nim_msglog_res_ex_cb_func  cb,
const void *  user_data 
)

删除指定会话类型的所有消息

参数
[in]delete_sessions是否删除指定会话类型的所有会话列表项。 ture则删除,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandRemoveAllP2P或kNIMSessionCommandRemoveAllTeam事件(不会触发每个会话项的kNIMSessionCommandRemove事件); false则不删除,并将指定会话类型的所有会话项的最后一条消息的状态kNIMSessionMsgStatus设置为已删除状态,并通过nim_session_reg_change_cb注册的回调通知上层kNIMSessionCommandAllP2PMsgDeleted或kNIMSessionCommandAllTeamMsgDeleted事件(不会触发每个会话项的kNIMSessionCommandUpdate事件,避免频繁通知上层)。
[in]to_type会话类型
[in]revert_by_online_query是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_res_ex_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_delete_by_time_async()

void nim_msglog_delete_by_time_async ( const char *  account_id,
enum NIMSessionType  to_type,
uint64_t  timestamp1,
uint64_t  timestamp2,
const char *  json_extension,
nim_msglog_modify_res_cb_func  cb,
const void *  user_data 
)

根据时间区间删除指定会话指定类型的本地消息

参数
[in]account_id会话id,对方的account id或者群组tid
[in]to_type会话类型
[in]timestamp1与 timestamp2 组成一个时间段,SDK 内部会判断大小调整入参顺序
[in]timestamp2与 timestamp1 组成一个时间段,SDK 内部会判断大小调整入参顺序
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_modify_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_delete_by_time_async_ex()

void nim_msglog_delete_by_time_async_ex ( const char *  account_id,
enum NIMSessionType  to_type,
bool  revert_by_query_online,
uint64_t  timestamp1,
uint64_t  timestamp2,
const char *  json_extension,
nim_msglog_modify_res_cb_func  cb,
const void *  user_data 
)

根据时间区间删除指定会话指定类型的本地消息

参数
[in]account_id会话id,对方的account id或者群组tid
[in]to_type会话类型
[in]revert_by_online_query是否可以通过服务端查询消息记录(含入库选项)进行恢复,true:是,false:否
[in]timestamp1与 timestamp2 组成一个时间段,SDK 内部会判断大小调整入参顺序
[in]timestamp2与 timestamp1 组成一个时间段,SDK 内部会判断大小调整入参顺序
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_modify_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_delete_history_online_async()

void nim_msglog_delete_history_online_async ( const char *  account_id,
bool  delete_roaming,
const char *  json_extension,
nim_msglog_delete_history_online_res_cb_func  cb,
const void *  user_data 
)

删除与某账号的所有云端历史记录与漫游消息(p2p), 不删除本地消息

参数
[in]account_id对方accid
[in]delete_roaming是否同时删除与该accid的漫游消息
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_delete_history_online_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_delete_history_online_async_ex()

void nim_msglog_delete_history_online_async_ex ( const char *  account_id,
enum NIMSessionType  to_type,
bool  notify_self,
const char *  ext,
nim_msglog_delete_history_online_res_cb_func_ex  cb,
const void *  user_data 
)

删除某一会话的云端的历史记录[v8.0.0], 删除本地消息

参数
[in]account_id进行删除操作时传入的会话id p2p:accid team:tid
[in]type会话的类型
[in]notify_self是否通知其它终端
[in]ext扩展ext字段
[in]cb操作结果的回调函数, nim_msglog_delete_history_online_res_cb_func_ex回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_delete_message_self_async()

void nim_msglog_delete_message_self_async ( const char *  json_msg,
const char *  ext,
const char *  json_extension,
nim_msglog_delete_message_self_res_cb_func  cb,
const void *  user_data 
)

单向删除某条消息记录(同时删除本地与云端)

参数
[in]json_msg要删除的消息
[in]ext用户自定义扩展字段
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_delete_message_self_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_delete_messages_self_async()

void nim_msglog_delete_messages_self_async ( NIMDeleteMessagesSelfParam param,
int  param_count,
nim_msglog_delete_message_self_res_cb_func  cb,
const void *  user_data 
)

单向删除多条消息记录(同时删除本地与云端)

参数
[in]param要删除的消息头指针
[in]param_count要删除的消息条数
[in]cb操作结果的回调函数, nim_msglog_delete_message_self_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_export_db_async()

void nim_msglog_export_db_async ( const char *  dst_path,
const char *  json_extension,
nim_msglog_modify_res_cb_func  cb,
const void *  user_data 
)

导出整个消息历史DB文件(不包括系统消息历史)。直接拷贝DB文件即可,SDK层不返回进度给APP层。

参数
[in]dst_path导出时保存的目标全路径(UTF-8编码)。
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_modify_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_full_text_search_online_async()

void nim_msglog_full_text_search_online_async ( const char *  keyword,
uint64_t  from_time,
uint64_t  to_time,
uint32_t  session_limit,
uint32_t  msg_limit,
uint32_t  search_rule,
const char *  p2p_filter_list,
const char *  team_filter_list,
const char *  sender_filter_list,
const char *  msg_type_filter_list,
const char *  msg_sub_type_filter_list,
nim_msglog_full_text_search_online_cb_func  cb,
const void *  user_data 
)

根据关键字在服务器全文检索

参数
[in]keyword查询的关键字
[in]from_time查询的起始时间
[in]to_time查询的结束时间
[in]session_limit显示会话返回的总数,搜索规则包含kNIMFullTextSearchNoGroupBySession时无效
[in]msg_limit限制消息返回的总数
[in]search_rule检索规则, 例如升序不分组: kNIMFullTextSearchOrderByAsc | kNIMFullTextSearchNoGroupBySession
[in]p2p_filter_list查询结果中对
[in]team_filter_list查询结果中对群组的过滤,一个群组 ID 列表的 Json Array 数组
[in]sender_filter_list查询结果中对发送者的过滤,一个发送者 ID 列表的 Json Array 数组
[in]msg_type_filter_list消息类型过滤,消息类型的 Json Array 数组
[in]msg_sub_type_filter_list消息子类型过滤,消息类型的 Json Array 数组
[in]cb全文检索回调函数, nim_msglog_full_text_search_online_cb_func 回调函数定义见 nim_msglog_def.h
[in]user_dataAPP 的自定义用户数据,SDK 只负责传回给回调函数 cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_get_messages_dynamically()

static void nim_msglog_get_messages_dynamically ( const char *  session_id,
enum NIMSessionType  to_type,
uint64_t  from_time,
uint64_t  to_time,
int  limit_count,
const char *  anchor_client_msg_id,
uint64_t  anchor_server_msg_id,
NIMMsglogSearchDirection  direction,
const char *  json_extension,
nim_msglog_query_cb_func  cb,
const void *  user_data 
)

查询历史消息,基于本地可信时间段信息来动态判断获取消息的途径

参数
[in]session_id会话id
[in]to_type会话类型, 双人0,群组1, 超大群5 (见nim_msglog_def.h)
[in]from_time开始时间, 包含
[in]to_time结束时间, 大于from_time, 0表示当前时间; 只有在direction为kForward且anchor_client_msg_id不为空时才包含
[in]limit_count查询数量
[in]anchor_client_msg_id查询起始的客户端消息id, 查询结果不包括这条消息
[in]anchor_server_msg_id查询起始的服务器消息id, 查询结果不包括这条消息
[in]direction查询方向
[in]cb查询消息的回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
返回
void
注解
错误码 200:成功

◆ nim_msglog_import_db_async()

void nim_msglog_import_db_async ( const char *  src_path,
const char *  json_extension,
nim_msglog_modify_res_cb_func  res_cb,
const void *  res_user_data,
nim_msglog_import_prg_cb_func  prg_cb,
const void *  prg_user_data 
)

导入消息历史DB文件(不包括系统消息历史)。先验证是否自己的消息历史文件和DB加密密钥(见nim_client_def.h里的kNIMDataBaseEncryptKey),如果验证不通过,则不导入。

参数
[in]src_path导入源文件的全路径(UTF-8编码)。
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]res_cb操作结果的回调函数, nim_msglog_modify_res_cb_func回调函数定义见nim_msglog_def.h
[in]res_user_dataAPP的自定义用户数据,SDK只负责传回给回调函数res_cb,不做任何处理!
[in]prg_cb导入进度的回调函数, nim_msglog_import_prg_cb_func回调函数定义见nim_msglog_def.h
[in]prg_user_dataAPP的自定义用户数据,SDK只负责传回给回调函数prg_cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 10600:导入消息历史时验证身份和加密密钥不通过 10601:导入消息历史时写记录失败

◆ nim_msglog_insert_msglog_async()

void nim_msglog_insert_msglog_async ( const char *  talk_id,
const char *  json_msg,
bool  need_update_session,
const char *  json_extension,
nim_msglog_res_cb_func  cb,
const void *  user_data 
)

往本地消息历史数据库里写入一条消息(如果已存在这条消息,则更新。通常是APP的本地自定义消息,并不会发给服务器)

参数
[in]talk_id会话id,对方的account id或者群组tid
[in]json_msg消息体Json string (Keys SEE MORE nim_talk_def.h 『消息结构 Json Keys』)
[in]need_update_session是否更新会话列表(一般最新一条消息会有更新的需求)
[in]json_extensionjson扩展参数(插入消息后会产生会话变更事件,允许通过此参数设置是否获取会话消息历史中的最后一条消息与会话变更事件一起上报,格式 { "enable_compose_last_msg": true, "exclude_msg_type": [1000, 1100] })
[in]cb操作结果的回调函数, nim_msglog_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_query_be_readed()

bool nim_msglog_query_be_readed ( const char *  json_msg,
const char *  json_extension 
)

查询自己发送的消息是否被对方已读

参数
[in]json_msg消息json string。
[in]json_extensionjson扩展参数(备用,目前不需要)
返回
bool 是否被已读

◆ nim_msglog_query_local_thread_history_msg()

NIM_SDK_DLL_API void nim_msglog_query_local_thread_history_msg ( const char *  json_msg,
const nim_msglog_query_cb_func cb,
const void *  user_data 
)

◆ nim_msglog_query_message_is_thread_root_async()

void nim_msglog_query_message_is_thread_root_async ( const char *  msg_client_id,
nim_msglog_query_message_is_thread_root_async_cb_func  cb,
const void *  user_data 
)

查询某条消息是否为thread聊天的根消息

参数
[in]msg_client_id要查询的消息的客户端ID
[in]cb操作结果的回调函数, nim_msglog_query_message_is_thread_root_async_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_query_message_online()

void nim_msglog_query_message_online ( const NIMQueryMsgAsyncParam param,
nim_msglog_query_single_cb_func  cb,
const void *  user_data 
)

查询某条消息的具体内容一般用在thread talk 场景中

参数
[in]param要查询的消息的相关参数,可以在msglog.threadinfo中得到
[in]cb操作结果的回调函数, nim_msglog_query_single_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_query_msg_async()

void nim_msglog_query_msg_async ( const char *  account_id,
enum NIMSessionType  to_type,
int  limit_count,
int64_t  anchor_msg_time,
const char *  json_extension,
nim_msglog_query_cb_func  cb,
const void *  user_data 
)

查询本地消息(默认为从定位点的消息历史时间开始向前查找)

参数
[in]account_id会话id,对方的account id或者群组tid
[in]to_type会话类型
[in]limit_count一次查询数量,建议20
[in]anchor_msg_time作为此次查询的定位点的消息历史的消息时间戳(上次查询最后一条消息的时间戳,按指定的时间的顺序起查,默认为逆序,2.4.0之前命名为last_name)
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb查询本地消息的回调函数, nim_msglog_query_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_query_msg_by_id_async()

void nim_msglog_query_msg_by_id_async ( const char *  client_msg_id,
const char *  json_extension,
nim_msglog_query_single_cb_func  cb,
const void *  user_data 
)

根据消息ID查询本地(单条)消息

参数
[in]client_msg_id客户端消息ID
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb查询本地消息的回调函数, nim_msglog_query_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_query_msg_by_keyword_online_async()

void nim_msglog_query_msg_by_keyword_online_async ( const char *  id,
const char *  keyword,
NIMQueryMsgByKeywordOnlineAsyncParam  query_param,
nim_msglog_query_cb_func  cb,
const void *  user_data 
)

在线查询消息

参数
[in]id会话id,对方的account id或者群组tid
[in]keyword要查询的关键字
[in]query_param查询参数,详细信息可以参考 NIMQueryMsgByKeywordOnlineAsyncParam 定义
[in]cb在线查询消息的回调函数, nim_msglog_query_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 403:禁止访问(不在该群,只针对群组会话) 414:参数错误

◆ nim_msglog_query_msg_by_options_async()

void nim_msglog_query_msg_by_options_async ( enum NIMMsgLogQueryRange  query_range,
const char *  ids,
int  limit_count,
int64_t  from_time,
int64_t  end_time,
const char *  end_client_msg_id,
bool  reverse,
enum NIMMessageType  msg_type,
const char *  search_content,
const char *  json_extension,
nim_msglog_query_cb_func  cb,
const void *  user_data 
)

根据指定条件查询本地消息,使用此接口可以完成全局搜索等功能,具体请参阅开发手册 http://dev.netease.im/docs/product/IM%E5%8D%B3%E6%97%B6%E9%80%9A%E8%AE%AF/SDK%E5%BC%80%E5%8F%91%E9%9B%86%E6%88%90/Windows%E5%BC%80%E5%8F%91%E9%9B%86%E6%88%90/%E5%8E%86%E5%8F%B2%E8%AE%B0%E5%BD%95

参数
[in]query_range消息历史的检索范围(目前暂不支持某些范围的组合检索,详见NIMMsgLogQueryRange说明)
[in]ids会话id(对方的account id或者群组tid)的集合,格式为string array json(目前暂不支持多个的组合检索,详见NIMMsgLogQueryRange说明)
[in]limit_count本次查询的消息条数上限(默认100条)
[in]from_time起始时间点,单位:毫秒
[in]end_time结束时间点,单位:毫秒
[in]end_client_msg_id结束查询的最后一条消息的client_msg_id(不包含在查询结果中)(暂不启用)
[in]reversetrue:反向查询(按时间正序起查,正序排列),false:按时间逆序起查,逆序排列(建议默认为false)
[in]msg_type检索的消息类型
[in]search_content检索文本(目前只支持kNIMMessageTypeText和kNIMMessageTypeFile这两种类型消息的文本关键字检索,即支持文字消息和文件名的检索。如果合并检索,需使用未知类型消息kNIMMessageTypeUnknown)
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb本地查询消息的回调函数, nim_msglog_query_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_query_msg_by_options_async_ex()

void nim_msglog_query_msg_by_options_async_ex ( const char *  json_param,
nim_msglog_query_cb_func  cb,
const void *  user_data 
)

根据指定条件查询本地消息,使用此接口可以完成全局搜索等功能,具体请参阅开发手册 http://dev.netease.im/docs/product/IM%E5%8D%B3%E6%97%B6%E9%80%9A%E8%AE%AF/SDK%E5%BC%80%E5%8F%91%E9%9B%86%E6%88%90/Windows%E5%BC%80%E5%8F%91%E9%9B%86%E6%88%90/%E5%8E%86%E5%8F%B2%E8%AE%B0%E5%BD%95

参数
[in]json_param查询参数
[in]cb本地查询消息的回调函数, nim_msglog_query_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_query_msg_online_async()

void nim_msglog_query_msg_online_async ( const char *  id,
enum NIMSessionType  to_type,
int  limit_count,
int64_t  from_time,
int64_t  end_time,
int64_t  end_msg_id,
bool  reverse,
bool  need_save_to_local,
const char *  json_extension,
nim_msglog_query_cb_func  cb,
const void *  user_data 
)

在线查询消息

参数
[in]id会话id,对方的account id或者群组tid
[in]to_type会话类型
[in]limit_count本次查询的消息条数上限(最多100条)
[in]from_time起始时间点,单位:毫秒
[in]end_time结束时间点,单位:毫秒
[in]end_msg_id结束查询的最后一条消息的server_msg_id(不包含在查询结果中)
[in]reversetrue:反向查询(按时间正序起查,正序排列),false:按时间逆序起查,逆序排列(建议默认为false)
[in]need_save_to_localtrue: 将在线查询结果保存到本地,false: 不保存
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb在线查询消息的回调函数, nim_msglog_query_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 403:禁止访问(不在该群,只针对群组会话) 414:参数错误

◆ nim_msglog_query_msg_online_async2()

nim_msglog_query_msg_online_async2 ( const char *  id,
NIMQueryMsgOnlineAsyncParam  query_param,
nim_msglog_query_cb_func  cb,
const void *  user_data 
)

在线查询消息

参数
[in]id会话id,对方的account id或者群组tid
[in]query_param查询参数,详细信息可以参考 NIMQueryMsgOnlineAsyncParam 定义
[in]cb在线查询消息的回调函数, nim_msglog_query_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 403:禁止访问(不在该群,只针对群组会话) 414:参数错误

◆ nim_msglog_query_receipt_sent()

bool nim_msglog_query_receipt_sent ( const char *  json_msg,
const char *  json_extension 
)

查询收到的消息是否已经发送过已读回执

参数
[in]json_msg消息json string。
[in]json_extensionjson扩展参数(备用,目前不需要)
返回
bool 是否已发送过

◆ nim_msglog_query_the_message_of_the_specified_type_async()

void nim_msglog_query_the_message_of_the_specified_type_async ( enum NIMSessionType  to_type,
const char *  id,
int  limit_count,
int64_t  from_time,
int64_t  end_time,
const char *  end_client_msg_id,
bool  reverse,
const char *  msg_types,
const char *  json_extension,
nim_msglog_query_cb_func  cb,
const void *  user_data 
)

根据指定条件在一个会话中查询指定单个或多个类型的本地消息

参数
[in]to_type会话类型
[in]id会话id,对方的account id或者群组tid
[in]limit_count本次查询的消息条数上限(默认100条)
[in]from_time起始时间点,单位:毫秒
[in]end_time结束时间点,单位:毫秒
[in]end_client_msg_id结束查询的最后一条消息的client_msg_id(不包含在查询结果中)(暂不启用)
[in]reversetrue:反向查询(按时间正序起查,正序排列),false:按时间逆序起查,逆序排列(建议默认为false)
[in]msg_types检索的消息类型,Json array
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb本地查询消息的回调函数, nim_msglog_query_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_query_thread_history_msg()

void nim_msglog_query_thread_history_msg ( const char *  json_msg,
const NIMQueryThreadHistoryMsgAsyncParam param,
const nim_msglog_query_thread_history_msg_cb_func cb,
const void *  user_data 
)

分页查询thread talk消息历史

参数
[in]json_msgthread聊天的root消息
[in]param查询thread聊天历史参数
[in]cb操作结果的回调函数, nim_msglog_query_thread_history_msg_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_query_unread_messages()

void nim_msglog_query_unread_messages ( const char *  account_id,
enum NIMSessionType  to_type,
const char *  json_extension,
nim_msglog_query_cb_func  cb,
const void *  user_data 
)

检索指定会话下本端尚未读取过的未读消息列表

参数
[in]account_id会话 ID,对方的 account ID 或者群组 ID
[in]to_type会话类型
[in]json_extensionjson 扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_query_cb_func 回调函数定义见 nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK 只负责传回给回调函数 cb,不做任何处理!
返回
void 无返回值

◆ nim_msglog_read_all_async()

void nim_msglog_read_all_async ( const char *  json_extension,
nim_msglog_modify_res_cb_func  cb,
const void *  user_data 
)

全部未读消息历史标记为已读

参数
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_modify_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_reg_status_changed_cb()

void nim_msglog_reg_status_changed_cb ( const char *  json_extension,
nim_msglog_status_changed_cb_func  cb,
const void *  user_data 
)

(全局回调)注册全局的消息状态变更通知(目前只支持已读状态的通知)

参数
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb回调函数, nim_msglog_status_changed_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功

◆ nim_msglog_register_delete_history_messages_callback()

void nim_msglog_register_delete_history_messages_callback ( const nim_msglog_delete_history_online_notify_cb_func  cb,
const void *  user_data 
)

注册删除历史消息推送回调

参数
[in]cb删除历史消息推送回调函数定义, nim_msglog_delete_history_online_res_cb_func_ex回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_msglog_register_delete_msgs_self_callback()

void nim_msglog_register_delete_msgs_self_callback ( const nim_msglog_delete_message_self_notify_cb_func  cb,
const void *  user_data 
)

注册单向删除消息推送回调

参数
[in]cb单向删除消息记录推送回调函数定义, nim_msglog_delete_message_self_notify_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值

◆ nim_msglog_send_receipt_async()

void nim_msglog_send_receipt_async ( const char *  json_msg,
const char *  json_extension,
nim_msglog_status_changed_cb_func  cb,
const void *  user_data 
)

发送消息已读回执

参数
[in]json_msg已读消息json string。
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_status_changed_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 403:服务器关闭此功能,或者应用没权限 404:请求的目标(用户或对象)不存在 10414:本地错误码,参数错误

◆ nim_msglog_set_status_async()

void nim_msglog_set_status_async ( const char *  msg_id,
enum NIMMsgLogStatus  msglog_status,
const char *  json_extension,
nim_msglog_res_cb_func  cb,
const void *  user_data 
)

设置消息状态

参数
[in]msg_id消息id
[in]msglog_status消息状态枚举值
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_set_sub_status_async()

nim_msglog_set_sub_status_async ( const char *  msg_id,
enum NIMMsgLogSubStatus  msglog_sub_status,
const char *  json_extension,
nim_msglog_res_cb_func  cb,
const void *  user_data 
)

设置消息子状态

参数
[in]msg_id消息id
[in]msglog_sub_status消息子状态枚举值
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败

◆ nim_msglog_update_localext_async()

void nim_msglog_update_localext_async ( const char *  msg_id,
const char *  local_ext,
const char *  json_extension,
nim_msglog_res_cb_func  cb,
const void *  user_data 
)

更新本地扩展字段内容

参数
[in]msg_id消息id
[in]local_ext消息本地扩展字段内容
[in]json_extensionjson扩展参数(备用,目前不需要)
[in]cb操作结果的回调函数, nim_msglog_res_cb_func回调函数定义见nim_msglog_def.h
[in]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数cb,不做任何处理!
返回
void 无返回值
注解
错误码 200:成功 0:失败