giga::core::User Class Referencefinal

A user with an account on GiGa.GG. Cf: https://giga.gg/users/profile/1704781. More...

#include <User.h>

Classes

class  ContactData
 
class  PersonalData
 

Public Types

enum  Activity { very_active = 0, active, inactive }
 
enum  SeederStatus { no = 0, yes, to_some_people }
 
enum  ReportedState {
  pending = 0, probation, checkup, suspended,
  free, no_report
}
 
enum  UserGender { male = 0, female, unknown }
 

Public Member Functions

 User (User &&)=default
 
 User (const User &)=default
 
Useroperator= (const User &)
 
Useroperator= (User &&rhs) noexcept
 
 User (std::shared_ptr< data::User > u, const Application &app, std::shared_ptr< data::UsersRelation > r=nullptr)
 
uint64_t id () const
 
const utility::string_t & login () const
 
web::uri avatarUri () const
 
web::uri bigAvatarUri () const
 
std::chrono::system_clock::time_point creationDate () const
 
std::chrono::system_clock::time_point lastConnectionDate () const
 
Activity activity () const
 
bool isUnlimited () const
 
SeederStatus isSeeder () const
 
uint64_t contactCount () const
 
const std::vector
< utility::string_t > & 
tags () const
 
Country country () const
 
Language language () const
 
const utility::string_t & description () const
 
bool hasContactData () const
 
ContactDatacontactData ()
 Get the data shared by this user. More...
 
bool hasPersonalData () const
 
const PersonalDatapersonalData () const
 Get the personal data of the currentUser. More...
 
bool hasRelation () const
 
UserRelation relation () const
 Get the UserRelation data between this user and the currentUser. More...
 
User invite ()
 Send an invitation from the currentUser to this user. More...
 
User block ()
 The currentUser blocks this user. More...
 
User acceptInvitation ()
 Accept an invitation received from this user to the currentUser. More...
 
void suggest (const User &contact)
 Suggest contact to this user. More...
 
void removeRelation ()
 Remove a relation. Make sure this user hasRelation() const More...
 

Friends

class giga::Application
 

Detailed Description

A user with an account on GiGa.GG. Cf: https://giga.gg/users/profile/1704781.

Member Function Documentation

User giga::core::User::acceptInvitation ( )

Accept an invitation received from this user to the currentUser.

Returns
A new User with the relation() set to a contact UserRelation (and contactData() set).
Exceptions
HttpError
User giga::core::User::block ( )

The currentUser blocks this user.

Returns
A new User with the relation() set to a block UserRelation.
Exceptions
HttpError
User::ContactData & giga::core::User::contactData ( )

Get the data shared by this user.

Make sure this user hasContactData().
To get a user with contact data, you can user Application::getContacts() or Application::getContact().

Returns
The data shared by this user.
Exceptions
ErrorExceptionif there is no contactData.
bool giga::core::User::hasContactData ( ) const
Returns
true if the user has contact data.
bool giga::core::User::hasPersonalData ( ) const
Returns
true if the user has personal data (this is true only for the currentUser)
bool giga::core::User::hasRelation ( ) const
Returns
true if this user has a UserRelation set.
User giga::core::User::invite ( )

Send an invitation from the currentUser to this user.

Returns
A new User with the relation() set to an invitation.
Exceptions
HttpError
User::SeederStatus giga::core::User::isSeeder ( ) const

The seederStatus defines if a user share some nodes to other users.

const User::PersonalData & giga::core::User::personalData ( ) const

Get the personal data of the currentUser.

Make sure this user hasPersonalData().
To get the currentUser uses Application::currentUser().

Exceptions
ErrorExceptionif there is no personalData.
UserRelation giga::core::User::relation ( ) const

Get the UserRelation data between this user and the currentUser.

Make sure this user hasRelation() const.
To get users with relational data with the currentUser, you may use one of these functions:

Exceptions
ErrorExceptionif there is no relation.
void giga::core::User::removeRelation ( )

Remove a relation. Make sure this user hasRelation() const

Exceptions
HttpError
See Also
UserRelation
void giga::core::User::suggest ( const User contact)

Suggest contact to this user.

Exceptions
HttpError
See Also
UserRelation
const std::vector< string_t > & giga::core::User::tags ( ) const

A user may add a list of Tags to describe is account. The tags do not include the leading '#'. You should always display them with a '#' first.


The documentation for this class was generated from the following files:
  • /home/thomas/code/GiGaSdk/src/giga/core/User.h
  • /home/thomas/code/GiGaSdk/src/giga/core/User.cpp