|
SmartFoxServer 3 C++ Client API 3.1.0-beta
Client API for SmartFoxServer 3
|
Manages the current user's Buddy List system. More...
#include <BuddyManager.h>
Public Member Functions | |
| virtual bool | isInited () const =0 |
| Indicates whether the client's Buddy List system is initialized or not. | |
| virtual bool | containsBuddy (const std::string &name) const =0 |
| Indicates whether a buddy exists in user's buddies list or not. | |
| virtual std::shared_ptr< entities::Buddy > | getBuddyById (int32_t id) const =0 |
| Retrieves a Buddy object from its id property. | |
| virtual std::shared_ptr< entities::Buddy > | getBuddyByName (const std::string &name) const =0 |
| Retrieves a Buddy object from its name property. | |
| virtual std::shared_ptr< entities::Buddy > | getBuddyByNickName (const std::string &nickName) const =0 |
| Retrieves a Buddy object from its nickName property (if set). | |
| virtual std::vector< std::shared_ptr< entities::Buddy > > | getOfflineBuddies () const =0 |
| Returns a list of Buddy objects representing all the offline buddies in the user's buddies list. | |
| virtual std::vector< std::shared_ptr< entities::Buddy > > | getOnlineBuddies () const =0 |
| Returns a list of Buddy objects representing all the online buddies in the user's buddies list. | |
| virtual std::vector< std::shared_ptr< entities::Buddy > > | getBuddyList () const =0 |
| Returns a list of Buddy objects representing all the buddies in the user's buddies list. | |
| virtual std::vector< std::string > | getBuddyStates () const =0 |
| Returns a list of strings representing the available custom buddy states. | |
| virtual std::shared_ptr< entities::BuddyVariable > | getMyVariable (const std::string &varName) const =0 |
| Retrieves a Buddy Variable from its name. | |
| virtual std::vector< std::shared_ptr< entities::BuddyVariable > > | getMyVariables () const =0 |
| Returns all the Buddy Variables associated with the current user. | |
| virtual bool | getMyOnlineState () const =0 |
| Returns the current user's online/offline state. | |
| virtual std::optional< std::string > | getMyNickName () const =0 |
| Returns the current user's nickname (if set). | |
| virtual std::optional< std::string > | getMyState () const =0 |
| Returns the current user's custom state (if set). | |
| virtual std::string | getMyDisplayName () const =0 |
| Gets the nickname of the current User, or the User's name if the nickname is not set or is empty. | |
Manages the current user's Buddy List system.
It keeps track of all the buddies of the user, of their state and of their Buddy Variables. It also gives access to the properties of the user himself, as the other users who have him as a buddy see them.
|
pure virtual |
Indicates whether the client's Buddy List system is initialized or not.
If it is not, send a requests::buddy::InitBuddyListRequest to the server to load the persistent Buddy List data.
No Buddy List related operations are allowed until the system is initialized.
|
pure virtual |
Indicates whether a buddy exists in user's buddies list or not.
| name | The name of the buddy whose presence in the buddies list is to be tested. |
true if the specified buddy exists in the buddies list.
|
pure virtual |
Retrieves a Buddy object from its id property.
| id | The id of the buddy to be found. |
nullptr if no buddy with the passed id exists in the buddies list.
|
pure virtual |
Retrieves a Buddy object from its name property.
| name | The name of the buddy to be found. |
nullptr if no buddy with the passed name exists in the buddies list.
|
pure virtual |
Retrieves a Buddy object from its nickName property (if set).
| nickName | The nickName of the buddy to be found. |
nullptr if no buddy with the passed nickName exists in the buddies list.
|
pure virtual |
Returns a list of Buddy objects representing all the offline buddies in the user's buddies list.
|
pure virtual |
Returns a list of Buddy objects representing all the online buddies in the user's buddies list.
|
pure virtual |
Returns a list of Buddy objects representing all the buddies in the user's buddies list.
Returns an empty list if the Buddy List system is not initialized.
|
pure virtual |
Returns a list of strings representing the available custom buddy states.
The custom states are received by the client upon initialization of the Buddy List system. They can be configured by means of the SmartFoxServer 3 Administration Tool.
|
pure virtual |
Retrieves a Buddy Variable from its name.
| varName | The name of the Buddy Variable to be retrieved. |
nullptr if no Buddy Variable with the passed name is associated with the current user.
|
pure virtual |
Returns all the Buddy Variables associated with the current user.
|
pure virtual |
Returns the current user's online/offline state.
If true, the user appears to be online in the buddies list of other users who have him as a buddy.
The online state of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class); it is changed with a requests::buddy::GoOnlineRequest.
|
pure virtual |
Returns the current user's nickname (if set).
If the nickname was never set, the optional is empty.
As the nickname of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class), it is set with a requests::buddy::SetBuddyVariablesRequest.
|
pure virtual |
Returns the current user's custom state (if set).
Examples of custom states are "Available", "Busy", "Be right back", etc. If the custom state was never set, the optional is empty.
As the custom state of a user in a buddy list is handled by means of a reserved Buddy Variable (see ReservedBuddyVariables class), it is set with a requests::buddy::SetBuddyVariablesRequest.
|
pure virtual |
Gets the nickname of the current User, or the User's name if the nickname is not set or is empty.