NIM PC Cross Platform SDK
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>
19namespace nim {
23class NIM_SDK_CPPWRAPPER_DLL_API Friend {
24public:
26 typedef std::function<void(const FriendChangeEvent&)> FriendChangeCallback;
28 typedef std::function<void(NIMResCode res_code)> FriendOptCallback;
29 typedef std::function<void(NIMResCode res_code, const std::list<nim::FriendProfile>& user_profile_list)>
32 typedef std::function<void(const std::string& accid, const nim::FriendProfile& user_profile)>
35
36public:
46 static void RegChangeCb(const FriendChangeCallback& cb, const std::string& json_extension = "");
47
61 static bool Request(const std::string& accid,
62 NIMVerifyType verify_type,
63 const std::string& msg,
64 const FriendOptCallback& cb,
65 const std::string& json_extension = "");
66
77 static bool Delete(const std::string& accid, const FriendOptCallback& cb, const std::string& json_extension = "");
78
89 static bool DeleteEx(const std::string& accid, const DeleteFriendOption& option, const FriendOptCallback& cb);
90
101 static bool Update(const FriendProfile& friend_profile, const FriendOptCallback& cb, const std::string& json_extension = "");
102
110 static void GetList(const GetFriendsListCallback& cb, const std::string& json_extension = "");
111
119 static void GetFriendProfile(const std::string& accid, const GetFriendProfileCallback& cb, const std::string& json_extension = "");
120
127 static bool ParseFriendAddEvent(const FriendChangeEvent& change_event, FriendAddEvent& out_event);
128
135 static bool ParseFriendDelEvent(const FriendChangeEvent& change_event, FriendDelEvent& out_event);
136
143 static bool ParseFriendProfileUpdateEvent(const FriendChangeEvent& change_event, FriendProfileUpdateEvent& out_event);
144
151 static bool ParseFriendProfileSyncEvent(const FriendChangeEvent& change_event, FriendProfileSyncEvent& out_event);
152
157 static void UnregFriendCb();
158
165 static bool QueryFriendshipBlock(const std::string& accid, const std::string& json_extension = "");
166
175 static bool QueryFriendListByKeyword(const std::string& keyword, const GetFriendsListCallback& cb, const std::string& json_extension = "");
176};
177
178} // namespace nim
179
180#endif //_NIM_SDK_CPP_FRIEND_H_
NIM 好友相关接口
Definition: nim_cpp_friend.h:23
std::function< void(const std::string &accid, const nim::FriendProfile &user_profile)> GetFriendProfileCallback
获取好友信息回调模板
Definition: nim_cpp_friend.h:34
std::function< void(NIMResCode res_code)> FriendOptCallback
变更好友信息回调模板
Definition: nim_cpp_friend.h:28
std::function< void(const FriendChangeEvent &)> FriendChangeCallback
好友信息变更通知回调模板
Definition: nim_cpp_friend.h:26
std::function< void(NIMResCode res_code, const std::list< nim::FriendProfile > &user_profile_list)> GetFriendsListCallback
获取好友回调模板
Definition: nim_cpp_friend.h:31
namespace nim
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
NIMVerifyType
Definition: nim_friend_def.h:68
SDK好友辅助方法
定义导出宏
删除好有拓展选项
Definition: nim_friend_helper.h:45
云信好友变更事件(请求添加)
Definition: nim_friend_helper.h:253
云信好友变更事件
Definition: nim_friend_helper.h:245
云信好友变更事件(删除)
Definition: nim_friend_helper.h:265
云信好友
Definition: nim_friend_helper.h:54
云信好友变更事件(多端同步)
Definition: nim_friend_helper.h:277
云信好友变更事件(更新)
Definition: nim_friend_helper.h:271