NIM SDK API  8.5.0
nim_chatroom.h
Go to the documentation of this file.
1 
8 #ifndef NIM_CHATROOM_SDK_API_NIM_CHATROOM_H_
9 #define NIM_CHATROOM_SDK_API_NIM_CHATROOM_H_
10 
11 #include "nim_chatroom_def.h"
12 #include "public_defines.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
33 NIM_SDK_DLL_API void nim_chatroom_reg_enter_cb(const char* json_extension, nim_chatroom_enter_cb_func cb, const void* user_data);
34 
43 NIM_SDK_DLL_API void nim_chatroom_reg_exit_cb(const char* json_extension, nim_chatroom_exit_cb_func cb, const void* user_data);
44 
52 NIM_SDK_DLL_API void nim_chatroom_reg_link_condition_cb(const char* json_extension, nim_chatroom_link_condition_cb_func cb, const void* user_data);
53 
66 NIM_SDK_DLL_API void nim_chatroom_reg_send_msg_ack_cb(const char* json_extension, nim_chatroom_sendmsg_arc_cb_func cb, const void* user_data);
67 
75 NIM_SDK_DLL_API void nim_chatroom_reg_receive_msg_cb(const char* json_extension, nim_chatroom_receive_msg_cb_func cb, const void* user_data);
76 
84 NIM_SDK_DLL_API void nim_chatroom_reg_receive_msgs_cb(const char* json_extension, nim_chatroom_receive_msg_cb_func cb, const void* user_data);
85 
95 NIM_SDK_DLL_API void nim_chatroom_reg_receive_notification_cb(const char* json_extension,
97  const void* user_data);
98 
104 NIM_SDK_DLL_API void nim_chatroom_init(const char* json_extension);
105 
111 NIM_SDK_DLL_API void nim_chatroom_cleanup(const char* json_extension);
112 
121 NIM_SDK_DLL_API bool nim_chatroom_enter_with_anoymity(const int64_t room_id,
122  const char* anonymity_info,
123  const char* enter_info,
124  const char* json_extension);
125 
137 NIM_SDK_DLL_API bool nim_chatroom_enter_with_anoymity2(const int64_t room_id,
138  const char* anonymity_info,
139  const char* enter_info,
140  const NIMChatRoomConfigGetter config_getter);
141 
148 NIM_SDK_DLL_API bool nim_chatroom_independent_enter(const int64_t room_id, const char* enter_info);
149 
157 NIM_SDK_DLL_API bool nim_chatroom_independent_enter2(const int64_t room_id, const char* enter_info, const NIMChatRoomConfigGetter config_getter);
158 
167 NIM_SDK_DLL_API bool nim_chatroom_enter(const int64_t room_id, const char* request_enter_data, const char* enter_info, const char* json_extension);
168 
175 NIM_SDK_DLL_API void nim_chatroom_exit(const int64_t room_id, const char* json_extension);
176 
183 NIM_SDK_DLL_API void nim_chatroom_set_msgs_batch_report(bool set_batch, const char* json_extension);
184 
191 NIM_SDK_DLL_API int nim_chatroom_get_login_state(const int64_t room_id, const char* json_extension);
192 
200 NIM_SDK_DLL_API void nim_chatroom_send_msg(const int64_t room_id, const char* msg, const char* json_extension);
201 
215 NIM_SDK_DLL_API void nim_chatroom_get_members_online_async(const int64_t room_id,
216  const char* parameters_json_str,
217  const char* json_extension,
219  const void* user_data);
220 
234 NIM_SDK_DLL_API void nim_chatroom_get_members_by_tag_online_async(const int64_t room_id,
235  const char* parameters_json_str,
236  const char* json_extension,
238  const void* user_data);
239 
253 NIM_SDK_DLL_API void nim_chatroom_get_msg_history_online_async(const int64_t room_id,
254  const char* parameters_json_str,
255  const char* json_extension,
257  const void* user_data);
258 
280 NIM_SDK_DLL_API void nim_chatroom_set_member_attribute_async(const int64_t room_id,
281  const char* notify_ext,
282  const char* json_extension,
284  const void* user_data);
285 
294 NIM_SDK_DLL_API void nim_chatroom_get_info_async(const int64_t room_id,
295  const char* json_extension,
297  const void* user_data);
298 
314 NIM_SDK_DLL_API void nim_chatroom_get_members_by_ids_online_async(const int64_t room_id,
315  const char* ids_json_array_string,
316  const char* json_extension,
318  const void* user_data);
319 
338 NIM_SDK_DLL_API void nim_chatroom_kick_member_async(const int64_t room_id,
339  const char* id,
340  const char* notify_ext,
341  const char* json_extension,
343  const void* user_data);
344 
355 NIM_SDK_DLL_API void nim_chatroom_set_proxy(enum NIMChatRoomProxyType type, const char* host, int port, const char* user, const char* password);
356 
380 NIM_SDK_DLL_API void nim_chatroom_temp_mute_member_async(const int64_t room_id,
381  const char* accid,
382  const int64_t duration,
383  bool need_notify,
384  const char* notify_ext,
385  const char* json_extension,
387  const void* user_data);
388 
410 NIM_SDK_DLL_API void nim_chatroom_temp_mute_member_by_tag_async(const int64_t room_id,
411  const char* target_tag,
412  const int64_t duration,
413  bool need_notify,
414  const char* notify_ext,
415  const char* notify_tags,
416  const char* json_extension,
418  const void* user_data);
419 
433 NIM_SDK_DLL_API void nim_chatroom_query_members_count_by_tag_async(const int64_t room_id,
434  const char* target_tag,
435  const char* json_extension,
437  const void* user_data);
438 
462 NIM_SDK_DLL_API void nim_chatroom_update_room_info_async(const int64_t room_id,
463  const char* room_info_json_str,
464  bool need_notify,
465  const char* notify_ext,
466  const char* json_extension,
468  const void* user_data);
469 
487 NIM_SDK_DLL_API void nim_chatroom_update_my_role_async(const int64_t room_id,
488  const char* role_info_json_str,
489  bool need_notify,
490  const char* notify_ext,
491  const char* json_extension,
493  const void* user_data);
494 
513 NIM_SDK_DLL_API void nim_chatroom_queue_offer_async(const int64_t room_id,
514  const char* element_key,
515  const char* element_value,
516  const char* json_extension,
518  const void* user_data);
519 
536 NIM_SDK_DLL_API void nim_chatroom_queue_poll_async(const int64_t room_id,
537  const char* element_key,
538  const char* json_extension,
540  const void* user_data);
541 
553 NIM_SDK_DLL_API void nim_chatroom_queue_list_async(const int64_t room_id,
554  const char* json_extension,
556  const void* user_data);
557 
569 NIM_SDK_DLL_API void nim_chatroom_queue_header_async(const int64_t room_id,
570  const char* json_extension,
572  const void* user_data);
573 
585 NIM_SDK_DLL_API void nim_chatroom_queue_drop_async(const int64_t room_id,
586  const char* json_extension,
588  const void* user_data);
589 
603 NIM_SDK_DLL_API void nim_chatroom_get_robots_async(const int64_t room_id,
604  int64_t timetag,
605  const char* json_extension,
607  const void* user_data);
608 
615 NIM_SDK_DLL_API char* nim_chatroom_query_all_robots_block(const int64_t room_id, const char* json_extension);
616 
624 NIM_SDK_DLL_API char* nim_chatroom_query_robot_by_accid_block(const int64_t room_id, const char* accid, const char* json_extension);
625 
644 NIM_SDK_DLL_API void nim_chatroom_batch_upate_async(const int64_t room_id,
645  const char* element_info_json_str,
646  bool need_notify,
647  const char* notify_ext,
648  const char* json_extension,
650  const void* user_data);
651 
652 #ifdef __cplusplus
653 };
654 #endif // __cplusplus
655 #endif // NIM_CHATROOM_SDK_API_NIM_CHATROOM_H_
nim_chatroom_independent_enter
NIM_SDK_DLL_API bool nim_chatroom_independent_enter(const int64_t room_id, const char *enter_info)
独立进入聊天室
nim_chatroom_queue_offer_async
NIM_SDK_DLL_API void nim_chatroom_queue_offer_async(const int64_t room_id, const char *element_key, const char *element_value, const char *json_extension, nim_chatroom_queue_offer_cb_func cb, const void *user_data)
新加(更新)麦序队列元素,如果element_key对应的元素已经在队列中存在了,那就是更新操作,如果不存在,就放到队列尾部
nim_chatroom_set_proxy
NIM_SDK_DLL_API void nim_chatroom_set_proxy(enum NIMChatRoomProxyType type, const char *host, int port, const char *user, const char *password)
设置Chatroom SDK统一的网络代理。不需要代理时,type设置为kNIMProxyNone,其余参数都传空字符串(端口设为0)。有些代理不需要用户名和密码,相应参数也传空字符串。
nim_chatroom_update_room_info_async
NIM_SDK_DLL_API void nim_chatroom_update_room_info_async(const int64_t room_id, const char *room_info_json_str, bool need_notify, const char *notify_ext, const char *json_extension, nim_chatroom_update_room_info_cb_func cb, const void *user_data)
更新聊天室信息,目前只支持更新 kNIMChatRoomInfoKeyName, kNIMChatRoomInfoKeyAnnouncement, kNIMChatRoomInfoKeyBroadcas...
nim_chatroom_get_members_cb_func
void(* nim_chatroom_get_members_cb_func)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:98
nim_chatroom_get_members_by_ids_online_async
NIM_SDK_DLL_API void nim_chatroom_get_members_by_ids_online_async(const int64_t room_id, const char *ids_json_array_string, const char *json_extension, nim_chatroom_get_members_cb_func cb, const void *user_data)
异步获取指定成员信息
nim_chatroom_enter_with_anoymity2
NIM_SDK_DLL_API bool nim_chatroom_enter_with_anoymity2(const int64_t room_id, const char *anonymity_info, const char *enter_info, const NIMChatRoomConfigGetter config_getter)
聊天室匿名进入
nim_chatroom_exit_cb_func
void(* nim_chatroom_exit_cb_func)(int64_t room_id, int error_code, int exit_type, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:43
nim_chatroom_queue_header_async
NIM_SDK_DLL_API void nim_chatroom_queue_header_async(const int64_t room_id, const char *json_extension, nim_chatroom_queue_header_cb_func cb, const void *user_data)
查看麦序头元素
nim_chatroom_get_info_async
NIM_SDK_DLL_API void nim_chatroom_get_info_async(const int64_t room_id, const char *json_extension, nim_chatroom_get_info_cb_func cb, const void *user_data)
异步获取当前聊天室信息
nim_chatroom_enter_cb_func
void(* nim_chatroom_enter_cb_func)(int64_t room_id, int enter_step, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:27
nim_chatroom_independent_enter2
NIM_SDK_DLL_API bool nim_chatroom_independent_enter2(const int64_t room_id, const char *enter_info, const NIMChatRoomConfigGetter config_getter)
独立进入聊天室
nim_chatroom_kick_member_async
NIM_SDK_DLL_API void nim_chatroom_kick_member_async(const int64_t room_id, const char *id, const char *notify_ext, const char *json_extension, nim_chatroom_kick_member_cb_func cb, const void *user_data)
异步踢掉指定成员
nim_chatroom_queue_poll_cb_func
void(* nim_chatroom_queue_poll_cb_func)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:239
NIMChatRoomProxyType
NIMChatRoomProxyType
Definition: nim_chatroom_def.h:735
nim_chatroom_query_members_count_by_tag_cb_func
void(* nim_chatroom_query_members_count_by_tag_cb_func)(int64_t room_id, int error_code, uint64_t count, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:176
nim_chatroom_init
NIM_SDK_DLL_API void nim_chatroom_init(const char *json_extension)
聊天室模块初始化(SDK初始化时调用一次)
nim_chatroom_set_member_attribute_async
NIM_SDK_DLL_API void nim_chatroom_set_member_attribute_async(const int64_t room_id, const char *notify_ext, const char *json_extension, nim_chatroom_set_member_attribute_cb_func cb, const void *user_data)
异步修改成员身份标识
nim_chatroom_exit
NIM_SDK_DLL_API void nim_chatroom_exit(const int64_t room_id, const char *json_extension)
聊天室登出
nim_chatroom_def.h
聊天室 接口相关的常量函数等定义头文件
nim_chatroom_get_msg_history_online_async
NIM_SDK_DLL_API void nim_chatroom_get_msg_history_online_async(const int64_t room_id, const char *parameters_json_str, const char *json_extension, nim_chatroom_get_msg_cb_func cb, const void *user_data)
异步获取消息历史
nim_chatroom_query_robot_by_accid_block
NIM_SDK_DLL_API char * nim_chatroom_query_robot_by_accid_block(const int64_t room_id, const char *accid, const char *json_extension)
获取指定机器人信息(同步接口,堵塞NIM内部线程)
nim_chatroom_queue_list_cb_func
void(* nim_chatroom_queue_list_cb_func)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:252
nim_chatroom_reg_link_condition_cb
NIM_SDK_DLL_API void nim_chatroom_reg_link_condition_cb(const char *json_extension, nim_chatroom_link_condition_cb_func cb, const void *user_data)
注册聊天室链接状况回调
nim_chatroom_receive_notification_cb_func
void(* nim_chatroom_receive_notification_cb_func)(int64_t room_id, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:85
nim_chatroom_kick_member_cb_func
void(* nim_chatroom_kick_member_cb_func)(int64_t room_id, int error_code, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:148
nim_chatroom_get_info_cb_func
void(* nim_chatroom_get_info_cb_func)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:138
nim_chatroom_reg_enter_cb
NIM_SDK_DLL_API void nim_chatroom_reg_enter_cb(const char *json_extension, nim_chatroom_enter_cb_func cb, const void *user_data)
注册全局进入聊天室的回调
nim_chatroom_reg_receive_notification_cb
NIM_SDK_DLL_API void nim_chatroom_reg_receive_notification_cb(const char *json_extension, nim_chatroom_receive_notification_cb_func cb, const void *user_data)
注册全局接收通知回调
nim_chatroom_queue_drop_cb_func
void(* nim_chatroom_queue_drop_cb_func)(int64_t room_id, int error_code, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:275
nim_chatroom_get_members_by_tag_online_async
NIM_SDK_DLL_API void nim_chatroom_get_members_by_tag_online_async(const int64_t room_id, const char *parameters_json_str, const char *json_extension, nim_chatroom_get_members_cb_func cb, const void *user_data)
根据 tag 分页获取聊天室成员列表
nim_chatroom_batch_update_cb
void(* nim_chatroom_batch_update_cb)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:306
nim_chatroom_update_my_role_cb_func
void(* nim_chatroom_update_my_role_cb_func)(int64_t room_id, int error_code, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:216
nim_chatroom_query_all_robots_block
NIM_SDK_DLL_API char * nim_chatroom_query_all_robots_block(const int64_t room_id, const char *json_extension)
获取全部机器人信息(同步接口,堵塞NIM内部线程)
nim_chatroom_enter_with_anoymity
NIM_SDK_DLL_API bool nim_chatroom_enter_with_anoymity(const int64_t room_id, const char *anonymity_info, const char *enter_info, const char *json_extension)
聊天室匿名进入
nim_chatroom_query_members_count_by_tag_async
NIM_SDK_DLL_API void nim_chatroom_query_members_count_by_tag_async(const int64_t room_id, const char *target_tag, const char *json_extension, nim_chatroom_query_members_count_by_tag_cb_func cb, const void *user_data)
查询指定 tag 在聊天室的成员数量
nim_chatroom_send_msg
NIM_SDK_DLL_API void nim_chatroom_send_msg(const int64_t room_id, const char *msg, const char *json_extension)
发送消息
nim_chatroom_get_login_state
NIM_SDK_DLL_API int nim_chatroom_get_login_state(const int64_t room_id, const char *json_extension)
获取登录状态
nim_chatroom_get_msg_cb_func
void(* nim_chatroom_get_msg_cb_func)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:110
public_defines.h
NIM SDK 及 NIM ChatRoom SDK 公用头文件
nim_chatroom_reg_exit_cb
NIM_SDK_DLL_API void nim_chatroom_reg_exit_cb(const char *json_extension, nim_chatroom_exit_cb_func cb, const void *user_data)
注册全局登出、被踢回调
nim_chatroom_temp_mute_member_by_tag_async
NIM_SDK_DLL_API void nim_chatroom_temp_mute_member_by_tag_async(const int64_t room_id, const char *target_tag, const int64_t duration, bool need_notify, const char *notify_ext, const char *notify_tags, const char *json_extension, nim_chatroom_temp_mute_member_cb_func cb, const void *user_data)
异步禁言指定 tag 成员
nim_chatroom_get_robots_async
NIM_SDK_DLL_API void nim_chatroom_get_robots_async(const int64_t room_id, int64_t timetag, const char *json_extension, nim_chatroom_query_robots_cb_func cb, const void *user_data)
获取全部机器人信息
nim_chatroom_reg_receive_msgs_cb
NIM_SDK_DLL_API void nim_chatroom_reg_receive_msgs_cb(const char *json_extension, nim_chatroom_receive_msg_cb_func cb, const void *user_data)
注册全局接收批量消息回调
nim_chatroom_queue_poll_async
NIM_SDK_DLL_API void nim_chatroom_queue_poll_async(const int64_t room_id, const char *element_key, const char *json_extension, nim_chatroom_queue_poll_cb_func cb, const void *user_data)
取出麦序头元素
nim_chatroom_update_room_info_cb_func
void(* nim_chatroom_update_room_info_cb_func)(int64_t room_id, int error_code, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:206
nim_chatroom_queue_offer_cb_func
void(* nim_chatroom_queue_offer_cb_func)(int64_t room_id, int error_code, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:226
nim_chatroom_receive_msg_cb_func
void(* nim_chatroom_receive_msg_cb_func)(int64_t room_id, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:75
nim_chatroom_reg_send_msg_ack_cb
NIM_SDK_DLL_API void nim_chatroom_reg_send_msg_ack_cb(const char *json_extension, nim_chatroom_sendmsg_arc_cb_func cb, const void *user_data)
注册全局发送消息回执回调
nim_chatroom_temp_mute_member_async
NIM_SDK_DLL_API void nim_chatroom_temp_mute_member_async(const int64_t room_id, const char *accid, const int64_t duration, bool need_notify, const char *notify_ext, const char *json_extension, nim_chatroom_temp_mute_member_cb_func cb, const void *user_data)
异步临时禁言/解禁成员
nim_chatroom_query_robots_cb_func
void(* nim_chatroom_query_robots_cb_func)(int rescode, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:295
nim_chatroom_queue_header_cb_func
void(* nim_chatroom_queue_header_cb_func)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:265
nim_chatroom_queue_list_async
NIM_SDK_DLL_API void nim_chatroom_queue_list_async(const int64_t room_id, const char *json_extension, nim_chatroom_queue_list_cb_func cb, const void *user_data)
排序列出所有麦序元素
nim_chatroom_set_msgs_batch_report
NIM_SDK_DLL_API void nim_chatroom_set_msgs_batch_report(bool set_batch, const char *json_extension)
设置消息接收批量上报开关
nim_chatroom_batch_upate_async
NIM_SDK_DLL_API void nim_chatroom_batch_upate_async(const int64_t room_id, const char *element_info_json_str, bool need_notify, const char *notify_ext, const char *json_extension, nim_chatroom_batch_update_cb cb, const void *user_data)
批量更新队列信息
nim_chatroom_temp_mute_member_cb_func
void(* nim_chatroom_temp_mute_member_cb_func)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:161
nim_chatroom_set_member_attribute_cb_func
void(* nim_chatroom_set_member_attribute_cb_func)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:122
nim_chatroom_queue_drop_async
NIM_SDK_DLL_API void nim_chatroom_queue_drop_async(const int64_t room_id, const char *json_extension, nim_chatroom_queue_drop_cb_func cb, const void *user_data)
(聊天室管理员权限)删除麦序队列
nim_chatroom_get_members_online_async
NIM_SDK_DLL_API void nim_chatroom_get_members_online_async(const int64_t room_id, const char *parameters_json_str, const char *json_extension, nim_chatroom_get_members_cb_func cb, const void *user_data)
异步获取聊天室成员信息
nim_chatroom_link_condition_cb_func
void(* nim_chatroom_link_condition_cb_func)(int64_t room_id, int condition, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:53
nim_chatroom_reg_receive_msg_cb
NIM_SDK_DLL_API void nim_chatroom_reg_receive_msg_cb(const char *json_extension, nim_chatroom_receive_msg_cb_func cb, const void *user_data)
注册全局接收消息回调
nim_chatroom_sendmsg_arc_cb_func
void(* nim_chatroom_sendmsg_arc_cb_func)(int64_t room_id, int error_code, const char *result, const char *json_extension, const void *user_data)
Definition: nim_chatroom_def.h:65
nim_chatroom_enter
NIM_SDK_DLL_API bool nim_chatroom_enter(const int64_t room_id, const char *request_enter_data, const char *enter_info, const char *json_extension)
聊天室进入
nim_chatroom_cleanup
NIM_SDK_DLL_API void nim_chatroom_cleanup(const char *json_extension)
聊天室模块清理(SDK卸载前调用一次)
nim_chatroom_update_my_role_async
NIM_SDK_DLL_API void nim_chatroom_update_my_role_async(const int64_t room_id, const char *role_info_json_str, bool need_notify, const char *notify_ext, const char *json_extension, nim_chatroom_update_my_role_cb_func cb, const void *user_data)
更新我的信息,目前只支持更新kNIMChatRoomMemberInfoKeyNick,kNIMChatRoomMemberInfoKeyAvatar,kNIMChatRoomMemberInfoKey...