NIM CPP SDK  7.8.1
Public Types | Static Public Member Functions | List of all members
nim_chatroom::ChatRoom Class Reference

聊天室 More...

#include <nim_chatroom_cpp.h>

Public Types

typedef std::function< void(const std::function< void()> &)> SDKClosure
 
typedef std::function< void(int64_t room_id, const NIMChatRoomEnterStep step, int error_code, const ChatRoomInfo &info, const ChatRoomMemberInfo &my_info)> EnterCallback
 
typedef std::function< void(int64_t room_id, int error_code, NIMChatRoomExitReason exit_reason)> ExitCallback
 
typedef std::function< void(int64_t room_id, int error_code, const NIMChatRoomExitReasonInfo &exit_info)> ExitCallback_2
 
typedef std::function< void(int64_t room_id, int error_code, const ChatRoomMessage &result)> SendMsgAckCallback
 
typedef std::function< void(int64_t room_id, const ChatRoomMessage &result)> ReceiveMsgCallback
 
typedef std::function< void(int64_t room_id, const std::list< ChatRoomMessage > &result)> ReceiveMsgsCallback
 
typedef std::function< void(int64_t room_id, const ChatRoomNotification &notification)> NotificationCallback
 
typedef std::function< void(int64_t room_id, int error_code, const std::list< ChatRoomMemberInfo > &infos)> GetMembersCallback
 
typedef std::function< void(int64_t room_id, int error_code, const std::list< ChatRoomMessage > &msgs)> GetMsgHistoryCallback
 
typedef std::function< void(int64_t room_id, int error_code, const ChatRoomMemberInfo &info)> SetMemberAttributeCallback
 
typedef std::function< void(int64_t room_id, int error_code, const ChatRoomInfo &info)> GetChatRoomInfoCallback
 
typedef std::function< void(int64_t room_id, int error_code)> KickMemberCallback
 
typedef std::function< void(int64_t room_id, const NIMChatRoomLinkCondition condition)> LinkConditionCallback
 
typedef SetMemberAttributeCallback TempMuteMemberCallback
 
typedef KickMemberCallback UpdateRoomInfoCallback
 
typedef KickMemberCallback UpdateMyRoomRoleCallback
 
typedef KickMemberCallback QueueOfferCallback
 
typedef std::function< void(int64_t room_id, int error_code, const ChatRoomQueueElement &element)> QueuePollCallback
 
typedef std::function< void(int64_t room_id, int error_code, const ChatRoomQueue &queue)> QueueListCallback
 
typedef KickMemberCallback QueueDropCallback
 
typedef QueuePollCallback QueueHeaderCallback
 
typedef std::function< void(int rescode, const RobotInfos &infos)> RobotQueryCallback
 
typedef std::function< void(int64_t room_id, int error_code, const std::list< std::string > &not_in_queue)> QueueBatchUpdateCallback
 

Static Public Member Functions

static void RegEnterCb (const EnterCallback &cb, const std::string &json_extension="")
 
static void RegExitCb (const ExitCallback &cb, const std::string &json_extension="")
 
static void RegExitCb_2 (const ExitCallback_2 &cb, const std::string &json_extension="")
 
static void RegSendMsgAckCb (const SendMsgAckCallback &cb, const std::string &json_extension="")
 
static void RegReceiveMsgCb (const ReceiveMsgCallback &cb, const std::string &json_extension="")
 
static void RegReceiveMsgsCb (const ReceiveMsgsCallback &cb, const std::string &json_extension="")
 
static void RegNotificationCb (const NotificationCallback &cb, const std::string &json_extension="")
 
static void RegLinkConditionCb (const LinkConditionCallback &cb, const std::string &json_extension="")
 
static bool Init (const std::string &app_install_dir, const std::string &json_extension="")
 
static void Cleanup (const std::string &json_extension="")
 
static bool IndependentEnter (const int64_t room_id, const ChatRoomIndependentEnterInfo &info)
 
static bool AnonymousEnter (const int64_t room_id, const ChatRoomAnoymityEnterInfo &anonymity_info, const ChatRoomEnterInfo &info, const std::string &json_extension="")
 
static bool Enter (const int64_t room_id, const std::string &request_login_data, const ChatRoomEnterInfo &info=ChatRoomEnterInfo(), const std::string &json_extension="")
 
static void Exit (const int64_t room_id, const std::string &json_extension="")
 
static NIMChatRoomLoginState GetLoginState (const int64_t room_id, const std::string &json_extension="")
 
