17 #ifndef GIGA_CORE_USER_H_
18 #define GIGA_CORE_USER_H_
20 #include "UserRelation.h"
21 #include "FolderNode.h"
22 #include "../utils/Crypto.h"
24 #include <boost/optional.hpp>
25 #include <cpprest/http_client.h>
48 Country(
const utility::string_t& code) : code(code) {}
56 const utility::string_t code;
64 Language(
const utility::string_t& code) : code(code) {}
66 Language(Language&&) =
default;
67 Language(
const Language&) =
default;
68 ~Language() =
default;
69 Language& operator=(
const Language&)=
default;
70 Language& operator=(Language&&) =
default;
72 const utility::string_t code;
84 very_active = 0, active, inactive
86 enum class SeederStatus
88 no = 0, yes, to_some_people
90 enum class ReportedState {
91 pending = 0, probation, checkup, suspended, free,
94 enum class UserGender {
95 male = 0, female, unknown
104 User& operator=(
User&& rhs) noexcept;
106 explicit User(std::shared_ptr<data::User> u,
const Application& app, std::shared_ptr<data::UsersRelation> r =
nullptr);
112 const utility::string_t&
119 bigAvatarUri ()
const;
121 std::chrono::system_clock::time_point
122 creationDate ()
const;
124 std::chrono::system_clock::time_point
125 lastConnectionDate ()
const;
131 isUnlimited ()
const;
140 contactCount ()
const;
148 const std::vector<utility::string_t>&
157 const utility::string_t&
158 description ()
const;
182 const boost::optional<utility::string_t>&
185 const boost::optional<std::chrono::system_clock::time_point>
198 std::shared_ptr<data::User> _data;
218 explicit PersonalData(std::shared_ptr<data::User> u,
const utility::string_t& password);
222 reportedState()
const;
225 isEmailValidated()
const;
227 const utility::string_t&
230 const utility::string_t&
234 nodeKeyClear()
const;
240 standatdMaxStorage()
const;
254 std::shared_ptr<data::User> _data;
255 std::string _nodeKeyClear;
365 initializePersonalData (
const utility::string_t& password);
368 std::shared_ptr<data::User> _data;
369 std::shared_ptr<data::UsersRelation> _relation;
370 boost::optional<PersonalData> _private;
371 boost::optional<ContactData> _protected;
372 boost::optional<giga::Rsa> _publicKey;
User block()
The currentUser blocks this user.
Definition: User.cpp:402
void suggest(const User &contact)
Suggest contact to this user.
Definition: User.cpp:413
bool hasContactData() const
Definition: User.cpp:314
Definition: UserRelation.h:45
bool hasRelation() const
Definition: User.cpp:368
const PersonalData & personalData() const
Get the personal data of the currentUser.
Definition: User.cpp:356
User acceptInvitation()
Accept an invitation received from this user to the currentUser.
Definition: User.cpp:423
ContactData & contactData()
Get the data shared by this user.
Definition: User.cpp:320
void removeRelation()
Remove a relation. Make sure this user hasRelation() const
Definition: User.cpp:440
const std::vector< utility::string_t > & tags() const
Definition: User.cpp:149
SeederStatus isSeeder() const
Definition: User.cpp:135
UserRelation relation() const
Get the UserRelation data between this user and the currentUser.
Definition: User.cpp:374
A user with an account on GiGa.GG. Cf: https://giga.gg/users/profile/1704781.
Definition: User.h:79
Definition: FolderNode.h:27
bool hasPersonalData() const
Definition: User.cpp:338
User invite()
Send an invitation from the currentUser to this user.
Definition: User.cpp:384
Definition: Application.h:45