NIM SDK API  9.0.0
nim_cpp_friend.h
Go to the documentation of this file.
1 
7 #ifndef _NIM_SDK_CPP_FRIEND_H_
8 #define _NIM_SDK_CPP_FRIEND_H_
9 
10 #include <functional>
11 #include <list>
12 #include <string>
19 namespace nim {
23 class NIM_SDK_CPPWRAPPER_DLL_API Friend {
24 public:
25  typedef std::function<void(const FriendChangeEvent&)> FriendChangeCallback;
26  typedef std::function<void(NIMResCode res_code)> FriendOptCallback;
27  typedef std::function<void(NIMResCode res_code, const std::list<nim::FriendProfile>& user_profile_list)>
29  typedef std::function<void(const std::string& accid, const nim::FriendProfile& user_profile)>
32 public:
42  static void RegChangeCb(const FriendChangeCallback& cb, const std::string& json_extension = "");
43 
57  static bool Request(const std::string& accid,
58  NIMVerifyType verify_type,
59  const std::string& msg,
60  const FriendOptCallback& cb,
61  const std::string& json_extension = "");
62 
73  static bool Delete(const std::string& accid, const FriendOptCallback& cb, const std::string& json_extension = "");
74 
85  static bool DeleteEx(const std::string& accid, const DeleteFriendOption& option, const FriendOptCallback& cb);
86 
97  static bool Update(const FriendProfile& friend_profile, const FriendOptCallback& cb, const std::string& json_extension = "");
98 
106  static void GetList(const GetFriendsListCallback& cb, const std::string& json_extension = "");
107 
115  static void GetFriendProfile(const std::string& accid, const GetFriendProfileCallback& cb, const std::string& json_extension = "");
116 
123  static bool ParseFriendAddEvent(const FriendChangeEvent& change_event, FriendAddEvent& out_event);
124 
131  static bool ParseFriendDelEvent(const FriendChangeEvent& change_event, FriendDelEvent& out_event);
132 
139  static bool ParseFriendProfileUpdateEvent(const FriendChangeEvent& change_event, FriendProfileUpdateEvent& out_event);
140 
147  static bool ParseFriendProfileSyncEvent(const FriendChangeEvent& change_event, FriendProfileSyncEvent& out_event);
148 
153  static void UnregFriendCb();
154 
161  static bool QueryFriendshipBlock(const std::string& accid, const std::string& json_extension = "");
162 
171  static bool QueryFriendListByKeyword(const std::string& keyword, const GetFriendsListCallback& cb, const std::string& json_extension = "");
172 };
173 
174 } // namespace nim
175 
176 #endif //_NIM_SDK_CPP_FRIEND_H_
nim::FriendDelEvent
云信好友变更事件(删除)
Definition: nim_friend_helper.h:240
nim::FriendProfile
云信好友
Definition: nim_friend_helper.h:45
nim::Friend
NIM 好友相关接口
Definition: nim_cpp_friend.h:23
nim::Friend::FriendOptCallback
std::function< void(NIMResCode res_code)> FriendOptCallback
Definition: nim_cpp_friend.h:26
nim_friend_helper.h
SDK好友辅助方法
nim::DeleteFriendOption
删除好有拓展选项
Definition: nim_friend_helper.h:36
nim::Friend::FriendChangeCallback
std::function< void(const FriendChangeEvent &)> FriendChangeCallback
Definition: nim_cpp_friend.h:25
nim::FriendProfileUpdateEvent
云信好友变更事件(更新)
Definition: nim_friend_helper.h:245
nim
namespace nim
nim::Friend::GetFriendsListCallback
std::function< void(NIMResCode res_code, const std::list< nim::FriendProfile > &user_profile_list)> GetFriendsListCallback
Definition: nim_cpp_friend.h:28
nim::FriendAddEvent
云信好友变更事件(请求添加)
Definition: nim_friend_helper.h:232
nim::FriendProfileSyncEvent
云信好友变更事件(多端同步)
Definition: nim_friend_helper.h:250
nim::Friend::GetFriendProfileCallback
std::function< void(const std::string &accid, const nim::FriendProfile &user_profile)> GetFriendProfileCallback
Definition: nim_cpp_friend.h:30
nim_sdk_cpp_wrapper.h
定义导出宏
nim::FriendChangeEvent
云信好友变更事件
Definition: nim_friend_helper.h:226