static void SetMsgsBatchReport (bool set_batch, const std::string &json_extension="")
 
static void SendMsg (const int64_t room_id, const std::string &json_msg, const std::string &json_extension="")
 
static std::string CreateRoomMessage (const NIMChatRoomMsgType msg_type, const std::string &client_msg_id, const std::string &attach, const std::string &msg_body, const ChatRoomMessageSetting &msg_setting, int64_t timetag=0, int32_t msg_sub_type=0)
 
static void GetMembersOnlineAsync (const int64_t room_id, const ChatRoomGetMembersParameters &parameters, const GetMembersCallback &callback, const std::string &json_extension="")
 
static void GetMessageHistoryOnlineAsync (const int64_t room_id, const ChatRoomGetMsgHistoryParameters &parameters, const GetMsgHistoryCallback &callback, const std::string &json_extension="")
 
static void SetMemberAttributeOnlineAsync (const int64_t room_id, const ChatRoomSetMemberAttributeParameters &parameters, const SetMemberAttributeCallback &callback, const std::string &json_extension="")
 
static void GetInfoAsync (const int64_t room_id, const GetChatRoomInfoCallback &callback, const std::string &json_extension="")
 
static void GetMemberInfoByIDsAsync (const int64_t room_id, const std::list< std::string > &ids, const GetMembersCallback &callback, const std::string &json_extension="")
 
static void KickMemberAsync (const int64_t room_id, const std::string &id, const std::string &notify_ext, const KickMemberCallback &callback, const std::string &json_extension="")
 
static void SetProxy (NIMChatRoomProxyType type, const std::string &host, int port, const std::string &user, const std::string &password)
 
static void TempMuteMemberAsync (const int64_t room_id, const std::string &accid, const int64_t duration, bool need_notify, const std::string &notify_ext, const TempMuteMemberCallback &callback, const std::string &json_extension="")
 
static void UpdateRoomInfoAsync (const int64_t room_id, const ChatRoomInfo &info, bool need_notify, const std::string &notify_ext, const UpdateRoomInfoCallback &callback, const std::string &json_extension="")
 
static void UpdateMyRoomRoleAsync (const int64_t room_id, const ChatRoomMemberInfo &info, bool need_notify, const std::string &notify_ext, const UpdateMyRoomRoleCallback &callback, const std::string &json_extension="")
 
static void QueueOfferAsync (const int64_t room_id, const ChatRoomQueueElement &element, const QueueOfferCallback &callback, const std::string &json_extension="{\"transient\":true}")
 
static void QueuePollAsync (const int64_t room_id, const std::string &element_key, const QueuePollCallback &callback, const std::string &json_extension="")
 
static void QueueListAsync (const int64_t room_id, const QueueListCallback &callback, const std::string &json_extension="")
 
static void QueueHeaderAsync (const int64_t room_id, const QueueHeaderCallback &callback, const std::string &json_extension="")
 
static void QueueDropAsync (const int64_t room_id, const QueueDropCallback &callback, const std::string &json_extension="")
 
static void UnregChatroomCb ()
 
static RobotInfos QueryAllRobotInfosBlock (const int64_t room_id, const std::string &json_extension="")
 
static RobotInfo QueryRobotInfoByAccidBlock (const int64_t room_id, const std::string &accid, const std::string &json_extension="")
 
static void GetRobotInfoAsync (const int64_t room_id, const int64_t timetag, const RobotQueryCallback &callback, const std::string &json_extension="")
 
static void QueueBatchUpdateAsync (const int64_t room_id, const ChatRoomBatchMembers &batch_elements, bool need_notify, const std::string &notify_ext, const QueueBatchUpdateCallback &callback, const std::string &json_extension="")
 

Detailed Description

聊天室

Member Typedef Documentation

◆ EnterCallback

typedef std::function<void(int64_t room_id, const NIMChatRoomEnterStep step, int error_code, const ChatRoomInfo& info, const ChatRoomMemberInfo& my_info)> nim_chatroom::ChatRoom::EnterCallback

登录回调, 如果错误码为kResRoomLocalNeedRequestAgain,聊天室重连机制结束,则需要向IM服务器重新请求进入该聊天室权限

◆ ExitCallback

typedef std::function<void(int64_t room_id, int error_code, NIMChatRoomExitReason exit_reason)> nim_chatroom::ChatRoom::ExitCallback

登出、被踢回调

◆ ExitCallback_2

