NIM PC Cross Platform SDK
nim_cpp_team.h
Go to the documentation of this file.
1
7#ifndef _NIM_SDK_CPP_TEAM_H_
8#define _NIM_SDK_CPP_TEAM_H_
9
10#include <functional>
11#include <list>
12#include <map>
13#include <string>
21namespace nim {
22
26class NIM_SDK_CPPWRAPPER_DLL_API Team {
27public:
29 typedef std::function<void(const TeamEvent& team_event)> TeamEventCallback;
31 typedef std::function<void(int team_count, const std::list<std::string>& team_id_list)> QueryAllMyTeamsCallback;
32 typedef std::function<void(int team_count, const std::list<nim::TeamInfo>& team_info_list)>
35 typedef std::function<void(int count, const std::list<nim::TeamMemberProperty>& all_my_member_info_list)>
38 typedef std::function<void(const std::string& tid, int member_count, const std::list<TeamMemberProperty>& props)>
42 typedef std::function<void(const TeamMemberProperty& team_member_property)> QueryTeamMemberCallback;
44 typedef std::function<void(const std::string& tid, const TeamInfo& result)> QueryTeamInfoCallback;
45 typedef std::function<void(NIMResCode error_code, const std::string& tid, const std::list<TeamMemberProperty>& team_member_propertys)>
48 typedef std::function<void(NIMResCode, const std::string&, const std::map<std::string, std::string>&)>
51 typedef QueryAllMyTeamsInfoCallback QueryTeamsInfoCallback;
54 typedef std::function<void(const std::list<std::string>& success_ids, const std::list<std::string>& failure_ids)>
57 typedef std::function<void(const std::string& tid,
58 const std::list<std::string>& success_ids,
59 const std::list<std::string>& failure_ids,
60 const std::list<std::string>& ignored_ids)>
61 TeamMsgAckReadCallback;
62 typedef std::function<void(NIMResCode error_code, const std::list<nim::TeamInfo>& team_info_list, const std::list<std::string>& fail_list)>
71 static void RegTeamEventCb(const TeamEventCallback& cb, const std::string& json_extension = "");
72
91 static bool CreateTeamAsync(const TeamInfo& team_info,
92 const std::list<std::string>& ids,
93 const std::string& invitation_postscript,
94 const TeamEventCallback& cb,
95 const std::string& json_extension = "");
96
116 static bool InviteAsync(const std::string& tid,
117 const std::list<std::string>& ids,
118 const std::string& invitation_postscript,
119 const TeamEventCallback& cb,
120 const std::string& json_extension = "");
121
143 static bool InviteAsync2(const std::string& tid,
144 const std::list<std::string>& ids,
145 const std::string& invitation_postscript,
146 const std::string& invitation_attachment,
147 const TeamEventCallback& cb,
148 const std::string& json_extension = "");
149
167 static bool KickAsync(const std::string& tid,
168 const std::list<std::string>& ids,
169 const TeamEventCallback& cb,
170 const std::string& json_extension = "");
171
182 static bool LeaveAsync(const std::string& tid, const TeamEventCallback& cb, const std::string& json_extension = "");
183
194 static bool DismissAsync(const std::string& tid, const TeamEventCallback& cb, const std::string& json_extension = "");
195
210 static bool UpdateTeamInfoAsync(const std::string& tid,
211 const TeamInfo& team_info,
212 const TeamEventCallback& cb,
213 const std::string& json_extension = "");
214
233 static bool ApplyJoinAsync(const std::string& tid,
234 const std::string& reason,
235 const TeamEventCallback& cb,
236 const std::string& json_extension = "");
237
256 static bool PassJoinApplyAsync(const std::string& tid,
257 const std::string& applicant_id,
258 const TeamEventCallback& cb,
259 const std::string& json_extension = "");
260
279 static bool RejectJoinApplyAsync(const std::string& tid,
280 const std::string& applicant_id,
281 const std::string& reason,
282 const TeamEventCallback& cb,
283 const std::string& json_extension = "");
284
300 static bool AddManagersAsync(const std::string& tid,
301 const std::list<std::string>& ids,
302 const TeamEventCallback& cb,
303 const std::string& json_extension = "");
304
320 static bool RemoveManagersAsync(const std::string& tid,
321 const std::list<std::string>& ids,
322 const TeamEventCallback& cb,
323 const std::string& json_extension = "");
324
343 static bool TransferTeamAsync(const std::string& tid,
344 const std::string& new_owner_id,
345 bool is_leave,
346 const TeamEventCallback& cb,
347 const std::string& json_extension = "");
348
360 static bool UpdateMyPropertyAsync(const TeamMemberProperty& prop, const TeamEventCallback& cb, const std::string& json_extension = "");
361
374 static bool UpdateOtherNickAsync(const TeamMemberProperty& prop, const TeamEventCallback& cb, const std::string& json_extension = "");
375
391 static bool AcceptInvitationAsync(const std::string& tid,
392 const std::string& invitor_id,
393 const TeamEventCallback& cb,
394 const std::string& json_extension = "");
395
413 static bool RejectInvitationAsync(const std::string& tid,
414 const std::string& invitor_id,
415 const std::string& reason,
416 const TeamEventCallback& cb,
417 const std::string& json_extension = "");
418
425 static void QueryAllMyTeamsAsync(const QueryAllMyTeamsCallback& cb, const std::string& json_extension = "");
426
433 static void QueryAllMyTeamsInfoAsync(const QueryAllMyTeamsInfoCallback& cb, const std::string& json_extension = "");
434
441 static void QueryMyAllMemberInfosAsync(const QueryMyAllMemberInfosCallback& cb, const std::string& json_extension = "");
442
453 static bool QueryTeamMembersAsync(const std::string& tid, const QueryTeamMembersCallback& cb, const std::string& json_extension = "");
454
466 static bool QueryTeamMemberAsync(const std::string& tid,
467 const std::string& id,
468 const QueryTeamMemberCallback& cb,
469 const std::string& json_extension = "");
470
477 static TeamMemberProperty QueryTeamMemberBlock(const std::string& tid, const std::string& id);
478
486 static bool QueryTeamInfoAsync(const std::string& tid, const QueryTeamInfoCallback& cb, const std::string& json_extension = "");
487
493 static TeamInfo QueryTeamInfoBlock(const std::string& tid);
494
504 static bool QueryTeamInfoOnlineAsync(const std::string& tid, const TeamEventCallback& cb, const std::string& json_extension = "");
505
512 static bool ParseTeamInfo(const std::string& json_team_info, TeamInfo& team_info);
513
518 static void UnregTeamCb();
519
538 static bool MuteMemberAsync(const std::string& tid,
539 const std::string& member_id,
540 bool set_mute,
541 const TeamEventCallback& cb,
542 const std::string& json_extension = "");
543
554 static bool QueryMuteListOnlineAsync(const std::string& tid, const QueryTeamMembersOnlineCallback& cb, const std::string& json_extension = "");
555
566 static bool MuteAsync(const std::string& tid, bool set_mute, const TeamEventCallback& cb, const std::string& json_extension = "");
567
581 static void TeamMsgAckRead(const std::string& tid,
582 const std::list<IMMessage>& msgs,
583 const TeamEventCallback& cb,
584 const std::string& json_extension = "");
585
599 static void TeamMsgAckReadEx(const std::string& tid,
600 const std::list<IMMessage>& msgs,
601 const TeamMsgAckReadCallback& cb,
602 const std::string& json_extension = "");
603
617 static void TeamMsgQueryUnreadList(const std::string& tid,
618 const IMMessage& msg,
619 const TeamEventCallback& cb,
620 const std::string& json_extension = "");
621
637 static void TeamMsgQueryUnreadList(const std::string& tid,
638 const IMMessage& msg,
639 const std::list<std::string>& accids,
640 const TeamEventCallback& cb,
641 const std::string& json_extension = "");
642
651 static void QueryTeamMembersInvitor(const std::string& tid, const std::list<std::string>& members, const QueryTeamMembersInvitorCallback& cb);
652
662 static bool QueryTeamInfoByKeywordAsync(const std::string& keyword, const QueryTeamsInfoCallback& cb, const std::string& json_extension = "");
663
676 static void UpdateTInfoLocal(const std::list<TeamInfo>& team_infos, const UpdateTInfoLocalCallback& cb, const std::string& json_extension = "");
677
687 static void GetTeamInfoBatchSFTrans(const GetTeamInfoBatchSFTransCallback& cb, uint64_t time_tag = 0, const std::string& json_extension = "");
688
698 static void GetTeaminfoList(const std::list<std::string>& tid_list, const GetTeamInfoListCallback& cb);
699};
700
701} // namespace nim
702
703#endif //_NIM_SDK_CPP_TEAM_H_
群组功能;主要包括查询群信息、查询群成员信息、加人、踢人等功能
Definition: nim_cpp_team.h:26
std::function< void(const std::string &tid, int member_count, const std::list< TeamMemberProperty > &props)> QueryTeamMembersCallback
查询指定群组全部成员信息回调模板
Definition: nim_cpp_team.h:40
QueryAllMyTeamsInfoCallback GetTeamInfoBatchSFTransCallback
查询所有群信息回调模板 顺丰专用
Definition: nim_cpp_team.h:53
std::function< void(int team_count, const std::list< std::string > &team_id_list)> QueryAllMyTeamsCallback
查询本人所有群ID回调模板
Definition: nim_cpp_team.h:31
std::function< void(const TeamEvent &team_event)> TeamEventCallback
群组事件通知回调模板
Definition: nim_cpp_team.h:29
std::function< void(const TeamMemberProperty &team_member_property)> QueryTeamMemberCallback
查询指定群成员信息回调模板
Definition: nim_cpp_team.h:42
std::function< void(NIMResCode, const std::string &, const std::map< std::string, std::string > &)> QueryTeamMembersInvitorCallback
查询群成员邀请人accid 列表回调模板
Definition: nim_cpp_team.h:50
std::function< void(const std::list< std::string > &success_ids, const std::list< std::string > &failure_ids)> UpdateTInfoLocalCallback
更新本地缓存回调模板顺丰专用
Definition: nim_cpp_team.h:56
std::function< void(const std::string &tid, const TeamInfo &result)> QueryTeamInfoCallback
查询指定群信息回调模板
Definition: nim_cpp_team.h:44
std::function< void(NIMResCode error_code, const std::list< nim::TeamInfo > &team_info_list, const std::list< std::string > &fail_list)> GetTeamInfoListCallback
查询给定的一组群ID详细信息的回调模板
Definition: nim_cpp_team.h:64
std::function< void(NIMResCode error_code, const std::string &tid, const std::list< TeamMemberProperty > &team_member_propertys)> QueryTeamMembersOnlineCallback
查询群成员信息回调模板
Definition: nim_cpp_team.h:47
std::function< void(int team_count, const std::list< nim::TeamInfo > &team_info_list)> QueryAllMyTeamsInfoCallback
查询本人所有群信息回调模板
Definition: nim_cpp_team.h:34
std::function< void(int count, const std::list< nim::TeamMemberProperty > &all_my_member_info_list)> QueryMyAllMemberInfosCallback
查询本人所有群里我的成员信息回调模板
Definition: nim_cpp_team.h:37
namespace nim
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
定义导出宏
Talk 辅助方法和数据结构定义
Team 辅助方法和数据结构定义
Definition: nim_talk_helper.h:281
群组事件通知
Definition: nim_team_helper.h:379
群组信息
Definition: nim_team_helper.h:24
群组成员信息
Definition: nim_team_helper.h:282