NIM SDK API
9.0.0
|
会话列表管理功能;主要包括查询会话列表、删除会话列表等功能 More...
#include <nim_cpp_session.h>
Public Types | |
typedef std::function< int32_t(const std::string &)> | BadgeCountCallback |
typedef std::function< void(nim::NIMResCode, const SessionData &, int)> | ChangeCallback |
typedef std::function< void(int, const SessionDataList &)> | QuerySessionListCallabck |
typedef ChangeCallback | DeleteRecentSessionCallabck |
typedef ChangeCallback | DeleteAllRecentSessionCallabck |
typedef ChangeCallback | SetUnreadCountZeroCallback |
typedef std::function< void(nim::NIMResCode, const std::list< SessionData > &session_data_list, int unread_count)> | SetMultiUnreadCountZeroCallback |
typedef std::function< void(nim::NIMResCode, const SessionData &)> | QuerySessionDataCallback |
typedef std::function< void(const StickTopSession &)> | SetToStickTopSessionNotifyCallback |
typedef std::function< void(const std::string &session_id, nim::NIMSessionType)> | CancelStickTopSessionNotifyCallback |
typedef std::function< void(const StickTopSession &)> | UpdateStickTopSessionNotifyCallback |
typedef std::function< void(nim::NIMResCode, const StickTopSession &)> | SetToStickTopSessionCallback |
typedef std::function< void(nim::NIMResCode, const std::string &session_id, nim::NIMSessionType)> | CancelStickTopSessionCallback |
typedef std::function< void(nim::NIMResCode, const StickTopSession &)> | UpdateStickTopSessionCallback |
typedef std::function< void(nim::NIMResCode, const StickTopSessionList &)> | QueryStickTopSessionListCallback |
typedef std::function< void(nim::NIMResCode, const SessionRoamMsgHasMoreTagInfo &info)> | QueryHasmoreRoammsgCallback |
typedef std::function< void(nim::NIMResCode, const std::list< SessionRoamMsgHasMoreTagInfo > &info_list)> | QueryAllHasmoreRoammsgCallback |
typedef std::function< void(nim::NIMResCode)> | UpdateHasmoreRoammsgCallback |
typedef std::function< void(nim::NIMResCode)> | DeleteHasmoreRoammsgCallback |
typedef std::function< void(nim::NIMResCode, nim::NIMSessionType, const std::string &session_id)> | DeleteSessionRoammsgCallback |
Static Public Member Functions | |
static void | RegChangeCb (const ChangeCallback &cb, const std::string &json_extension="") |
static void | RegBadgeCountCb (const BadgeCountCallback &cb, const std::string &json_extension="") |
static void | QueryLastFewSessionAsync (int limit, const QuerySessionListCallabck &cb, const std::string &json_extension="") |
static void | QueryAllRecentSessionAsync (const QuerySessionListCallabck &cb, const std::string &json_extension="") |
static void | QueryAllRecentSessionAsync (NIMMessageType last_msg_excluded_type, const QuerySessionListCallabck &cb, const std::string &json_extension="") |
static void | QueryAllRecentSessionAsyncEx (const std::list< NIMMessageType > &last_msg_excluded_type, const QuerySessionListCallabck &cb, const std::string &json_extension="") |
static bool | DeleteRecentSession (nim::NIMSessionType to_type, const std::string &id, const DeleteRecentSessionCallabck &cb, const std::string &json_extension="") |
static bool | DeleteRecentSessionEx (nim::NIMSessionType to_type, const std::string &id, const DeleteRecentSessionCallabck &cb, bool delete_roaming) |
static bool | DeleteSessionRoamingMessage (nim::NIMSessionType to_type, const std::string &id, const DeleteSessionRoammsgCallback &cb, const std::string &json_extension="") |
static void | DeleteAllRecentSession (const DeleteAllRecentSessionCallabck &cb, const std::string &json_extension="") |
static bool | SetUnreadCountZeroAsync (nim::NIMSessionType to_type, const std::string &id, const SetUnreadCountZeroCallback &cb, const std::string &json_extension="") |
static bool | SetMultiUnreadCountZeroAsync (bool super_team, const std::list< MultiUnreadCountZeroInfo > &unread_zero_info_list, const SetMultiUnreadCountZeroCallback &cb) |
static bool | SetSessionTop (enum NIMSessionType to_type, const std::string &id, bool top, const ChangeCallback &cb, const std::string &json_extension="") |
static bool | SetSessionExtendData (enum NIMSessionType to_type, const std::string &id, const std::string &data, const ChangeCallback &cb, const std::string &json_extension="") |
static bool | SetAllUnreadCountZeroAsync (const SetUnreadCountZeroCallback &cb, const std::string &json_extension="") |
static void | QuerySessionDataById (NIMSessionType to_type, const std::string &id, const QuerySessionDataCallback &cb, const std::string &json_extension="") |
static void | RegSetToStickTopSessionNotifyCB (const SetToStickTopSessionNotifyCallback &cb) |
static void | RegCancelStickTopSessionNotifyCB (const CancelStickTopSessionNotifyCallback &cb) |
static void | RegUpdateStickTopSessionNotifyCB (const UpdateStickTopSessionNotifyCallback &cb) |
static void | QueryStickTopSessionList (const QueryStickTopSessionListCallback &cb) |
static void | SetToStickTopSession (const std::string &session_id, nim::NIMSessionType to_type, const std::string &ext, const SetToStickTopSessionCallback &cb) |
static void | UpdateToStickTopSession (const std::string &session_id, nim::NIMSessionType to_type, const std::string &ext, const UpdateStickTopSessionCallback &cb) |
static void | CancelToStickTopSession (const std::string &session_id, nim::NIMSessionType to_type, const CancelStickTopSessionCallback &cb) |
static void | QueryHasmoreRoammsg (const std::string &session_id, nim::NIMSessionType to_type, const QueryHasmoreRoammsgCallback &cb) |
static void | QueryAllHasmoreRoammsg (const QueryAllHasmoreRoammsgCallback &cb) |
static void | UpdateHasmoreRoammsg (const IMMessage &msg, const UpdateHasmoreRoammsgCallback &cb) |
static void | DeleteHasmoreRoammsg (const std::string &session_id, nim::NIMSessionType to_type, const DeleteHasmoreRoammsgCallback &cb) |
static void | UnregSessionCb () |
会话列表管理功能;主要包括查询会话列表、删除会话列表等功能
typedef std::function<int32_t(const std::string&)> nim::Session::BadgeCountCallback |
app角标未读计数通知回调模板 (仅iOS有效)
typedef std::function<void(nim::NIMResCode, const std::string& session_id, nim::NIMSessionType)> nim::Session::CancelStickTopSessionCallback |
取消置顶会话回调模板
typedef std::function<void(const std::string& session_id, nim::NIMSessionType)> nim::Session::CancelStickTopSessionNotifyCallback |
取消置顶会话通知回调模板
typedef std::function<void(nim::NIMResCode, const SessionData&, int)> nim::Session::ChangeCallback |
会话变更通知回调模板
删除全部会话回调模板
typedef std::function<void(nim::NIMResCode)> nim::Session::DeleteHasmoreRoammsgCallback |
删除会话是漫游消息未拉取信息回调模板
删除会话回调模板
typedef std::function<void(nim::NIMResCode, nim::NIMSessionType, const std::string& session_id)> nim::Session::DeleteSessionRoammsgCallback |
删除会话是漫游消息未拉取信息回调模板
typedef std::function<void(nim::NIMResCode, const std::list<SessionRoamMsgHasMoreTagInfo>& info_list)> nim::Session::QueryAllHasmoreRoammsgCallback |
查询所有漫游消息未拉取完全的会话回调模板
typedef std::function<void(nim::NIMResCode, const SessionRoamMsgHasMoreTagInfo& info)> nim::Session::QueryHasmoreRoammsgCallback |
查询会话是漫游消息未拉取信息回调模板
typedef std::function<void(nim::NIMResCode, const SessionData&)> nim::Session::QuerySessionDataCallback |
会话信息查询结果回调模板
typedef std::function<void(int, const SessionDataList&)> nim::Session::QuerySessionListCallabck |
查询会话列表回调模板
typedef std::function<void(nim::NIMResCode, const StickTopSessionList&)> nim::Session::QueryStickTopSessionListCallback |
查询置顶会话列表回调模板
typedef std::function<void(nim::NIMResCode, const std::list<SessionData>& session_data_list, int unread_count)> nim::Session::SetMultiUnreadCountZeroCallback |
多条会话未读消息数清零回调模板
typedef std::function<void(nim::NIMResCode, const StickTopSession&)> nim::Session::SetToStickTopSessionCallback |
置顶会话回调模板
typedef std::function<void(const StickTopSession&)> nim::Session::SetToStickTopSessionNotifyCallback |
置顶会话通知回调模板
会话未读消息数清零回调模板
typedef std::function<void(nim::NIMResCode)> nim::Session::UpdateHasmoreRoammsgCallback |
更新会话是漫游消息未拉取信息回调模板
typedef std::function<void(nim::NIMResCode, const StickTopSession&)> nim::Session::UpdateStickTopSessionCallback |
更新置顶会话回调模板
typedef std::function<void(const StickTopSession&)> nim::Session::UpdateStickTopSessionNotifyCallback |
更新置顶会话通知回调模板
|
static |
取消置顶会话列表
[in] | session_id | 会话id |
[in] | to_type | 会话类型 |
[in] | cb | 取消置顶会话设置结果的回调函数 |
|
static |
删除全部最近联系人
[in] | json_extension | json扩展参数(备用,目前不需要) |
[in] | cb | 最近会话列表项变更的回调函数 |
|
static |
删除会话是漫游消息未拉取信息
[in] | session_id | 会话id |
[in] | to_type | 会话类型 |
[in] | cb | 结果回调 |
|
static |
删除最近联系人
[in] | to_type | 会话类型,双人0,群组1 (nim_msglog_def.h) |
[in] | id | 对方的account id或者群组tid。 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
[in] | cb | 最近会话列表项变更的回调函数 |
|
static |
删除最近联系人
[in] | to_type | 会话类型,双人0,群组1 (nim_msglog_def.h) |
[in] | id | 对方的account id或者群组tid。 |
[in] | delete_roaming | 是否同时删除漫游消息 |
[in] | cb | 最近会话列表项变更的回调函数 |
|
static |
删除某会话的漫游消息
[in] | to_type | 会话类型,双人0,群组1 (nim_msglog_def.h) |
[in] | id | 对方的account id或者群组tid。 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
[in] | cb | 删除结果 回调回调函数 |
|
static |
查询所有漫游消息未拉取完全的会话
[in] | cb | 结果回调 |
|
static |
查询会话列表
[in] | cb | 查询会话列表的回调函数 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
|
static |
查询会话列表,可指定最后一条会话消息要排除掉的类型
[in] | last_msg_excluded_type | 最后一条会话消息要排除掉的类型,如果不排除任何消息,参数请传入NIMMessageType::kNIMMessageTypeUnknown |
[in] | cb | 查询会话列表的回调函数 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
|
static |
查询会话列表,可指定最后一条会话消息要排除掉的类型(列表)
[in] | last_msg_excluded_type | 最后一条会话消息要排除掉的类型(列表),如果不排除任何消息,传入空列表 |
[in] | cb | 查询会话列表的回调函数 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
|
static |
查询会话是漫游消息未拉取信息
[in] | session_id | 会话id |
[in] | to_type | 会话类型 |
[in] | cb | 查询会话是漫游消息未拉取信息回调函数 |
|
static |
查询指定数量的最后会话数据
[in] | limit | 要返回的最大数量 |
[in] | cb | 查询会话列表的回调函数 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
|
static |
根据给定的id查询相应会话的信息
[in] | to_type | 会话类型 |
[in] | id | 对方的account id或者群组tid。 |
[in] | cb | 会话信息查询结果的回调函数 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
|
static |
查询置顶会话列表
[in] | cb | 置顶会话列表查询结果的回调函数 |
|
static |
(全局回调)注册app角标计数回调(仅iOS有效)
[in] | json_extension | json扩展参数(备用,目前不需要) |
[in] | cb | app角标未读计数回调函数 |
|
static |
(全局回调)注册取消置顶会话通知回调
[in] | cb | 取消置顶会话通知回调模板 |
|
static |
(全局回调)注册最近会话列表项变更通知
[in] | json_extension | json扩展参数(备用,目前不需要) |
[in] | cb | 最近会话列表项变更的回调函数 |
|
static |
(全局回调)注册置顶会话通知回调
[in] | cb | 置顶会话通知回调模板 |
|
static |
(全局回调)注册更新置顶会话通知回调
[in] | cb | 更新置顶会话通知回调模板 |
|
static |
最近联系人项全部未读数清零
[in] | json_extension | json扩展参数(备用,目前不需要) |
[in] | cb | 最近会话列表项变更的回调函数 |
|
static |
最近联系人项未读数清零
[in] | super_team | 会话列表中的会话是否是超大群会话 |
[in] | unread_zero_info_list | 清零的会话信息列表。 |
[in] | cb | 最近会话列表项变更的回调函数 |
|
static |
设置会话项扩展数据(扩展数据只保存在本地)
[in] | to_type | 会话类型 |
[in] | id | 对方的account id或者群组tid。 |
[in] | data | 扩展数据,建议使用灵活可扩展的数据结构,例如Json |
[in] | cb | 回调函数 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
|
static |
设置会话项是否置顶(置顶属性只保存在本地)
[in] | to_type | 会话类型 |
[in] | id | 对方的account id或者群组tid。 |
[in] | top | true - 置顶 false - 取消置顶 |
[in] | cb | 回调函数 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
|
static |
设置置顶会话
[in] | session_id | 会话id |
[in] | to_type | 会话类型 |
[in] | ext | 扩展字段 |
[in] | cb | 置顶会话设置结果的回调函数 |
|
static |
最近联系人项未读数清零
[in] | to_type | 会话类型,双人0,群组1 (nim_msglog_def.h) |
[in] | id | 对方的account id或者群组tid。 |
[in] | json_extension | json扩展参数(备用,目前不需要) |
[in] | cb | 最近会话列表项变更的回调函数 |
|
static |
反注册Session提供的所有回调
|
static |
查询会话是漫游消息未拉取信息
[in] | msg | 对应的消息内容 |
[in] | cb | 结果回调 |
|
static |
更新置顶会话列表
[in] | session_id | 会话id |
[in] | to_type | 会话类型 |
[in] | ext | 扩展字段 |
[in] | cb | 更新置顶会话设置结果的回调函数 |