typedef std::function<void(int64_t room_id, int error_code, const NIMChatRoomExitReasonInfo& exit_info)> nim_chatroom::ChatRoom::ExitCallback_2

登出、被踢回调

◆ GetChatRoomInfoCallback

typedef std::function<void(int64_t room_id, int error_code, const ChatRoomInfo& info)> nim_chatroom::ChatRoom::GetChatRoomInfoCallback

获取当前聊天室信息回调

◆ GetMembersCallback

typedef std::function<void(int64_t room_id, int error_code, const std::list<ChatRoomMemberInfo>& infos)> nim_chatroom::ChatRoom::GetMembersCallback

在线查询成员列表回调

◆ GetMsgHistoryCallback

typedef std::function<void(int64_t room_id, int error_code, const std::list<ChatRoomMessage>& msgs)> nim_chatroom::ChatRoom::GetMsgHistoryCallback

在线查询消息历史回调

◆ KickMemberCallback

typedef std::function<void(int64_t room_id, int error_code)> nim_chatroom::ChatRoom::KickMemberCallback

踢掉指定成员回调

◆ LinkConditionCallback

typedef std::function<void(int64_t room_id, const NIMChatRoomLinkCondition condition)> nim_chatroom::ChatRoom::LinkConditionCallback

服务连接情况回调

◆ NotificationCallback

typedef std::function<void(int64_t room_id, const ChatRoomNotification& notification)> nim_chatroom::ChatRoom::NotificationCallback

通知回调

◆ QueueBatchUpdateCallback

typedef std::function<void(int64_t room_id, int error_code, const std::list<std::string>& not_in_queue)> nim_chatroom::ChatRoom::QueueBatchUpdateCallback

队列批量更新回调

◆ QueueDropCallback

删除麦序队列元素回调

◆ QueueHeaderCallback

查看麦序队列头元素回调

◆ QueueListCallback

typedef std::function<void(int64_t room_id, int error_code, const ChatRoomQueue& queue)> nim_chatroom::ChatRoom::QueueListCallback

排序列出麦序队列所有元素回调

◆ QueueOfferCallback

新加(更新)麦序队列元素回调

◆ QueuePollCallback

typedef std::function<void(int64_t room_id, int error_code, const ChatRoomQueueElement& element)> nim_chatroom::ChatRoom::QueuePollCallback

取出麦序队列元素回调

◆ ReceiveMsgCallback

typedef std::function<void(int64_t room_id, const ChatRoomMessage& result)> nim_chatroom::ChatRoom::ReceiveMsgCallback

接收消息回调

◆ ReceiveMsgsCallback

typedef std::function<void(int64_t room_id, const std::list<ChatRoomMessage>& result)> nim_chatroom::ChatRoom::ReceiveMsgsCallback

接收批量消息回调

◆ RobotQueryCallback

typedef std::function<void(int rescode, const RobotInfos& infos)> nim_chatroom::ChatRoom::RobotQueryCallback

获取机器人信息事件通知回调模板

◆ SendMsgAckCallback

typedef std::function<void(int64_t room_id, int error_code, const ChatRoomMessage& result)> nim_chatroom::ChatRoom::SendMsgAckCallback

发送消息回执

◆ SetMemberAttributeCallback

typedef std::function<void(int64_t room_id, int error_code, const ChatRoomMemberInfo& info)> nim_chatroom::ChatRoom::SetMemberAttributeCallback

设置成员身份标识回调

◆ TempMuteMemberCallback

临时禁言/解禁回调

◆ UpdateMyRoomRoleCallback

更新我的信息回调

◆ UpdateRoomInfoCallback

更新聊天室信息回调

Member Function Documentation

◆ AnonymousEnter()

bool nim_chatroom::ChatRoom::AnonymousEnter ( const int64_t  room_id,
const ChatRoomAnoymityEnterInfo anonymity_info,
const ChatRoomEnterInfo info,
const std::string &  json_extension = "" 
)
static

聊天室匿名进入

Parameters
[in]room_id聊天室ID
[in]anonymity_info匿名登录相关信息
[in]info聊天室进入信息
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
bool 进入信息是否正确,返回失败则不会触发进入回调

◆ Cleanup()

void nim_chatroom::ChatRoom::Cleanup ( const std::string &  json_extension = "")
static

聊天室模块清理(SDK卸载前调用一次)

Parameters
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ CreateRoomMessage()

