NIM PC Cross Platform SDK
nim_session_def.h
Go to the documentation of this file.
1
7#ifndef NIM_SDK_DLL_EXPORT_HEADERS_SESSION_DEF_H_
8#define NIM_SDK_DLL_EXPORT_HEADERS_SESSION_DEF_H_
9
10#include "public_defines.h"
11#ifdef __cplusplus
12extern "C" {
13#endif
14
23};
24
51
52};
53
54typedef struct {
55 char session_id[64];
56 enum NIMSessionType to_type;
58
59typedef struct {
60 SessionMainTagInfo session_tag_info;
61 uint64_t message_time_tag;
62 uint64_t message_server_id;
64
75typedef void (
76 *nim_session_change_cb_func)(int rescode, const char* result, int total_unread_counts, const char* json_extension, const void* user_data);
77
86typedef void (*nim_session_multi_change_cb_func)(int rescode, const char* result, int total_unread_counts, const void* user_data);
87
96typedef void (*nim_session_delete_session_roaming_cb_func)(int rescode, const char* to_type, const char* id, const void* user_data);
97
107typedef void (
108 *nim_session_query_recent_session_cb_func)(int total_unread_count, const char* result, const char* json_extension, const void* user_data);
109
117typedef void (*nim_session_query_sessiondata_by_id_cb_func)(int rescode, const char* result, const void* user_data);
118
125typedef int (*nim_session_badge_count_cb_func)(const char* json_extension, const void* user_data);
126
134typedef void (*nim_session_query_stick_top_session_list_cb_func)(int rescode, const char* result, const void* user_data);
135
143typedef void (*nim_session_set_to_stick_top_cb_func)(int rescode, const char* stick_session, const void* user_data);
144
153typedef void (*nim_session_cancel_stick_top_cb_func)(int rescode, const char* session_id, enum NIMSessionType to_type, const void* user_data);
154
162typedef void (*nim_session_update_stick_top_cb_func)(int rescode, const char* stick_session, const void* user_data);
163
170typedef void (*nim_session_set_to_stick_top_notify_cb_func)(const char* stick_session, const void* user_data);
171
179typedef void (*nim_session_cancel_stick_top_notify_cb_func)(const char* session_id, enum NIMSessionType to_type, const void* user_data);
180
187typedef void (*nim_session_update_stick_top_notify_cb_func)(const char* stick_session, const void* user_data);
188
194static const char* kNIMSessionListCount = "count";
196static const char* kNIMSessionListUnreadCount = "unread_counts";
198static const char* kNIMSessionListContent = "content";
200static const char* kNIMSessionId = "id";
202static const char* kNIMSessionType = "type";
204static const char* kNIMSessionUnreadCount = "unread_count";
206static const char* kNIMSessionCommand = "command";
208static const char* kNIMSessionMsgClientID = "msg_client_id";
210static const char* kNIMSessionMsgFromAccount = "msg_from_account";
212static const char* kNIMSessionMsgTime = "msg_time";
214static const char* kNIMSessionMsgType = "msg_type";
216static const char* kNIMSessionMsgBody = "msg_body";
218static const char* kNIMSessionMsgAttach = "msg_attach";
220static const char* kNIMSessionMsgStatus = "msg_status";
222static const char* kNIMSessionMsgSubStatus = "msg_sub_status";
224static const char* kNIMSessionLastUpdatedMsg = "last_updated_msg";
226static const char* kNIMSessionOnTop = "top";
228static const char* kNIMSessionExtendedData = "extend_data";
230static const char* kNIMSessionRobotFlag = "robot_session";
232static const char* kNIMSessionStickTopInfo = "stick_top_info"; // 会话列表的Json Keys
234
239static const char* kNIMSessionRoamMsgHasMoreId = "id";
241static const char* kNIMSessionRoamMsgHasMoreType = "type";
243static const char* kNIMSessionRoamMsgHasMoreMsgServerID = "msg_server_id";
245static const char* kNIMSessionRoamMsgHasMoreMsgTime = "msg_time"; // 会话漫游消息未完待取的Json Keys
247
252static const char* kNIMSessionStickTopInfoTop = "top";
254static const char* kNIMSessionStickTopInfoSessionId = "id";
256static const char* kNIMSessionStickTopInfoType = "type";
258static const char* kNIMSessionStickTopInfoExt = "ext";
260static const char* kNIMSessionStickTopInfoCreateTime = "create_time";
262static const char* kNIMSessionStickTopInfoUpdateTime = "update_time";
264static const char* kNIMSessionStickTopSessionData = "session_data"; // 置顶会话Json Keys
266
271static const char* kNIMSessionUnReadCountSessionType = "type";
273static const char* kNIMSessionUnReadCountSessionId = "id";
274 // 会话未读数清零Json Keys
276
286typedef void (*nim_session_query_session_hasmore_roammsg_cb_func)(int rescode, const SessionRoamMsgHasMoreTagInfo* tag_info, const void* user_data);
287
300 const SessionRoamMsgHasMoreTagInfo* tag_info_list,
301 int size,
302 const void* user_data);
303
310typedef void (*nim_session_update_session_hasmore_roammsg_cb_func)(int rescode, const void* user_data);
311
318typedef void (*nim_session_delete_session_hasmore_roammsg_cb_func)(int rescode, const void* user_data);
319
320#ifdef __cplusplus
321};
322#endif // __cplusplus
323#endif // NIM_SDK_DLL_EXPORT_HEADERS_SESSION_DEF_H_
void(* nim_session_change_cb_func)(int rescode, const char *result, int total_unread_counts, const char *json_extension, const void *user_data)
Definition: nim_session_def.h:76
static const char * kNIMSessionStickTopInfoTop
bool, 是否置顶
Definition: nim_session_def.h:252
static const char * kNIMSessionStickTopInfoUpdateTime
uint64_t 更新置顶的时间戳
Definition: nim_session_def.h:262
NIMSessionCommand
Definition: nim_session_def.h:26
@ kNIMSessionCommandRemoveAllTeam
删除所有群的会话项
Definition: nim_session_def.h:36
@ kNIMSessionCommandMsgDeleted
单个会话项的消息已删除
Definition: nim_session_def.h:38
@ kNIMSessionCommandRemove
删除单个会话项
Definition: nim_session_def.h:30
@ kNIMSessionCommandUpdate
更新会话项
Definition: nim_session_def.h:46
@ kNIMSessionCommandRemoveAll
删除所有会话项
Definition: nim_session_def.h:32
@ kNIMSessionCommandAdd
添加会话项
Definition: nim_session_def.h:28
@ kNIMSessionCommandRemoveAllSuperTeam
删除所有超大群的会话项
Definition: nim_session_def.h:48
@ kNIMSessionCommandRemoveAllP2P
删除所有点对点的会话项
Definition: nim_session_def.h:34
@ kNIMSessionCommandAllTeamMsgDeleted
所有群会话项的消息已删除
Definition: nim_session_def.h:44
@ kNIMSessionCommandAllSuperTeamMsgDeleted
所有超大群会话项的消息已删除
Definition: nim_session_def.h:50
@ kNIMSessionCommandAllP2PMsgDeleted
所有点对点会话项的消息已删除
Definition: nim_session_def.h:42
@ kNIMSessionCommandAllMsgDeleted
所有会话项的消息已删除
Definition: nim_session_def.h:40
void(* nim_session_cancel_stick_top_cb_func)(int rescode, const char *session_id, enum NIMSessionType to_type, const void *user_data)
Definition: nim_session_def.h:153
static const char * kNIMSessionMsgAttach
string, 本地消息历史中该会话最后一条消息的attach
Definition: nim_session_def.h:218
static const char * kNIMSessionStickTopInfoExt
string, 扩展字段
Definition: nim_session_def.h:258
static const char * kNIMSessionStickTopInfo
json object, 置顶信息 (v7.6.0添加),该置顶信息会进行多端同步,不建议再使用 kNIMSessionOnTop
Definition: nim_session_def.h:232
void(* nim_session_query_stick_top_session_list_cb_func)(int rescode, const char *result, const void *user_data)
Definition: nim_session_def.h:134
static const char * kNIMSessionMsgBody
string, 本地消息历史中该会话最后一条消息的内容
Definition: nim_session_def.h:216
static const char * kNIMSessionUnReadCountSessionId
string, 会话id
Definition: nim_session_def.h:273
void(* nim_session_query_sessiondata_by_id_cb_func)(int rescode, const char *result, const void *user_data)
Definition: nim_session_def.h:117
void(* nim_session_query_session_hasmore_roammsg_cb_func)(int rescode, const SessionRoamMsgHasMoreTagInfo *tag_info, const void *user_data)
Definition: nim_session_def.h:286
static const char * kNIMSessionExtendedData
string, 本地扩展字段, 限4096
Definition: nim_session_def.h:228
void(* nim_session_update_session_hasmore_roammsg_cb_func)(int rescode, const void *user_data)
Definition: nim_session_def.h:310
static const char * kNIMSessionType
int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)
Definition: nim_session_def.h:202
void(* nim_session_update_stick_top_cb_func)(int rescode, const char *stick_session, const void *user_data)
Definition: nim_session_def.h:162
static const char * kNIMSessionId
string, 会话id
Definition: nim_session_def.h:200
static const char * kNIMSessionListContent
json object (Keys as follows), 会话列表项内容
Definition: nim_session_def.h:198
static const char * kNIMSessionRoamMsgHasMoreMsgTime
uint64_t, 最早一条漫游消息的时间戳
Definition: nim_session_def.h:245
void(* nim_session_query_all_session_hasmore_roammsg_cb_func)(int rescode, const SessionRoamMsgHasMoreTagInfo *tag_info_list, int size, const void *user_data)
Definition: nim_session_def.h:299
static const char * kNIMSessionListUnreadCount
int, 总未读数
Definition: nim_session_def.h:196
static const char * kNIMSessionRobotFlag
bool, 是否为机器人会话, 默认为false
Definition: nim_session_def.h:230
static const char * kNIMSessionMsgSubStatus
int, 本地消息历史中该会话最后一条消息的子状态,见NIMMsgLogSubStatus
Definition: nim_session_def.h:222
void(* nim_session_update_stick_top_notify_cb_func)(const char *stick_session, const void *user_data)
Definition: nim_session_def.h:187
void(* nim_session_delete_session_hasmore_roammsg_cb_func)(int rescode, const void *user_data)
Definition: nim_session_def.h:318
static const char * kNIMSessionUnReadCountSessionType
enum NIMSessionType, 会话类型
Definition: nim_session_def.h:271
static const char * kNIMSessionMsgType
int, 本地消息历史中该会话最后一条消息的类型 见NIMMessageType
Definition: nim_session_def.h:214
static const char * kNIMSessionRoamMsgHasMoreType
int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)
Definition: nim_session_def.h:241
static const char * kNIMSessionOnTop
bool, 是否置顶
Definition: nim_session_def.h:226
int(* nim_session_badge_count_cb_func)(const char *json_extension, const void *user_data)
Definition: nim_session_def.h:125
void(* nim_session_multi_change_cb_func)(int rescode, const char *result, int total_unread_counts, const void *user_data)
Definition: nim_session_def.h:86
static const char * kNIMSessionRoamMsgHasMoreId
string, 会话id
Definition: nim_session_def.h:239
static const char * kNIMSessionMsgStatus
int, 本地消息历史中该会话最后一条消息的状态,见NIMMsgLogStatus
Definition: nim_session_def.h:220
NIMSessionType
Definition: nim_session_def.h:16
@ kNIMSessionTypeSuperTeam
超大群组
Definition: nim_session_def.h:22
@ kNIMSessionTypeP2P
个人,即点对点
Definition: nim_session_def.h:18
@ kNIMSessionTypeTeam
群组
Definition: nim_session_def.h:20
void(* nim_session_set_to_stick_top_cb_func)(int rescode, const char *stick_session, const void *user_data)
Definition: nim_session_def.h:143
void(* nim_session_set_to_stick_top_notify_cb_func)(const char *stick_session, const void *user_data)
Definition: nim_session_def.h:170
static const char * kNIMSessionStickTopInfoCreateTime
uint64_t 设置置顶的时间戳
Definition: nim_session_def.h:260
static const char * kNIMSessionStickTopInfoType
int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)
Definition: nim_session_def.h:256
void(* nim_session_delete_session_roaming_cb_func)(int rescode, const char *to_type, const char *id, const void *user_data)
Definition: nim_session_def.h:96
void(* nim_session_cancel_stick_top_notify_cb_func)(const char *session_id, enum NIMSessionType to_type, const void *user_data)
Definition: nim_session_def.h:179
static const char * kNIMSessionCommand
int, 会话项操作命令NIMSessionCommand
Definition: nim_session_def.h:206
static const char * kNIMSessionStickTopInfoSessionId
string, 会话id
Definition: nim_session_def.h:254
static const char * kNIMSessionListCount
int, 会话列表项数量
Definition: nim_session_def.h:194
static const char * kNIMSessionUnreadCount
int, 本地消息历史中该会话未读消息数量
Definition: nim_session_def.h:204
static const char * kNIMSessionMsgTime
long, 本地消息历史中该会话最后一条消息的时间
Definition: nim_session_def.h:212
static const char * kNIMSessionStickTopSessionData
json object 会话信息
Definition: nim_session_def.h:264
static const char * kNIMSessionRoamMsgHasMoreMsgServerID
string, 界定消息的服务端ID
Definition: nim_session_def.h:243
static const char * kNIMSessionLastUpdatedMsg
bool, (批量)消息变更或增加时是否是最后一条变更的信息
Definition: nim_session_def.h:224
static const char * kNIMSessionMsgClientID
string, 本地消息历史中该会话最后一条消息的客户端ID唯一标识,即消息uuid
Definition: nim_session_def.h:208
void(* nim_session_query_recent_session_cb_func)(int total_unread_count, const char *result, const char *json_extension, const void *user_data)
Definition: nim_session_def.h:108
static const char * kNIMSessionMsgFromAccount
string, 本地消息历史中该会话最后一条消息的发送方帐号
Definition: nim_session_def.h:210
NIM SDK 及 NIM ChatRoom SDK 公用头文件
Definition: nim_session_def.h:54
Definition: nim_session_def.h:59