NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
nim_session_def.h
浏览该文件的文档.
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
24
52
53typedef struct {
54 char session_id[64];
57
63
74typedef void (
75 *nim_session_change_cb_func)(int rescode, const char* result, int total_unread_counts, const char* json_extension, const void* user_data);
76
85typedef void (*nim_session_multi_change_cb_func)(int rescode, const char* result, int total_unread_counts, const void* user_data);
86
95typedef void (*nim_session_delete_session_roaming_cb_func)(int rescode, const char* to_type, const char* id, const void* user_data);
96
106typedef void (
107 *nim_session_query_recent_session_cb_func)(int total_unread_count, const char* result, const char* json_extension, const void* user_data);
108
116typedef void (*nim_session_query_sessiondata_by_id_cb_func)(int rescode, const char* result, const void* user_data);
117
124typedef int (*nim_session_badge_count_cb_func)(const char* json_extension, const void* user_data);
125
133typedef void (*nim_session_query_stick_top_session_list_cb_func)(int rescode, const char* result, const void* user_data);
134
142typedef void (*nim_session_set_to_stick_top_cb_func)(int rescode, const char* stick_session, const void* user_data);
143
152typedef void (*nim_session_cancel_stick_top_cb_func)(int rescode, const char* session_id, enum NIMSessionType to_type, const void* user_data);
153
161typedef void (*nim_session_update_stick_top_cb_func)(int rescode, const char* stick_session, const void* user_data);
162
169typedef void (*nim_session_set_to_stick_top_notify_cb_func)(const char* stick_session, const void* user_data);
170
178typedef void (*nim_session_cancel_stick_top_notify_cb_func)(const char* session_id, enum NIMSessionType to_type, const void* user_data);
179
186typedef void (*nim_session_update_stick_top_notify_cb_func)(const char* stick_session, const void* user_data);
187
193static const char* kNIMSessionListCount = "count";
195static const char* kNIMSessionListUnreadCount = "unread_counts";
197static const char* kNIMSessionListContent = "content";
199static const char* kNIMSessionId = "id";
201static const char* kNIMSessionType = "type";
203static const char* kNIMSessionUnreadCount = "unread_count";
205static const char* kNIMSessionCommand = "command";
207static const char* kNIMSessionMsgClientID = "msg_client_id";
209static const char* kNIMSessionMsgFromAccount = "msg_from_account";
211static const char* kNIMSessionMsgTime = "msg_time";
213static const char* kNIMSessionMsgType = "msg_type";
215static const char* kNIMSessionMsgBody = "msg_body";
217static const char* kNIMSessionMsgAttach = "msg_attach";
219static const char* kNIMSessionMsgStatus = "msg_status";
221static const char* kNIMSessionMsgSubStatus = "msg_sub_status";
223static const char* kNIMSessionLastUpdatedMsg = "last_updated_msg";
225static const char* kNIMSessionOnTop = "top";
227static const char* kNIMSessionExtendedData = "extend_data";
229static const char* kNIMSessionRobotFlag = "robot_session";
231static const char* kNIMSessionStickTopInfo = "stick_top_info";
232 // 会话列表的Json Keys
233
238static const char* kNIMSessionRoamMsgHasMoreId = "id";
240static const char* kNIMSessionRoamMsgHasMoreType = "type";
242static const char* kNIMSessionRoamMsgHasMoreMsgServerID = "msg_server_id";
244static const char* kNIMSessionRoamMsgHasMoreMsgTime = "msg_time";
245 // 会话漫游消息未完待取的Json Keys
246
251static const char* kNIMSessionStickTopInfoTop = "top";
253static const char* kNIMSessionStickTopInfoSessionId = "id";
255static const char* kNIMSessionStickTopInfoType = "type";
257static const char* kNIMSessionStickTopInfoExt = "ext";
259static const char* kNIMSessionStickTopInfoCreateTime = "create_time";
261static const char* kNIMSessionStickTopInfoUpdateTime = "update_time";
263static const char* kNIMSessionStickTopSessionData = "session_data";
264 // 置顶会话Json Keys
265
270static const char* kNIMSessionUnReadCountSessionType = "type";
272static const char* kNIMSessionUnReadCountSessionId = "id";
273
274 // 会话未读数清零Json Keys
275
285typedef void (*nim_session_query_session_hasmore_roammsg_cb_func)(int rescode, const SessionRoamMsgHasMoreTagInfo* tag_info, const void* user_data);
286
299 const SessionRoamMsgHasMoreTagInfo* tag_info_list,
300 int size,
301 const void* user_data);
302
309typedef void (*nim_session_update_session_hasmore_roammsg_cb_func)(int rescode, const void* user_data);
310
317typedef void (*nim_session_delete_session_hasmore_roammsg_cb_func)(int rescode, const void* user_data);
318
319#ifdef __cplusplus
320};
321#endif // __cplusplus
322#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:75
static const char * kNIMSessionStickTopInfoTop
bool, 是否置顶
Definition nim_session_def.h:251
static const char * kNIMSessionStickTopInfoUpdateTime
uint64_t 更新置顶的时间戳
Definition nim_session_def.h:261
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:152
static const char * kNIMSessionMsgAttach
string, 本地消息历史中该会话最后一条消息的attach
Definition nim_session_def.h:217
static const char * kNIMSessionStickTopInfoExt
string, 扩展字段
Definition nim_session_def.h:257
static const char * kNIMSessionStickTopInfo
json object, 置顶信息 (v7.6.0添加),该置顶信息会进行多端同步,不建议再使用 kNIMSessionOnTop
Definition nim_session_def.h:231
void(* nim_session_query_stick_top_session_list_cb_func)(int rescode, const char *result, const void *user_data)
Definition nim_session_def.h:133
static const char * kNIMSessionMsgBody
string, 本地消息历史中该会话最后一条消息的内容
Definition nim_session_def.h:215
static const char * kNIMSessionUnReadCountSessionId
string, 会话id
Definition nim_session_def.h:272
void(* nim_session_query_sessiondata_by_id_cb_func)(int rescode, const char *result, const void *user_data)
Definition nim_session_def.h:116
void(* nim_session_query_session_hasmore_roammsg_cb_func)(int rescode, const SessionRoamMsgHasMoreTagInfo *tag_info, const void *user_data)
Definition nim_session_def.h:285
static const char * kNIMSessionExtendedData
string, 本地扩展字段, 限4096
Definition nim_session_def.h:227
void(* nim_session_update_session_hasmore_roammsg_cb_func)(int rescode, const void *user_data)
Definition nim_session_def.h:309
static const char * kNIMSessionType
int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)
Definition nim_session_def.h:201
void(* nim_session_update_stick_top_cb_func)(int rescode, const char *stick_session, const void *user_data)
Definition nim_session_def.h:161
static const char * kNIMSessionId
string, 会话id
Definition nim_session_def.h:199
static const char * kNIMSessionListContent
json object (Keys as follows), 会话列表项内容
Definition nim_session_def.h:197
static const char * kNIMSessionRoamMsgHasMoreMsgTime
uint64_t, 最早一条漫游消息的时间戳
Definition nim_session_def.h:244
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:298
static const char * kNIMSessionListUnreadCount
int, 总未读数
Definition nim_session_def.h:195
static const char * kNIMSessionRobotFlag
bool, 是否为机器人会话, 默认为false
Definition nim_session_def.h:229
static const char * kNIMSessionMsgSubStatus
int, 本地消息历史中该会话最后一条消息的子状态,见NIMMsgLogSubStatus
Definition nim_session_def.h:221
void(* nim_session_update_stick_top_notify_cb_func)(const char *stick_session, const void *user_data)
Definition nim_session_def.h:186
void(* nim_session_delete_session_hasmore_roammsg_cb_func)(int rescode, const void *user_data)
Definition nim_session_def.h:317
static const char * kNIMSessionUnReadCountSessionType
enum NIMSessionType, 会话类型
Definition nim_session_def.h:270
static const char * kNIMSessionMsgType
int, 本地消息历史中该会话最后一条消息的类型 见NIMMessageType
Definition nim_session_def.h:213
static const char * kNIMSessionRoamMsgHasMoreType
int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)
Definition nim_session_def.h:240
static const char * kNIMSessionOnTop
bool, 是否置顶
Definition nim_session_def.h:225
int(* nim_session_badge_count_cb_func)(const char *json_extension, const void *user_data)
Definition nim_session_def.h:124
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:85
static const char * kNIMSessionRoamMsgHasMoreId
string, 会话id
Definition nim_session_def.h:238
static const char * kNIMSessionMsgStatus
int, 本地消息历史中该会话最后一条消息的状态,见NIMMsgLogStatus
Definition nim_session_def.h:219
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:142
void(* nim_session_set_to_stick_top_notify_cb_func)(const char *stick_session, const void *user_data)
Definition nim_session_def.h:169
static const char * kNIMSessionStickTopInfoCreateTime
uint64_t 设置置顶的时间戳
Definition nim_session_def.h:259
static const char * kNIMSessionStickTopInfoType
int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)
Definition nim_session_def.h:255
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:95
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:178
static const char * kNIMSessionCommand
int, 会话项操作命令NIMSessionCommand
Definition nim_session_def.h:205
static const char * kNIMSessionStickTopInfoSessionId
string, 会话id
Definition nim_session_def.h:253
static const char * kNIMSessionListCount
int, 会话列表项数量
Definition nim_session_def.h:193
static const char * kNIMSessionUnreadCount
int, 本地消息历史中该会话未读消息数量
Definition nim_session_def.h:203
static const char * kNIMSessionMsgTime
long, 本地消息历史中该会话最后一条消息的时间
Definition nim_session_def.h:211
static const char * kNIMSessionStickTopSessionData
json object 会话信息
Definition nim_session_def.h:263
static const char * kNIMSessionRoamMsgHasMoreMsgServerID
string, 界定消息的服务端ID
Definition nim_session_def.h:242
static const char * kNIMSessionLastUpdatedMsg
bool, (批量)消息变更或增加时是否是最后一条变更的信息
Definition nim_session_def.h:223
static const char * kNIMSessionMsgClientID
string, 本地消息历史中该会话最后一条消息的客户端ID唯一标识,即消息uuid
Definition nim_session_def.h:207
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:107
static const char * kNIMSessionMsgFromAccount
string, 本地消息历史中该会话最后一条消息的发送方帐号
Definition nim_session_def.h:209
NIM SDK 及 NIM ChatRoom SDK 公用头文件
Definition nim_session_def.h:53
enum NIMSessionType to_type
Definition nim_session_def.h:55
Definition nim_session_def.h:58
uint64_t message_time_tag
Definition nim_session_def.h:60
SessionMainTagInfo session_tag_info
Definition nim_session_def.h:59
uint64_t message_server_id
Definition nim_session_def.h:61