std::string nim_chatroom::ChatRoom::CreateRoomMessage ( const NIMChatRoomMsgType  msg_type,
const std::string &  client_msg_id,
const std::string &  attach,
const std::string &  msg_body,
const ChatRoomMessageSetting msg_setting,
int64_t  timetag = 0,
int32_t  msg_sub_type = 0 
)
static

生成消息内容(所有支持的消息类型的内容)

Parameters
[in]msg_type消息类型
[in]client_msg_id消息ID
[in]attach消息内容(包含多媒体的消息类型,此处传入的是约定的可以解析为json的非格式化的字符串,如图片、文件消息等)
[in]msg_body文本消息内容
[in]msg_setting消息属性
[in]timetag消息时间
[in]sub_type消息子类型( > 0 ),由开发者自定义,服务端只负责透传 v7.8
Returns
std::string 消息json string

◆ Enter()

bool nim_chatroom::ChatRoom::Enter ( const int64_t  room_id,
const std::string &  request_login_data,
const ChatRoomEnterInfo info = ChatRoomEnterInfo(),
const std::string &  json_extension = "" 
)
static

聊天室登录

Parameters
[in]room_id聊天室ID
[in]request_login_data聊天室登录信息(NIM SDK请求聊天室返回的数据)
[in]info聊天室可选信息
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
bool 登录信息是否正确,返回失败则不会促发登录回调

◆ Exit()

void nim_chatroom::ChatRoom::Exit ( const int64_t  room_id,
const std::string &  json_extension = "" 
)
static

聊天室登出

Parameters
[in]room_id聊天室ID
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ GetInfoAsync()

void nim_chatroom::ChatRoom::GetInfoAsync ( const int64_t  room_id,
const GetChatRoomInfoCallback callback,
const std::string &  json_extension = "" 
)
static

异步获取当前聊天室信息

Parameters
[in]room_id聊天室ID
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ GetLoginState()

NIMChatRoomLoginState nim_chatroom::ChatRoom::GetLoginState ( const int64_t  room_id,
const std::string &  json_extension = "" 
)
static

获取聊天室登录状态

Parameters
[in]room_id聊天室ID
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ GetMemberInfoByIDsAsync()

void nim_chatroom::ChatRoom::GetMemberInfoByIDsAsync ( const int64_t  room_id,
const std::list< std::string > &  ids,
const GetMembersCallback callback,
const std::string &  json_extension = "" 
)
static

异步获取指定成员信息

Parameters
[in]room_id聊天室ID
[in]ids
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ GetMembersOnlineAsync()

void nim_chatroom::ChatRoom::GetMembersOnlineAsync ( const int64_t  room_id,
const ChatRoomGetMembersParameters parameters,
const GetMembersCallback callback,
const std::string &  json_extension = "" 
)
static

异步查询成员列表

Parameters
[in]room_id聊天室ID
[in]parameters查询参数
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ GetMessageHistoryOnlineAsync()

void nim_chatroom::ChatRoom::GetMessageHistoryOnlineAsync ( const int64_t  room_id,
const ChatRoomGetMsgHistoryParameters parameters,
const GetMsgHistoryCallback callback,
const std::string &  json_extension = "" 
)
static

异步查询消息历史

Parameters
[in]room_id聊天室ID
[in]parameters查询参数
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ GetRobotInfoAsync()

void nim_chatroom::ChatRoom::GetRobotInfoAsync ( const int64_t  room_id,
const int64_t  timetag,
const RobotQueryCallback callback,
const std::string &  json_extension = "" 
)
static

获取机器人信息

Parameters
[in]room_id聊天室ID
[in]timetag时间戳
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void

◆ IndependentEnter()

bool nim_chatroom::ChatRoom::IndependentEnter ( const int64_t  room_id,
const ChatRoomIndependentEnterInfo info 
)
static

聊天室独立进入

Parameters
[in]room_id聊天室ID
[in]info聊天室进入信息
Returns
bool 进入信息是否正确,返回失败则不会触发进入回调

◆ Init()

void nim_chatroom::ChatRoom::Init ( const std::string &  app_install_dir,
const std::string &  json_extension = "" 
)
static

聊天室模块初始化(SDK初始化时调用一次)

Parameters
[in]app_install_dirSDK动态库所在的目录全路径(如果传入为空,则按照默认规则搜索该动态库)
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
bool 模块加载结果

◆ KickMemberAsync()

void nim_chatroom::ChatRoom::KickMemberAsync ( const int64_t  room_id,
const std::string &  id,
const std::string &  notify_ext,
const KickMemberCallback callback,
const std::string &  json_extension = "" 
)
static

