7#ifndef _NIM_CHATROOM_SDK_CPP_H_
8#define _NIM_CHATROOM_SDK_CPP_H_
26 typedef std::function<void(
const std::function<
void()>&)>
SDKClosure;
28 typedef std::function<
40 typedef std::function<void(int64_t room_id,
const std::list<ChatRoomMessage>& result)>
ReceiveMsgsCallback;
44 typedef std::function<void(int64_t room_id,
int error_code,
const std::list<ChatRoomMemberInfo>& infos)>
GetMembersCallback;
48 typedef std::function<void(int64_t room_id,
int error_code,
const std::list<ChatRoomMessage>& msgs)>
GetMsgHistoryCallback;
62 typedef std::function<void(
const std::string& appkey,
const std::string& account, std::string& token)>
RequestTokenCallback;
64 typedef std::function<void(
const std::string& appkey,
const std::string& account, std::string& token)>
RequestExtensionCallback;
88 typedef std::function<void(int64_t room_id,
int error_code,
const std::list<std::string>& not_in_queue)>
QueueBatchUpdateCallback;
99 static void RegEnterCb(
const EnterCallback& cb,
const std::string& json_extension =
"");
107 static void RegExitCb(
const ExitCallback& cb,
const std::string& json_extension =
"");
115 static void RegExitCb_2(
const ExitCallback_2& cb,
const std::string& json_extension =
"");
123 static void RegSendMsgAckCb(
const SendMsgAckCallback& cb,
const std::string& json_extension =
"");
131 static void RegReceiveMsgCb(
const ReceiveMsgCallback& cb,
const std::string& json_extension =
"");
139 static void RegReceiveMsgsCb(
const ReceiveMsgsCallback& cb,
const std::string& json_extension =
"");
147 static void RegNotificationCb(
const NotificationCallback& cb,
const std::string& json_extension =
"");
155 static void RegLinkConditionCb(
const LinkConditionCallback& cb,
const std::string& json_extension =
"");
157 static void RegTagsChangedCb(
const TagsChangedCallback& cb,
const std::string& json_extension =
"");
165 static void RegCustomTokenCb(
const CustomTokenCallback& cb,
const std::string& json_extension =
"");
173 static void RegRequestLoginTokenCb(
const RequestTokenCallback& cb,
const std::string& json_extension =
"");
199 static bool Init(
const std::string& app_install_dir,
const std::string& json_extension =
"");
215 static void Cleanup(
const std::string& json_extension =
"");
256 static bool AnonymousEnter(
const int64_t room_id,
259 const std::string& json_extension =
"");
270 static bool AnonymousEnter2(
const int64_t room_id,
284 static bool Enter(
const int64_t room_id,
285 const std::string& request_login_data,
287 const std::string& json_extension =
"");
295 static void Exit(
const int64_t room_id,
const std::string& json_extension =
"");
303 static NIMChatRoomLoginState GetLoginState(
const int64_t room_id,
const std::string& json_extension =
"");
311 static void SetMsgsBatchReport(
bool set_batch,
const std::string& json_extension =
"");
320 static void SendMsg(
const int64_t room_id,
const std::string& json_msg,
const std::string& json_extension =
"");
329 static void SendMsg(
const int64_t room_id,
const ChatRoomMessage& message,
const std::string& json_extension =
"");
346 const std::string& client_msg_id,
347 const std::string& attach,
348 const std::string& msg_body,
351 int32_t msg_sub_type = 0,
352 const std::string& target_tags =
"");
363 static void GetMembersOnlineAsync(
const int64_t room_id,
366 const std::string& json_extension =
"");
376 static void GetMembersByTagOnlineAsync(
const int64_t room_id,
379 const std::string& json_extension =
"");
389 static void GetMembersCountByTagOnlineAsync(
const int64_t room_id,
390 const std::string& target_tag,
392 const std::string& json_extension);
403 static void GetMessageHistoryOnlineAsync(
const int64_t room_id,
406 const std::string& json_extension =
"");
417 static void GetMessageHistoryByTagsOnlineAsync(
const int64_t room_id,
420 const std::string& json_extension =
"");
431 static void SetMemberAttributeOnlineAsync(
const int64_t room_id,
434 const std::string& json_extension =
"");
443 static void GetInfoAsync(
const int64_t room_id,
const GetChatRoomInfoCallback& callback,
const std::string& json_extension =
"");
454 static void GetMemberInfoByIDsAsync(
const int64_t room_id,
455 const std::list<std::string>& ids,
457 const std::string& json_extension =
"");
469 static void KickMemberAsync(
const int64_t room_id,
470 const std::string&
id,
471 const std::string& notify_ext,
473 const std::string& json_extension =
"");
484 static void SetProxy(
NIMChatRoomProxyType type,
const std::string& host,
int port,
const std::string& user,
const std::string& password);
498 static void TempMuteMemberAsync(
const int64_t room_id,
499 const std::string& accid,
500 const int64_t duration,
502 const std::string& notify_ext,
504 const std::string& json_extension =
"");
518 static void TempMuteMemberByTagAsync(
const int64_t room_id,
519 const std::string& target_tag,
520 const int64_t duration,
522 const std::string& notify_ext,
524 const std::string& notify_tags =
"",
525 const std::string& json_extension =
"");
539 static void UpdateRoomInfoAsync(
const int64_t room_id,
542 const std::string& notify_ext,
544 const std::string& json_extension =
"");
558 static void UpdateMyRoomRoleAsync(
const int64_t room_id,
561 const std::string& notify_ext,
563 const std::string& json_extension =
"");
574 static void QueueOfferAsync(
const int64_t room_id,
577 const std::string& json_extension =
"{\"transient\":true}");
589 static void QueueOfferAsyncEx(
const int64_t room_id,
603 static void QueuePollAsync(
const int64_t room_id,
604 const std::string& element_key,
606 const std::string& json_extension =
"");
615 static void QueueListAsync(
const int64_t room_id,
const QueueListCallback& callback,
const std::string& json_extension =
"");
624 static void QueueHeaderAsync(
const int64_t room_id,
const QueueHeaderCallback& callback,
const std::string& json_extension =
"");
633 static void QueueDropAsync(
const int64_t room_id,
const QueueDropCallback& callback,
const std::string& json_extension =
"");
639 static void UnregChatroomCb();
647 static RobotInfos QueryAllRobotInfosBlock(
const int64_t room_id,
const std::string& json_extension =
"");
656 static RobotInfo QueryRobotInfoByAccidBlock(
const int64_t room_id,
const std::string& accid,
const std::string& json_extension =
"");
667 static void GetRobotInfoAsync(
const int64_t room_id,
668 const int64_t timetag,
670 const std::string& json_extension =
"");
681 static void QueueBatchUpdateAsync(
const int64_t room_id,
684 const std::string& notify_ext,
686 const std::string& json_extension =
"");
697 static bool UpdateLocation(
const int64_t room_id,
700 const std::string& json_extension =
"");
711 static bool UpdateTags(
const int64_t room_id,
714 const std::string& json_extension =
"");
聊天室
Definition: nim_chatroom_cpp.h:24
KickMemberCallback UpdateMyRoomRoleCallback
更新我的信息回调
Definition: nim_chatroom_cpp.h:70
std::function< void(const std::string &appkey, const std::string &account, std::string &token)> RequestExtensionCallback
登录时请求第三方鉴权扩展信息回调
Definition: nim_chatroom_cpp.h:64
KickMemberCallback QueueDropCallback
删除麦序队列元素回调
Definition: nim_chatroom_cpp.h:82
std::function< void(int64_t room_id, const std::string &new_tag)> TagsChangedCallback
自己的聊天室 tags 信息变更回调
Definition: nim_chatroom_cpp.h:58
std::function< void(const std::string &appkey, const std::string &account, std::string &token)> RequestTokenCallback
获取自定义token回调
Definition: nim_chatroom_cpp.h:62
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:30
std::function< void(int64_t room_id, const ChatRoomMessage &result)> ReceiveMsgCallback
接收消息回调
Definition: nim_chatroom_cpp.h:38
std::function< void(int64_t room_id, int error_code, NIMChatRoomExitReason exit_reason)> ExitCallback
登出、被踢回调
Definition: nim_chatroom_cpp.h:32
std::function< void(const std::string &text)> SDKLogCallback
SDK系统日志回调模板
Definition: nim_chatroom_cpp.h:90
std::function< void(int64_t room_id, int error_code, const ChatRoomInfo &info)> GetChatRoomInfoCallback
获取当前聊天室信息回调
Definition: nim_chatroom_cpp.h:52
std::function< void(int64_t room_id, int error_code, const ChatRoomQueue &queue)> QueueListCallback
排序列出麦序队列所有元素回调
Definition: nim_chatroom_cpp.h:80
QueuePollCallback QueueHeaderCallback
查看麦序队列头元素回调
Definition: nim_chatroom_cpp.h:84
std::function< void(int64_t room_id, int error_code, const NIMChatRoomExitReasonInfo &exit_info)> ExitCallback_2
登出、被踢回调
Definition: nim_chatroom_cpp.h:34
std::function< void(int rescode, const RobotInfos &infos)> RobotQueryCallback
获取机器人信息事件通知回调模板
Definition: nim_chatroom_cpp.h:86
std::function< void(int64_t room_id, int error_code, const ChatRoomQueueElement &element)> QueuePollCallback
取出麦序队列元素回调
Definition: nim_chatroom_cpp.h:78
SetMemberAttributeCallback TempMuteMemberCallback
临时禁言/解禁回调
Definition: nim_chatroom_cpp.h:66
std::function< void(int64_t room_id, int error_code, const std::list< ChatRoomMemberInfo > &infos)> GetMembersCallback
在线查询成员列表回调
Definition: nim_chatroom_cpp.h:44
KickMemberCallback UpdateTagsCallback
更新聊天室标签回调
Definition: nim_chatroom_cpp.h:74
std::function< void(int64_t room_id, int error_code, const std::list< std::string > ¬_in_queue)> QueueBatchUpdateCallback
队列批量更新回调
Definition: nim_chatroom_cpp.h:88
std::function< void(int64_t room_id, int error_code, const std::list< ChatRoomMessage > &msgs)> GetMsgHistoryCallback
在线查询消息历史回调
Definition: nim_chatroom_cpp.h:48
std::function< void(int64_t room_id, const ChatRoomNotification ¬ification)> NotificationCallback
通知回调
Definition: nim_chatroom_cpp.h:42
std::function< void(int64_t room_id, const std::list< ChatRoomMessage > &result)> ReceiveMsgsCallback
接收批量消息回调
Definition: nim_chatroom_cpp.h:40
KickMemberCallback UpdateRoomInfoCallback
更新聊天室信息回调
Definition: nim_chatroom_cpp.h:68
KickMemberCallback UpdateLocationCallback
更新聊天室中用户的位置信息回调
Definition: nim_chatroom_cpp.h:72
std::function< void(int64_t room_id, int error_code)> KickMemberCallback
踢掉指定成员回调
Definition: nim_chatroom_cpp.h:54
std::function< void(int64_t room_id, const NIMChatRoomLinkCondition condition)> LinkConditionCallback
服务连接情况回调
Definition: nim_chatroom_cpp.h:56
std::function< void(std::string &token)> CustomTokenCallback
获取自定义token回调
Definition: nim_chatroom_cpp.h:60
std::function< void(int64_t room_id, int error_code, const ChatRoomMessage &result)> SendMsgAckCallback
发送消息回执
Definition: nim_chatroom_cpp.h:36
std::function< void(int64_t room_id, int error_code, const ChatRoomMemberInfo &info)> SetMemberAttributeCallback
设置成员身份标识回调
Definition: nim_chatroom_cpp.h:50
KickMemberCallback QueueOfferCallback
新加(更新)麦序队列元素回调
Definition: nim_chatroom_cpp.h:76
std::function< void(const std::function< void()> &)> SDKClosure
Definition: nim_chatroom_cpp.h:26
std::function< void(int64_t room_id, int error_code, uint64_t)> GetMembersCountByTagCallback
在线查询成员列表回调
Definition: nim_chatroom_cpp.h:46
聊天室
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:898
NIMChatRoomLoginState
Definition: nim_chatroom_def.h:683
const char * NIMChatRoomConfigGetter
Definition: nim_chatroom_def.h:962
NIMChatRoomLinkCondition
Definition: nim_chatroom_def.h:891
NIMChatRoomMsgType
Definition: nim_chatroom_def.h:551
NIMChatRoomExitReason
Definition: nim_chatroom_def.h:614
NIMChatRoomProxyType
Definition: nim_chatroom_def.h:907
#define NIM_CHATROOM_SDK_CPPWRAPPER_DLL_API
Definition: nim_chatroom_sdk_cpp_wrapper.h:38
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