NIM CPP SDK  8.0.0
Classes | Typedefs | Enumerations
nim_session_def.h File Reference

最近会话列表 接口相关的常量函数等定义头文件 More...

#include "public_define/nim_util_include.h"

Go to the source code of this file.

Classes

struct  SessionMainTagInfo
 
struct  SessionRoamMsgHasMoreTagInfo
 

Typedefs

typedef void(* nim_session_change_cb_func) (int rescode, const char *result, int total_unread_counts, const char *json_extension, const void *user_data)
 
typedef void(* nim_session_delete_session_roaming_cb_func) (int rescode, const char *to_type, const char *id, const void *user_data)
 
typedef void(* nim_session_query_recent_session_cb_func) (int total_unread_count, const char *result, const char *json_extension, const void *user_data)
 
typedef void(* nim_session_query_sessiondata_by_id_cb_func) (int rescode, const char *result, const void *user_data)
 
typedef int(* nim_session_badge_count_cb_func) (const char *json_extension, const void *user_data)
 
typedef void(* nim_session_query_stick_top_session_list_cb_func) (int rescode, const char *result, const void *user_data)
 
typedef void(* nim_session_set_to_stick_top_cb_func) (int rescode, const char *stick_session, const void *user_data)
 
typedef void(* nim_session_cancel_stick_top_cb_func) (int rescode, const char *session_id, enum NIMSessionType to_type, const void *user_data)
 
typedef void(* nim_session_update_stick_top_cb_func) (int rescode, const char *stick_session, const void *user_data)
 
typedef void(* nim_session_set_to_stick_top_notify_cb_func) (const char *stick_session, const void *user_data)
 
typedef void(* nim_session_cancel_stick_top_notify_cb_func) (const char *session_id, enum NIMSessionType to_type, const void *user_data)
 
typedef void(* nim_session_update_stick_top_notify_cb_func) (const char *stick_session, const void *user_data)
 
typedef void(* nim_session_query_session_hasmore_roammsg_cb_func) (int rescode, const SessionRoamMsgHasMoreTagInfo *tag_info, const void *user_data)
 
typedef void(* nim_session_query_all_session_hasmore_roammsg_cb_func) (int rescode, const SessionRoamMsgHasMoreTagInfo *tag_info_list, int size, const void *user_data)
 
typedef void(* nim_session_update_session_hasmore_roammsg_cb_func) (int rescode, const void *user_data)
 
typedef void(* nim_session_delete_session_hasmore_roammsg_cb_func) (int rescode, const void *user_data)
 

Enumerations

enum  NIMSessionType { kNIMSessionTypeP2P = 0, kNIMSessionTypeTeam = 1, kNIMSessionTypeSuperTeam = 5 }
 
enum  NIMSessionCommand {
  kNIMSessionCommandAdd = 0, kNIMSessionCommandRemove = 1, kNIMSessionCommandRemoveAll = 2, kNIMSessionCommandRemoveAllP2P = 3,
  kNIMSessionCommandRemoveAllTeam = 4, kNIMSessionCommandMsgDeleted = 5, kNIMSessionCommandAllMsgDeleted = 6, kNIMSessionCommandAllP2PMsgDeleted = 7,
  kNIMSessionCommandAllTeamMsgDeleted = 8, kNIMSessionCommandUpdate = 9, kNIMSessionCommandRemoveAllSuperTeam = 10, kNIMSessionCommandAllSuperTeamMsgDeleted = 11
}
 

Variables

会话列表的Json Keys
static const char * kNIMSessionListCount = "count"
 
static const char * kNIMSessionListUnreadCount = "unread_counts"
 
static const char * kNIMSessionListContent = "content"
 
static const char * kNIMSessionId = "id"
 
static const char * kNIMSessionType = "type"
 
static const char * kNIMSessionUnreadCount = "unread_count"
 
static const char * kNIMSessionCommand = "command"
 
static const char * kNIMSessionMsgClientID = "msg_client_id"
 
static const char * kNIMSessionMsgFromAccount = "msg_from_account"
 
static const char * kNIMSessionMsgTime = "msg_time"
 
static const char * kNIMSessionMsgType = "msg_type"
 
static const char * kNIMSessionMsgBody = "msg_body"
 
static const char * kNIMSessionMsgAttach = "msg_attach"
 
static const char * kNIMSessionMsgStatus = "msg_status"
 
static const char * kNIMSessionMsgSubStatus = "msg_sub_status"
 
static const char * kNIMSessionLastUpdatedMsg = "last_updated_msg"
 
static const char * kNIMSessionOnTop = "top"
 
static const char * kNIMSessionExtendedData = "extend_data"
 
static const char * kNIMSessionRobotFlag = "robot_session"
 
static const char * kNIMSessionStickTopInfo = "stick_top_info"
 
会话漫游消息未完待取的Json Keys(v7.6.0添加)
static const char * kNIMSessionRoamMsgHasMoreId = "id"
 
static const char * kNIMSessionRoamMsgHasMoreType = "type"
 
static const char * kNIMSessionRoamMsgHasMoreMsgServerID = "msg_server_id"
 