异步踢掉指定成员

Parameters
[in]room_id聊天室ID
[in]id成员id
[in]notify_ext放到事件通知中的扩展字段
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ QueryAllRobotInfosBlock()

char * nim_chatroom::ChatRoom::QueryAllRobotInfosBlock ( const int64_t  room_id,
const std::string &  json_extension = "" 
)
static

获取全部机器人信息(同步接口,堵塞NIM内部线程)

Parameters
[in]room_id聊天室ID
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
char 机器人信息 json string array

◆ QueryRobotInfoByAccidBlock()

char * nim_chatroom::ChatRoom::QueryRobotInfoByAccidBlock ( const int64_t  room_id,
const std::string &  accid,
const std::string &  json_extension = "" 
)
static

获取指定机器人信息(同步接口,堵塞NIM内部线程)

Parameters
[in]room_id聊天室ID
[in]accid机器人accid
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
char 机器人信息 json string

◆ QueueBatchUpdateAsync()

static void nim_chatroom::ChatRoom::QueueBatchUpdateAsync ( const int64_t  room_id,
const ChatRoomBatchMembers batch_elements,
bool  need_notify,
const std::string &  notify_ext,
const QueueBatchUpdateCallback callback,
const std::string &  json_extension = "" 
)
static

取出麦序元素

Parameters
[in]room_id聊天室ID
[in]batch_elements所有需要更新的列表
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ QueueDropAsync()

static void nim_chatroom::ChatRoom::QueueDropAsync ( const int64_t  room_id,
const QueueDropCallback callback,
const std::string &  json_extension = "" 
)
static

(管理员权限)删除麦序队列

Parameters
[in]room_id聊天室ID
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ QueueHeaderAsync()

static void nim_chatroom::ChatRoom::QueueHeaderAsync ( const int64_t  room_id,
const QueueHeaderCallback callback,
const std::string &  json_extension = "" 
)
static

查看麦序头元素

Parameters
[in]room_id聊天室ID
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ QueueListAsync()

static void nim_chatroom::ChatRoom::QueueListAsync ( const int64_t  room_id,
const QueueListCallback callback,
const std::string &  json_extension = "" 
)
static

排序列出所有元素

Parameters
[in]room_id聊天室ID
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ QueueOfferAsync()

static void nim_chatroom::ChatRoom::QueueOfferAsync ( const int64_t  room_id,
const ChatRoomQueueElement element,
const QueueOfferCallback callback,
const std::string &  json_extension = "{\"transient\":true}" 
)
static

新加(更新)麦序队列元素,如果element.key_对应的元素已经在队列中存在了,那就是更新操作,如果不存在,就放到队列尾部

Parameters
[in]room_id聊天室ID
[in]element麦序队列元素
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ QueuePollAsync()

static void nim_chatroom::ChatRoom::QueuePollAsync ( const int64_t  room_id,
const std::string &  element_key,
const QueuePollCallback callback,
const std::string &  json_extension = "" 
)
static

取出麦序元素

Parameters
[in]room_id聊天室ID
[in]element_key需要取出的元素的UniqKey, 传空传表示取出第一个元素
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ RegEnterCb()

void nim_chatroom::ChatRoom::RegEnterCb ( const EnterCallback cb,
const std::string &  json_extension = "" 
)
static

注册全局登录回调

Parameters
[in]cb回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ RegExitCb()

void nim_chatroom::ChatRoom::RegExitCb ( const ExitCallback cb,
const std::string &  json_extension = "" 
)
static

注册全局登出、被踢回调

Parameters
[in]cb回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ RegExitCb_2()

void nim_chatroom::ChatRoom::RegExitCb_2 ( const ExitCallback_2 cb,
const std::string &  json_extension = "" 
)
static

注册全局登出、被踢回调

Parameters
[in]cb回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ RegLinkConditionCb()

void nim_chatroom::ChatRoom::RegLinkConditionCb ( const LinkConditionCallback cb,
const std::string &  json_extension = "" 
)
static

注册全局聊天室链接情况回调

Parameters
[in]cb回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ RegNotificationCb()

void nim_chatroom::ChatRoom::RegNotificationCb ( const NotificationCallback cb,
const std::string &  json_extension = "" 
)
static

注册全局接收通知回调

Parameters
[in]cb回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ RegReceiveMsgCb()

void nim_chatroom::ChatRoom::RegReceiveMsgCb ( const ReceiveMsgCallback cb,
const std::string &  json_extension = "" 
)
static

