NIM PC Cross Platform SDK
nim_cpp_user.h
Go to the documentation of this file.
1
7#ifndef _NIM_SDK_CPP_USER_H_
8#define _NIM_SDK_CPP_USER_H_
9
10#include <functional>
11#include <list>
12#include <string>
19namespace nim {
20
26class NIM_SDK_CPPWRAPPER_DLL_API User {
27public:
31 typedef std::function<void(NIMResCode res_code, const std::string& accid, bool set_opt)> SetRelationCallback;
37 typedef std::function<void(NIMResCode res_code, const std::list<BlackMuteListInfo>&)> GetMuteListCallback;
39 typedef std::function<void(NIMResCode res_code, const std::list<BlackMuteListInfo>&)> GetBlackListCallback;
41 typedef std::function<void(const std::list<UserNameCard>&)> UserNameCardChangedCallback;
43 typedef std::function<void(const std::list<UserNameCard>&)> GetUserNameCardCallback;
45 typedef std::function<void(NIMResCode res_code)> UpdateMyUserNameCardCallback;
46
53 static void RegSpecialRelationshipChangedCb(const SpecialRelationshipChangedCallback& cb, const std::string& json_extension = "");
54
65 static bool SetBlack(const std::string& accid, bool set_black, const SetBlackCallback& cb, const std::string& json_extension = "");
66
77 static bool SetMute(const std::string& accid, bool set_mute, const SetMuteCallback& cb, const std::string& json_extension = "");
78
86 static void GetMutelist(const GetMuteListCallback& cb, const std::string& json_extension = "");
87
94 static void GetBlacklist(const GetBlackListCallback& cb, const std::string& json_extension = "");
95
102 static void RegUserNameCardChangedCb(const UserNameCardChangedCallback& cb, const std::string& json_extension = "");
103
117 static bool GetUserNameCard(const std::list<std::string>& accids, const GetUserNameCardCallback& cb, const std::string& json_extension = "");
118
133 static bool GetUserNameCardOnline(const std::list<std::string>& accids,
134 const GetUserNameCardCallback& cb,
135 const std::string& json_extension = "");
136
148 static bool UpdateMyUserNameCard(const UserNameCard& namecard, const UpdateMyUserNameCardCallback& cb, const std::string& json_extension = "");
149
157 static bool QueryUserListByKeyword(const std::string& keyword, const GetUserNameCardCallback& cb, const std::string& json_extension = "");
158
165 static bool ParseBlackListInfoChange(const SpecialRelationshipChangeEvent& change_event, BlackMuteListInfo& info);
166
173 static bool ParseMuteListInfoChange(const SpecialRelationshipChangeEvent& change_event, BlackMuteListInfo& info);
174
182 static bool ParseSyncSpecialRelationshipChange(const SpecialRelationshipChangeEvent& change_event, std::list<BlackMuteListInfo>& black_mute_list);
183
191 static void UpdatePushToken(const std::string& cer_name, const std::string& token, int type);
192
197 static void UnregUserCb();
198};
199
200} // namespace nim
201
202#endif //_NIM_SDK_CPP_USER_H_
NIM SDK提供的用户相关接口
Definition: nim_cpp_user.h:26
SetRelationCallback SetBlackCallback
设置黑名单回调模板
Definition: nim_cpp_user.h:33
std::function< void(NIMResCode res_code, const std::string &accid, bool set_opt)> SetRelationCallback
设置黑名单\静音列表回调模板
Definition: nim_cpp_user.h:31
std::function< void(NIMResCode res_code, const std::list< BlackMuteListInfo > &)> GetBlackListCallback
设置黑名单列表回调模板
Definition: nim_cpp_user.h:39
std::function< void(NIMResCode res_code)> UpdateMyUserNameCardCallback
更新自己的名片回调模板
Definition: nim_cpp_user.h:45
std::function< void(const SpecialRelationshipChangeEvent &)> SpecialRelationshipChangedCallback
黑名单\静音列表变更事件通知回调模板
Definition: nim_cpp_user.h:29
std::function< void(const std::list< UserNameCard > &)> GetUserNameCardCallback
获取用户名片回调模板
Definition: nim_cpp_user.h:43
SetRelationCallback SetMuteCallback
设置静音列表回调模板
Definition: nim_cpp_user.h:35
std::function< void(const std::list< UserNameCard > &)> UserNameCardChangedCallback
用户名片变更通知回调模板
Definition: nim_cpp_user.h:41
std::function< void(NIMResCode res_code, const std::list< BlackMuteListInfo > &)> GetMuteListCallback
获取静音列表回调模板
Definition: nim_cpp_user.h:37
namespace nim
NIMResCode
Definition: nim_chatroom_res_code_def.h:15
定义导出宏
SDK用户信息辅助方法
黑名单 静音名单信息
Definition: nim_user_helper.h:276
黑名单和静音名单变更通知
Definition: nim_user_helper.h:296
云信用户名片
Definition: nim_user_helper.h:47