7#ifndef _NIM_CHATROOM_SDK_CPP_H_
8#define _NIM_CHATROOM_SDK_CPP_H_
25class NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API
ChatRoom {
27 typedef std::function<void(
const std::function<
void()>&)> SDKClosure;
29 typedef std::function<
41 typedef std::function<void(int64_t room_id,
const std::list<ChatRoomMessage>& result)>
ReceiveMsgsCallback;
45 typedef std::function<void(int64_t room_id,
int error_code,
const std::list<ChatRoomMemberInfo>& infos)>
GetMembersCallback;
49 typedef std::function<void(int64_t room_id,
int error_code,
const std::list<ChatRoomMessage>& msgs)>
GetMsgHistoryCallback;
85 typedef std::function<void(int64_t room_id,
int error_code,
const std::list<std::string>& not_in_queue)>
QueueBatchUpdateCallback;
96 static void RegEnterCb(
const EnterCallback& cb,
const std::string& json_extension =
"");
104 static void RegExitCb(
const ExitCallback& cb,
const std::string& json_extension =
"");
112 static void RegExitCb_2(
const ExitCallback_2& cb,
const std::string& json_extension =
"");
120 static void RegSendMsgAckCb(
const SendMsgAckCallback& cb,
const std::string& json_extension =
"");
128 static void RegReceiveMsgCb(
const ReceiveMsgCallback& cb,
const std::string& json_extension =
"");
136 static void RegReceiveMsgsCb(
const ReceiveMsgsCallback& cb,
const std::string& json_extension =
"");
144 static void RegNotificationCb(
const NotificationCallback& cb,
const std::string& json_extension =
"");
152 static void RegLinkConditionCb(
const LinkConditionCallback& cb,
const std::string& json_extension =
"");
154 static void RegTagsChangedCb(
const TagsChangedCallback& cb,
const std::string& json_extension =
"");
162 static void RegCustomTokenCb(
const CustomTokenCallback& cb,
const std::string& json_extension =
"");
177 static bool Init(
const std::string& app_install_dir,
const std::string& json_extension =
"");
185 static void SetCallbackFunction(
const ChatRoom::SDKClosure& callback);
193 static void Cleanup(
const std::string& json_extension =
"");
210 static bool IndependentEnter2(
const int64_t room_id,
const ChatRoomIndependentEnterInfo& info,
const NIMChatRoomConfigGetter config_getter);
221 static bool AnonymousEnter(
const int64_t room_id,
224 const std::string& json_extension =
"");
235 static bool AnonymousEnter2(
const int64_t room_id,
238 const NIMChatRoomConfigGetter config_getter);
249 static bool Enter(
const int64_t room_id,
250 const std::string& request_login_data,
252 const std::string& json_extension =
"");
260 static void Exit(
const int64_t room_id,
const std::string& json_extension =
"");
268 static NIMChatRoomLoginState GetLoginState(
const int64_t room_id,
const std::string& json_extension =
"");
276 static void SetMsgsBatchReport(
bool set_batch,
const std::string& json_extension =
"");
285 static void SendMsg(
const int64_t room_id,
const std::string& json_msg,
const std::string& json_extension =
"");
294 static void SendMsg(
const int64_t room_id,
const ChatRoomMessage& message,
const std::string& json_extension =
"");
311 const std::string& client_msg_id,
312 const std::string& attach,
313 const std::string& msg_body,
316 int32_t msg_sub_type = 0,
317 const std::string& target_tags =
"");
328 static void GetMembersOnlineAsync(
const int64_t room_id,
331 const std::string& json_extension =
"");
341 static void GetMembersByTagOnlineAsync(
const int64_t room_id,
344 const std::string& json_extension =
"");
354 static void GetMembersCountByTagOnlineAsync(
const int64_t room_id,
355 const std::string& target_tag,
357 const std::string& json_extension);
368 static void GetMessageHistoryOnlineAsync(
const int64_t room_id,
371 const std::string& json_extension =
"");
382 static void GetMessageHistoryByTagsOnlineAsync(
const int64_t room_id,
385 const std::string& json_extension =
"");
396 static void SetMemberAttributeOnlineAsync(
const int64_t room_id,
399 const std::string& json_extension =
"");
408 static void GetInfoAsync(
const int64_t room_id,
const GetChatRoomInfoCallback& callback,
const std::string& json_extension =
"");
419 static void GetMemberInfoByIDsAsync(
const int64_t room_id,
420 const std::list<std::string>& ids,
422 const std::string& json_extension =
"");
434 static void KickMemberAsync(
const int64_t room_id,
435 const std::string&
id,
436 const std::string& notify_ext,
438 const std::string& json_extension =
"");
449 static void SetProxy(
NIMChatRoomProxyType type,
const std::string& host,
int port,
const std::string& user,
const std::string& password);
463 static void TempMuteMemberAsync(
const int64_t room_id,
464 const std::string& accid,
465 const int64_t duration,
467 const std::string& notify_ext,
469 const std::string& json_extension =
"");
483 static void TempMuteMemberByTagAsync(
const int64_t room_id,
484 const std::string& target_tag,
485 const int64_t duration,
487 const std::string& notify_ext,
489 const std::string& notify_tags =
"",
490 const std::string& json_extension =
"");
504 static void UpdateRoomInfoAsync(
const int64_t room_id,
507 const std::string& notify_ext,
509 const std::string& json_extension =
"");
523 static void UpdateMyRoomRoleAsync(
const int64_t room_id,
526 const std::string& notify_ext,
528 const std::string& json_extension =
"");
539 static void QueueOfferAsync(
const int64_t room_id,
542 const std::string& json_extension =
"{\"transient\":true}");
554 static void QueueOfferAsyncEx(
const int64_t room_id,
568 static void QueuePollAsync(
const int64_t room_id,
569 const std::string& element_key,
571 const std::string& json_extension =
"");
580 static void QueueListAsync(
const int64_t room_id,
const QueueListCallback& callback,
const std::string& json_extension =
"");
589 static void QueueHeaderAsync(
const int64_t room_id,
const QueueHeaderCallback& callback,
const std::string& json_extension =
"");
598 static void QueueDropAsync(
const int64_t room_id,
const QueueDropCallback& callback,
const std::string& json_extension =
"");
604 static void UnregChatroomCb();
612 static RobotInfos QueryAllRobotInfosBlock(
const int64_t room_id,
const std::string& json_extension =
"");
621 static RobotInfo QueryRobotInfoByAccidBlock(
const int64_t room_id,
const std::string& accid,
const std::string& json_extension =
"");
632 static void GetRobotInfoAsync(
const int64_t room_id,
633 const int64_t timetag,
635 const std::string& json_extension =
"");
646 static void QueueBatchUpdateAsync(
const int64_t room_id,
649 const std::string& notify_ext,
651 const std::string& json_extension =
"");
662 static bool UpdateLocation(
const int64_t room_id,
665 const std::string& json_extension =
"");
676 static bool UpdateTags(
const int64_t room_id,
679 const std::string& json_extension =
"");
聊天室
Definition: nim_chatroom_cpp.h:25
KickMemberCallback UpdateMyRoomRoleCallback
更新我的信息回调
Definition: nim_chatroom_cpp.h:67
KickMemberCallback QueueDropCallback
删除麦序队列元素回调
Definition: nim_chatroom_cpp.h:79
std::function< void(int64_t room_id, const std::string &new_tag)> TagsChangedCallback
自己的聊天室 tags 信息变更回调
Definition: nim_chatroom_cpp.h:59
std::function< void(int64_t room_id, const NIMChatRoomEnterStep step, int error_code, const ChatRoomInfo &info, const ChatRoomMemberInfo &my_info)> EnterCallback
登录回调, 如果错误码为kResRoomLocalNeedRequestAgain,聊天室重连机制结束,则需要向IM服务器重新请求进入该聊天室权限
Definition: nim_chatroom_cpp.h:31
std::function< void(int64_t room_id, const ChatRoomMessage &result)> ReceiveMsgCallback
接收消息回调
Definition: nim_chatroom_cpp.h:39
std::function< void(int64_t room_id, int error_code, NIMChatRoomExitReason exit_reason)> ExitCallback
登出、被踢回调
Definition: nim_chatroom_cpp.h:33
std::function< void(const std::string &text)> SDKLogCallback
SDK系统日志回调模板
Definition: nim_chatroom_cpp.h:87
std::function< void(int64_t room_id, int error_code, const ChatRoomInfo &info)> GetChatRoomInfoCallback
获取当前聊天室信息回调
Definition: nim_chatroom_cpp.h:53
std::function< void(int64_t room_id, int error_code, const ChatRoomQueue &queue)> QueueListCallback
排序列出麦序队列所有元素回调
Definition: nim_chatroom_cpp.h:77
QueuePollCallback QueueHeaderCallback
查看麦序队列头元素回调
Definition: nim_chatroom_cpp.h:81
std::function< void(int64_t room_id, int error_code, const NIMChatRoomExitReasonInfo &exit_info)> ExitCallback_2
登出、被踢回调
Definition: nim_chatroom_cpp.h:35
std::function< void(int rescode, const RobotInfos &infos)> RobotQueryCallback
获取机器人信息事件通知回调模板
Definition: nim_chatroom_cpp.h:83
std::function< void(int64_t room_id, int error_code, const ChatRoomQueueElement &element)> QueuePollCallback
取出麦序队列元素回调
Definition: nim_chatroom_cpp.h:75
SetMemberAttributeCallback TempMuteMemberCallback
临时禁言/解禁回调
Definition: nim_chatroom_cpp.h:63
std::function< void(int64_t room_id, int error_code, const std::list< ChatRoomMemberInfo > &infos)> GetMembersCallback
在线查询成员列表回调
Definition: nim_chatroom_cpp.h:45
KickMemberCallback UpdateTagsCallback
更新聊天室标签回调
Definition: nim_chatroom_cpp.h:71
std::function< void(int64_t room_id, int error_code, const std::list< std::string > ¬_in_queue)> QueueBatchUpdateCallback
队列批量更新回调
Definition: nim_chatroom_cpp.h:85
std::function< void(int64_t room_id, int error_code, const std::list< ChatRoomMessage > &msgs)> GetMsgHistoryCallback
在线查询消息历史回调
Definition: nim_chatroom_cpp.h:49
std::function< void(int64_t room_id, const ChatRoomNotification ¬ification)> NotificationCallback
通知回调
Definition: nim_chatroom_cpp.h:43
std::function< void(int64_t room_id, const std::list< ChatRoomMessage > &result)> ReceiveMsgsCallback
接收批量消息回调
Definition: nim_chatroom_cpp.h:41
KickMemberCallback UpdateRoomInfoCallback
更新聊天室信息回调
Definition: nim_chatroom_cpp.h:65
KickMemberCallback UpdateLocationCallback
更新聊天室中用户的位置信息回调
Definition: nim_chatroom_cpp.h:69
std::function< void(int64_t room_id, int error_code)> KickMemberCallback
踢掉指定成员回调
Definition: nim_chatroom_cpp.h:55
std::function< void(int64_t room_id, const NIMChatRoomLinkCondition condition)> LinkConditionCallback
服务连接情况回调
Definition: nim_chatroom_cpp.h:57
std::function< void(std::string &token)> CustomTokenCallback
获取自定义token回调
Definition: nim_chatroom_cpp.h:61
std::function< void(int64_t room_id, int error_code, const ChatRoomMessage &result)> SendMsgAckCallback
发送消息回执
Definition: nim_chatroom_cpp.h:37
std::function< void(int64_t room_id, int error_code, const ChatRoomMemberInfo &info)> SetMemberAttributeCallback
设置成员身份标识回调
Definition: nim_chatroom_cpp.h:51
KickMemberCallback QueueOfferCallback
新加(更新)麦序队列元素回调
Definition: nim_chatroom_cpp.h:73
std::function< void(int64_t room_id, int error_code, uint64_t)> GetMembersCountByTagCallback
在线查询成员列表回调
Definition: nim_chatroom_cpp.h:47
聊天室
Definition: nim_chatroom_def_include.h:17
std::list< ChatRoomQueueElement > ChatRoomQueue
聊天室麦序队列
Definition: nim_chatroom_helper.h:1271
std::list< RobotInfo > RobotInfos
机器人信息
Definition: nim_chatroom_helper.h:1362
NIMChatRoomEnterStep
Definition: nim_chatroom_def.h:854
NIMChatRoomLoginState
Definition: nim_chatroom_def.h:639
NIMChatRoomLinkCondition
Definition: nim_chatroom_def.h:847
NIMChatRoomMsgType
Definition: nim_chatroom_def.h:516
NIMChatRoomExitReason
Definition: nim_chatroom_def.h:578
NIMChatRoomProxyType
Definition: nim_chatroom_def.h:863
Definition: nim_chatroom_def.h:16
Definition: nim_chatroom_helper.h:250
聊天室批量更新成员
Definition: nim_chatroom_helper.h:1382
聊天室登录信息
Definition: nim_chatroom_helper.h:31
根据 tag 获取聊天室成员参数
Definition: nim_chatroom_helper.h:914
获取聊天室成员参数
Definition: nim_chatroom_helper.h:887
Definition: nim_chatroom_helper.h:1000
获取聊天室消息历史参数
Definition: nim_chatroom_helper.h:941
Definition: nim_chatroom_helper.h:131
聊天室信息
Definition: nim_chatroom_helper.h:336
聊天室成员信息
Definition: nim_chatroom_helper.h:1103
聊天室消息
Definition: nim_chatroom_helper.h:745
聊天室消息属性设置
Definition: nim_chatroom_helper.h:650
聊天室通知
Definition: nim_chatroom_helper.h:422
聊天室麦序队列元素
Definition: nim_chatroom_helper.h:1251
聊天室麦序添加、更新选项
Definition: nim_chatroom_helper.h:572
设置聊天室成员身份标识参数
Definition: nim_chatroom_helper.h:1070
聊天室退出时的信息
Definition: nim_chatroom_helper.h:1274
机器人信息
Definition: nim_chatroom_helper.h:1313