注册全局接收消息回调

Parameters
[in]cb回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ RegReceiveMsgsCb()

void nim_chatroom::ChatRoom::RegReceiveMsgsCb ( const ReceiveMsgsCallback cb,
const std::string &  json_extension = "" 
)
static

注册全局接收批量消息回调

Parameters
[in]cb回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ RegSendMsgAckCb()

void nim_chatroom::ChatRoom::RegSendMsgAckCb ( const SendMsgAckCallback cb,
const std::string &  json_extension = "" 
)
static

注册全局发送消息回执回调

Parameters
[in]cb回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ SendMsg()

void nim_chatroom::ChatRoom::SendMsg ( const int64_t  room_id,
const std::string &  json_msg,
const std::string &  json_extension = "" 
)
static

发送消息

Parameters
[in]room_id聊天室ID
[in]json_msg消息json string(可以通过CreateTextMessage生成)
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ SetMemberAttributeOnlineAsync()

void nim_chatroom::ChatRoom::SetMemberAttributeOnlineAsync ( const int64_t  room_id,
const ChatRoomSetMemberAttributeParameters parameters,
const SetMemberAttributeCallback callback,
const std::string &  json_extension = "" 
)
static

异步设置成员身份标识

Parameters
[in]room_id聊天室ID
[in]parameters查询参数
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ SetMsgsBatchReport()

void nim_chatroom::ChatRoom::SetMsgsBatchReport ( bool  set_batch,
const std::string &  json_extension = "" 
)
static

设置消息接收批量上报开关

Parameters
[in]set_batch批量开关
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ SetProxy()

void nim_chatroom::ChatRoom::SetProxy ( NIMChatRoomProxyType  type,
const std::string &  host,
int  port,
const std::string &  user,
const std::string &  password 
)
static

设置SDK统一的网络代理。不需要代理时,type设置为kNIMProxyNone,其余参数都传空字符串(端口设为0)。有些代理不需要用户名和密码,相应参数也传空字符串。

Parameters
[in]type代理类型,见NIMChatRoomProxyType定义
[in]host代理地址
[in]port代理端口
[in]user代理用户名
[in]password代理密码
Returns
void 无返回值

◆ TempMuteMemberAsync()

static void nim_chatroom::ChatRoom::TempMuteMemberAsync ( const int64_t  room_id,
const std::string &  accid,
const int64_t  duration,
bool  need_notify,
const std::string &  notify_ext,
const TempMuteMemberCallback callback,
const std::string &  json_extension = "" 
)
static

异步临时禁言/解禁成员

Parameters
[in]room_id聊天室ID
[in]accid成员ID
[in]duration临时禁言时长(秒),解禁填0
[in]need_notify是否聊天室内广播通知
[in]notify_ext通知中的自定义字段,长度限制2048
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

◆ UnregChatroomCb()

void nim_chatroom::ChatRoom::UnregChatroomCb ( )
static

反注册Chatroom提供的所有回调

Returns
void 无返回值

◆ UpdateMyRoomRoleAsync()

static void nim_chatroom::ChatRoom::UpdateMyRoomRoleAsync ( const int64_t  room_id,
const ChatRoomMemberInfo info,
bool  need_notify,
const std::string &  notify_ext,
const UpdateMyRoomRoleCallback callback,
const std::string &  json_extension = "" 
)
static

更新我的信息

Parameters
[in]room_id聊天室ID
[in]info我的信息
[in]need_notify是否聊天室内广播通知
[in]notify_ext通知中的自定义字段,长度限制2048
[in]callback回调函数
[in]json_extensionjson扩展参数,针对固定成员,可配置更新的信息是否需要持久化,默认不持久化,{"need_save" : false}
Returns
void 无返回值

◆ UpdateRoomInfoAsync()

static void nim_chatroom::ChatRoom::UpdateRoomInfoAsync ( const int64_t  room_id,
const ChatRoomInfo info,
bool  need_notify,
const std::string &  notify_ext,
const UpdateRoomInfoCallback callback,
const std::string &  json_extension = "" 
)
static

更新聊天室信息

Parameters
[in]room_id聊天室ID
[in]info聊天室信息
[in]need_notify是否聊天室内广播通知
[in]notify_ext通知中的自定义字段,长度限制2048
[in]callback回调函数
[in]json_extensionjson扩展参数(备用,目前不需要)
Returns
void 无返回值

The documentation for this class was generated from the following file: