NIM SDK API  8.5.0
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
12 extern "C" {
13 #endif
14 
20 };
21 
37 };
38 
39 typedef struct {
40  char session_id[64];
41  enum NIMSessionType to_type;
43 
44 typedef struct {
45  SessionMainTagInfo session_tag_info;
46  uint64_t message_time_tag;
47  uint64_t message_server_id;
49 
60 typedef void (
61  *nim_session_change_cb_func)(int rescode, const char* result, int total_unread_counts, const char* json_extension, const void* user_data);
62 
71 typedef void (*nim_session_multi_change_cb_func)(int rescode, const char* result, int total_unread_counts, const void* user_data);
72 
81 typedef void (*nim_session_delete_session_roaming_cb_func)(int rescode, const char* to_type, const char* id, const void* user_data);
82 
92 typedef void (*nim_session_query_recent_session_cb_func)(int total_unread_count,
93  const char* result,
94  const char* json_extension,
95  const void* user_data);
96 
104 typedef void (*nim_session_query_sessiondata_by_id_cb_func)(int rescode, const char* result, const void* user_data);
105 
112 typedef int (*nim_session_badge_count_cb_func)(const char* json_extension, const void* user_data);
113 
121 typedef void (*nim_session_query_stick_top_session_list_cb_func)(int rescode, const char* result, const void* user_data);
122 
130 typedef void (*nim_session_set_to_stick_top_cb_func)(int rescode, const char* stick_session, const void* user_data);
131 
140 typedef void (*nim_session_cancel_stick_top_cb_func)(int rescode, const char* session_id, enum NIMSessionType to_type, const void* user_data);
141 
149 typedef void (*nim_session_update_stick_top_cb_func)(int rescode, const char* stick_session, const void* user_data);
150 
157 typedef void (*nim_session_set_to_stick_top_notify_cb_func)(const char* stick_session, const void* user_data);
158 
166 typedef void (*nim_session_cancel_stick_top_notify_cb_func)(const char* session_id, enum NIMSessionType to_type, const void* user_data);
167 
174 typedef void (*nim_session_update_stick_top_notify_cb_func)(const char* stick_session, const void* user_data);
175 
180 static const char* kNIMSessionListCount = "count";
183 static const char* kNIMSessionListUnreadCount = "unread_counts";
185 static const char* kNIMSessionListContent = "content";
187 static const char* kNIMSessionId = "id";
189 static const char* kNIMSessionType = "type";
191 static const char* kNIMSessionUnreadCount = "unread_count";
193 static const char* kNIMSessionCommand = "command";
195 static const char* kNIMSessionMsgClientID = "msg_client_id";
197 static const char* kNIMSessionMsgFromAccount = "msg_from_account";
199 static const char* kNIMSessionMsgTime = "msg_time";
201 static const char* kNIMSessionMsgType = "msg_type";
203 static const char* kNIMSessionMsgBody = "msg_body";
205 static const char* kNIMSessionMsgAttach = "msg_attach";
207 static const char* kNIMSessionMsgStatus = "msg_status";
209 static const char* kNIMSessionMsgSubStatus = "msg_sub_status";
211 static const char* kNIMSessionLastUpdatedMsg = "last_updated_msg";
213 static const char* kNIMSessionOnTop = "top";
215 static const char* kNIMSessionExtendedData = "extend_data";
217 static const char* kNIMSessionRobotFlag = "robot_session";
219 static const char* kNIMSessionStickTopInfo = "stick_top_info"; // 会话列表的Json Keys
221 
225 static const char* kNIMSessionRoamMsgHasMoreId = "id";
228 static const char* kNIMSessionRoamMsgHasMoreType = "type";
230 static const char* kNIMSessionRoamMsgHasMoreMsgServerID = "msg_server_id";
232 static const char* kNIMSessionRoamMsgHasMoreMsgTime = "msg_time"; // 会话漫游消息未完待取的Json Keys
234 
238 static const char* kNIMSessionStickTopInfoTop = "top";
241 static const char* kNIMSessionStickTopInfoSessionId = "id";
243 static const char* kNIMSessionStickTopInfoType = "type";
245 static const char* kNIMSessionStickTopInfoExt = "ext";
247 static const char* kNIMSessionStickTopInfoCreateTime = "create_time";
249 static const char* kNIMSessionStickTopInfoUpdateTime = "update_time";
251 static const char* kNIMSessionStickTopSessionData = "session_data"; // 置顶会话Json Keys
253 
257 static const char* kNIMSessionUnReadCountSessionType = "type";
260 static const char* kNIMSessionUnReadCountSessionId = "id";
261  // 会话未读数清零Json Keys
263 
273 typedef void (*nim_session_query_session_hasmore_roammsg_cb_func)(int rescode, const SessionRoamMsgHasMoreTagInfo* tag_info, const void* user_data);
274 
287  const SessionRoamMsgHasMoreTagInfo* tag_info_list,
288  int size,
289  const void* user_data);
290 
297 typedef void (*nim_session_update_session_hasmore_roammsg_cb_func)(int rescode, const void* user_data);
298 
305 typedef void (*nim_session_delete_session_hasmore_roammsg_cb_func)(int rescode, const void* user_data);
306 
307 #ifdef __cplusplus
308 };
309 #endif // __cplusplus
310 #endif // NIM_SDK_DLL_EXPORT_HEADERS_SESSION_DEF_H_
nim_session_query_stick_top_session_list_cb_func
void(* nim_session_query_stick_top_session_list_cb_func)(int rescode, const char *result, const void *user_data)
Definition: nim_session_def.h:121
kNIMSessionRoamMsgHasMoreMsgTime
static const char * kNIMSessionRoamMsgHasMoreMsgTime
uint64_t, 最早一条漫游消息的时间戳
Definition: nim_session_def.h:232
kNIMSessionTypeSuperTeam
@ kNIMSessionTypeSuperTeam
Definition: nim_session_def.h:19
SessionMainTagInfo
Definition: nim_session_def.h:39
kNIMSessionStickTopInfoTop
static const char * kNIMSessionStickTopInfoTop
bool, 是否置顶
Definition: nim_session_def.h:239
nim_session_multi_change_cb_func
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:71
nim_session_query_sessiondata_by_id_cb_func
void(* nim_session_query_sessiondata_by_id_cb_func)(int rescode, const char *result, const void *user_data)
Definition: nim_session_def.h:104
nim_session_set_to_stick_top_cb_func
void(* nim_session_set_to_stick_top_cb_func)(int rescode, const char *stick_session, const void *user_data)
Definition: nim_session_def.h:130
kNIMSessionMsgType
static const char * kNIMSessionMsgType
int, 本地消息历史中该会话最后一条消息的类型 见NIMMessageType
Definition: nim_session_def.h:201
kNIMSessionCommandRemoveAll
@ kNIMSessionCommandRemoveAll
Definition: nim_session_def.h:26
nim_session_delete_session_hasmore_roammsg_cb_func
void(* nim_session_delete_session_hasmore_roammsg_cb_func)(int rescode, const void *user_data)
Definition: nim_session_def.h:305
kNIMSessionRoamMsgHasMoreMsgServerID
static const char * kNIMSessionRoamMsgHasMoreMsgServerID
string, 界定消息的服务端ID
Definition: nim_session_def.h:230
nim_session_set_to_stick_top_notify_cb_func
void(* nim_session_set_to_stick_top_notify_cb_func)(const char *stick_session, const void *user_data)
Definition: nim_session_def.h:157
kNIMSessionLastUpdatedMsg
static const char * kNIMSessionLastUpdatedMsg
bool, (批量)消息变更或增加时是否是最后一条变更的信息
Definition: nim_session_def.h:211
kNIMSessionMsgTime
static const char * kNIMSessionMsgTime
long, 本地消息历史中该会话最后一条消息的时间
Definition: nim_session_def.h:199
kNIMSessionListUnreadCount
static const char * kNIMSessionListUnreadCount
int, 总未读数
Definition: nim_session_def.h:183
kNIMSessionStickTopInfoUpdateTime
static const char * kNIMSessionStickTopInfoUpdateTime
uint64_t 更新置顶的时间戳
Definition: nim_session_def.h:249
kNIMSessionOnTop
static const char * kNIMSessionOnTop
bool, 是否置顶
Definition: nim_session_def.h:213
nim_session_change_cb_func
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:61
kNIMSessionRobotFlag
static const char * kNIMSessionRobotFlag
bool, 是否为机器人会话, 默认为false
Definition: nim_session_def.h:217
kNIMSessionCommandRemoveAllP2P
@ kNIMSessionCommandRemoveAllP2P
Definition: nim_session_def.h:27
kNIMSessionListContent
static const char * kNIMSessionListContent
json object (Keys as follows), 会话列表项内容
Definition: nim_session_def.h:185
nim_session_badge_count_cb_func
int(* nim_session_badge_count_cb_func)(const char *json_extension, const void *user_data)
Definition: nim_session_def.h:112
SessionRoamMsgHasMoreTagInfo
Definition: nim_session_def.h:44
kNIMSessionCommandAllSuperTeamMsgDeleted
@ kNIMSessionCommandAllSuperTeamMsgDeleted
Definition: nim_session_def.h:35
kNIMSessionMsgAttach
static const char * kNIMSessionMsgAttach
string, 本地消息历史中该会话最后一条消息的attach
Definition: nim_session_def.h:205
kNIMSessionMsgClientID
static const char * kNIMSessionMsgClientID
string, 本地消息历史中该会话最后一条消息的客户端ID唯一标识,即消息uuid
Definition: nim_session_def.h:195
kNIMSessionStickTopInfoType
static const char * kNIMSessionStickTopInfoType
int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)
Definition: nim_session_def.h:243
kNIMSessionMsgFromAccount
static const char * kNIMSessionMsgFromAccount
string, 本地消息历史中该会话最后一条消息的发送方帐号
Definition: nim_session_def.h:197
kNIMSessionUnReadCountSessionId
static const char * kNIMSessionUnReadCountSessionId
string, 会话id
Definition: nim_session_def.h:260
kNIMSessionCommandAllP2PMsgDeleted
@ kNIMSessionCommandAllP2PMsgDeleted
Definition: nim_session_def.h:31
kNIMSessionStickTopInfoExt
static const char * kNIMSessionStickTopInfoExt
string, 扩展字段
Definition: nim_session_def.h:245
nim_session_cancel_stick_top_cb_func
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:140
kNIMSessionCommandRemove
@ kNIMSessionCommandRemove
Definition: nim_session_def.h:25
kNIMSessionCommandAdd
@ kNIMSessionCommandAdd
Definition: nim_session_def.h:24
kNIMSessionCommandRemoveAllTeam
@ kNIMSessionCommandRemoveAllTeam
Definition: nim_session_def.h:28
kNIMSessionListCount
static const char * kNIMSessionListCount
int, 会话列表项数量
Definition: nim_session_def.h:181
nim_session_cancel_stick_top_notify_cb_func
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:166
nim_session_update_session_hasmore_roammsg_cb_func
void(* nim_session_update_session_hasmore_roammsg_cb_func)(int rescode, const void *user_data)
Definition: nim_session_def.h:297
nim_session_delete_session_roaming_cb_func
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:81
kNIMSessionMsgSubStatus
static const char * kNIMSessionMsgSubStatus
int, 本地消息历史中该会话最后一条消息的子状态,见NIMMsgLogSubStatus
Definition: nim_session_def.h:209
kNIMSessionTypeTeam
@ kNIMSessionTypeTeam
Definition: nim_session_def.h:18
kNIMSessionCommandRemoveAllSuperTeam
@ kNIMSessionCommandRemoveAllSuperTeam
Definition: nim_session_def.h:34
kNIMSessionUnreadCount
static const char * kNIMSessionUnreadCount
int, 本地消息历史中该会话未读消息数量
Definition: nim_session_def.h:191
kNIMSessionRoamMsgHasMoreId
static const char * kNIMSessionRoamMsgHasMoreId
string, 会话id
Definition: nim_session_def.h:226
kNIMSessionStickTopInfoSessionId
static const char * kNIMSessionStickTopInfoSessionId
string, 会话id
Definition: nim_session_def.h:241
nim_session_query_recent_session_cb_func
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:92
public_defines.h
NIM SDK 及 NIM ChatRoom SDK 公用头文件
kNIMSessionUnReadCountSessionType
static const char * kNIMSessionUnReadCountSessionType
enum NIMSessionType, 会话类型
Definition: nim_session_def.h:258
kNIMSessionCommand
static const char * kNIMSessionCommand
int, 会话项操作命令NIMSessionCommand
Definition: nim_session_def.h:193
nim_session_query_session_hasmore_roammsg_cb_func
void(* nim_session_query_session_hasmore_roammsg_cb_func)(int rescode, const SessionRoamMsgHasMoreTagInfo *tag_info, const void *user_data)
Definition: nim_session_def.h:273
kNIMSessionRoamMsgHasMoreType
static const char * kNIMSessionRoamMsgHasMoreType
int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)
Definition: nim_session_def.h:228
NIMSessionCommand
NIMSessionCommand
Definition: nim_session_def.h:23
kNIMSessionExtendedData
static const char * kNIMSessionExtendedData
string, 本地扩展字段, 限4096
Definition: nim_session_def.h:215
kNIMSessionMsgStatus
static const char * kNIMSessionMsgStatus
int, 本地消息历史中该会话最后一条消息的状态,见NIMMsgLogStatus
Definition: nim_session_def.h:207
kNIMSessionCommandAllTeamMsgDeleted
@ kNIMSessionCommandAllTeamMsgDeleted
Definition: nim_session_def.h:32
nim_session_update_stick_top_cb_func
void(* nim_session_update_stick_top_cb_func)(int rescode, const char *stick_session, const void *user_data)
Definition: nim_session_def.h:149
NIMSessionType
NIMSessionType
Definition: nim_session_def.h:16
kNIMSessionType
static const char * kNIMSessionType
int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)
Definition: nim_session_def.h:189
kNIMSessionCommandAllMsgDeleted
@ kNIMSessionCommandAllMsgDeleted
Definition: nim_session_def.h:30
kNIMSessionId
static const char * kNIMSessionId
string, 会话id
Definition: nim_session_def.h:187
nim_session_update_stick_top_notify_cb_func
void(* nim_session_update_stick_top_notify_cb_func)(const char *stick_session, const void *user_data)
Definition: nim_session_def.h:174
nim_session_query_all_session_hasmore_roammsg_cb_func
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:286
kNIMSessionCommandMsgDeleted
@ kNIMSessionCommandMsgDeleted
Definition: nim_session_def.h:29
kNIMSessionTypeP2P
@ kNIMSessionTypeP2P
Definition: nim_session_def.h:17
kNIMSessionStickTopInfoCreateTime
static const char * kNIMSessionStickTopInfoCreateTime
uint64_t 设置置顶的时间戳
Definition: nim_session_def.h:247
kNIMSessionCommandUpdate
@ kNIMSessionCommandUpdate
Definition: nim_session_def.h:33
kNIMSessionStickTopInfo
static const char * kNIMSessionStickTopInfo
json object, 置顶信息 (v7.6.0添加),该置顶信息会进行多端同步,不建议再使用 kNIMSessionOnTop
Definition: nim_session_def.h:219
kNIMSessionMsgBody
static const char * kNIMSessionMsgBody
string, 本地消息历史中该会话最后一条消息的内容
Definition: nim_session_def.h:203
kNIMSessionStickTopSessionData
static const char * kNIMSessionStickTopSessionData
json object 会话信息
Definition: nim_session_def.h:251