static const char * kNIMSessionRoamMsgHasMoreMsgTime = "msg_time"
 
置顶会话Json Keys(v7.6.0添加)
static const char * kNIMSessionStickTopInfoTop = "top"
 
static const char * kNIMSessionStickTopInfoSessionId = "id"
 
static const char * kNIMSessionStickTopInfoType = "type"
 
static const char * kNIMSessionStickTopInfoExt = "ext"
 
static const char * kNIMSessionStickTopInfoCreateTime = "create_time"
 
static const char * kNIMSessionStickTopInfoUpdateTime = "update_time"
 
static const char * kNIMSessionStickTopSessionData = "session_data"
 

Detailed Description

最近会话列表 接口相关的常量函数等定义头文件

Author
Oleg
Date
2015/2/1

Typedef Documentation

◆ nim_session_badge_count_cb_func

int(* nim_session_badge_count_cb_func)(const char *json_extension, const void *user_data)

获取badge回调(仅支持iOS)

Parameters
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
int badge数量

◆ 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)

取消会话置顶回调

Parameters
[out]rescode操作结果,成功200
[out]session_id会话id
[out]to_type会话类型
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ 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)

取消会话置顶通知回调

Parameters
[out]session_id被取消息的会话id
[out]to_type会话类型
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ 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)

最近会话项更新通知的回调函数定义

Parameters
[out]rescode操作结果,成功200
[out]result最近会话Json string (『会话列表的Json Keys』 as follows 不包含消息的字段)
[out]total_unread_counts总的未读数目
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ nim_session_delete_session_hasmore_roammsg_cb_func

void(* nim_session_delete_session_hasmore_roammsg_cb_func)(int rescode)

删除会话漫游消息未完待拉信息结果回调

Parameters
[out]rescode操作结果,成功200
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ 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)

最近会话项更新通知的回调函数定义

Parameters
[out]rescode操作结果,成功200
[out]to_type会话类型
[out]id对方的account id或者群组tid
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ 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)

查询所有漫游消息未完待拉会话结果回调

Parameters
[out]rescode操作结果,成功200
[out]tag_info_list会话漫游消息未完待拉信息头指针,与size一起配合使用例如 for(int index = 0;index < size;index++ )tag_info_list++;
[out]size结果列表的长度,
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ 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)

查询所有最近会话项的回调函数定义

Parameters
[out]total_unread_counts总的未读数目
[out]result最近会话列表Json string (『会话列表的Json Keys』 as follows)
[out]json_extensionjson扩展数据(备用)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ 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)

查询会话漫游消息未完待拉信息结果回调

Parameters
[out]rescode操作结果,成功200
[out]tag_info会话漫游消息未完待拉信息
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ 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)

查询所有最近会话项的回调函数定义

Parameters
[out]rescode操作结果,成功200
[out]result会话信息 (『会话信息的Json Keys』 as follows)
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void 无返回值

◆ 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)

获取置顶会话列表回调

Parameters
[out]rescode操作结果,成功200
[out]result置顶会话信息列表 jsonarray
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ nim_session_set_to_stick_top_cb_func

void(* nim_session_set_to_stick_top_cb_func)(int rescode, const char *result, const void *user_data)

会话置顶回调

Parameters
[out]rescode操作结果,成功200
[out]stick_session置顶会话信息
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ 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)

会话置顶通知回调

Parameters
[out]stick_session置顶会话信息
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ nim_session_update_session_hasmore_roammsg_cb_func

void(* nim_session_update_session_hasmore_roammsg_cb_func)(int rescode)

更新会话漫游消息未完待拉信息结果回调

Parameters
[out]rescode操作结果,成功200
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ 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)

更新会话置顶ext字段回调

Parameters
[out]rescode操作结果,成功200
[out]stick_session置顶会话信息
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

◆ 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)

更新置顶会话信息通知回调

Parameters
[out]stick_session置顶会话信息
[out]user_dataAPP的自定义用户数据,SDK只负责传回给回调函数,不做任何处理!
Returns
void

Enumeration Type Documentation

◆ NIMSessionCommand

会话操作命令

Enumerator
kNIMSessionCommandAdd 

添加会话项

kNIMSessionCommandRemove 

删除单个会话项

kNIMSessionCommandRemoveAll 

删除所有会话项

kNIMSessionCommandRemoveAllP2P 

删除所有点对点的会话项

kNIMSessionCommandRemoveAllTeam 

删除所有群的会话项

kNIMSessionCommandMsgDeleted 

单个会话项的消息已删除

kNIMSessionCommandAllMsgDeleted 

所有会话项的消息已删除

kNIMSessionCommandAllP2PMsgDeleted 

所有点对点会话项的消息已删除

kNIMSessionCommandAllTeamMsgDeleted 

所有群会话项的消息已删除

kNIMSessionCommandUpdate 

更新会话项

kNIMSessionCommandRemoveAllSuperTeam 

删除所有超大群的会话项

kNIMSessionCommandAllSuperTeamMsgDeleted 

所有超大群会话项的消息已删除

◆ NIMSessionType

会话类型

Enumerator
kNIMSessionTypeP2P 

个人,即点对点

kNIMSessionTypeTeam 

群组

kNIMSessionTypeSuperTeam 

超大群组

Variable Documentation

◆ kNIMSessionCommand

const char* kNIMSessionCommand = "command"
static

int, 会话项操作命令NIMSessionCommand

◆ kNIMSessionExtendedData

const char* kNIMSessionExtendedData = "extend_data"
static

string, 本地扩展字段, 限4096

◆ kNIMSessionId

const char* kNIMSessionId = "id"
static

string, 会话id

◆ kNIMSessionLastUpdatedMsg

const char* kNIMSessionLastUpdatedMsg = "last_updated_msg"
static

bool, (批量)消息变更或增加时是否是最后一条变更的信息

◆ kNIMSessionListContent

const char* kNIMSessionListContent = "content"
static

json object (Keys as follows), 会话列表项内容

◆ kNIMSessionListCount

const char* kNIMSessionListCount = "count"
static

int, 会话列表项数量

◆ kNIMSessionListUnreadCount

const char* kNIMSessionListUnreadCount = "unread_counts"
static

int, 总未读数

◆ kNIMSessionMsgAttach

const char* kNIMSessionMsgAttach = "msg_attach"
static

string, 本地消息历史中该会话最后一条消息的attach

◆ kNIMSessionMsgBody

const char* kNIMSessionMsgBody = "msg_body"
static

string, 本地消息历史中该会话最后一条消息的内容

◆ kNIMSessionMsgClientID

const char* kNIMSessionMsgClientID = "msg_client_id"
static

string, 本地消息历史中该会话最后一条消息的客户端ID唯一标识,即消息uuid

◆ kNIMSessionMsgFromAccount

const char* kNIMSessionMsgFromAccount = "msg_from_account"
static

string, 本地消息历史中该会话最后一条消息的发送方帐号

◆ kNIMSessionMsgStatus

const char* kNIMSessionMsgStatus = "msg_status"
static

int, 本地消息历史中该会话最后一条消息的状态,见NIMMsgLogStatus

◆ kNIMSessionMsgSubStatus

const char* kNIMSessionMsgSubStatus = "msg_sub_status"
static

int, 本地消息历史中该会话最后一条消息的子状态,见NIMMsgLogSubStatus

◆ kNIMSessionMsgTime

const char* kNIMSessionMsgTime = "msg_time"
static

long, 本地消息历史中该会话最后一条消息的时间

◆ kNIMSessionMsgType

const char* kNIMSessionMsgType = "msg_type"
static

int, 本地消息历史中该会话最后一条消息的类型 见NIMMessageType

◆ kNIMSessionOnTop

const char* kNIMSessionOnTop = "top"
static

bool, 是否置顶

◆ kNIMSessionRoamMsgHasMoreId

const char* kNIMSessionRoamMsgHasMoreId = "id"
static

string, 会话id

◆ kNIMSessionRoamMsgHasMoreMsgServerID

const char* kNIMSessionRoamMsgHasMoreMsgServerID = "msg_server_id"
static

string, 界定消息的服务端ID

◆ kNIMSessionRoamMsgHasMoreMsgTime

const char* kNIMSessionRoamMsgHasMoreMsgTime = "msg_time"
static

uint64_t, 最早一条漫游消息的时间戳

◆ kNIMSessionRoamMsgHasMoreType

const char* kNIMSessionRoamMsgHasMoreType = "type"
static

int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)

◆ kNIMSessionRobotFlag

const char* kNIMSessionRobotFlag = "robot_session"
static

bool, 是否为机器人会话, 默认为false

◆ kNIMSessionStickTopInfo

const char* kNIMSessionStickTopInfo = "stick_top_info"
static

json object, 置顶信息 (v7.6.0添加),该置顶信息会进行多端同步,不建议再使用 kNIMSessionOnTop

◆ kNIMSessionStickTopInfoCreateTime

const char* kNIMSessionStickTopInfoCreateTime = "create_time"
static

uint64_t 设置置顶的时间戳

◆ kNIMSessionStickTopInfoExt

const char* kNIMSessionStickTopInfoExt = "ext"
static

string, 扩展字段

◆ kNIMSessionStickTopInfoSessionId

const char* kNIMSessionStickTopInfoSessionId = "id"
static

string, 会话id

◆ kNIMSessionStickTopInfoTop

const char* kNIMSessionStickTopInfoTop = "top"
static

bool, 是否置顶

◆ kNIMSessionStickTopInfoType

const char* kNIMSessionStickTopInfoType = "type"
static

int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)

◆ kNIMSessionStickTopInfoUpdateTime

const char* kNIMSessionStickTopInfoUpdateTime = "update_time"
static

uint64_t 更新置顶的时间戳

◆ kNIMSessionStickTopSessionData

const char* kNIMSessionStickTopSessionData = "session_data"
static

json object 会话信息

◆ kNIMSessionType

const char* kNIMSessionType = "type"
static

int, 会话类型(见NIMSessionType 个人0 群组1 超大群5 etc)

◆ kNIMSessionUnreadCount

const char* kNIMSessionUnreadCount = "unread_count"
static

int, 本地消息历史中该会话未读消息数量