GalagoAccount

GalagoAccount — An account on a messaging service.

Functions

Properties

GalagoImage * avatar Read / Write
gboolean connected Read / Write
gchar * display-name Read / Write
GalagoPerson * person Read / Write / Construct Only
GalagoPresence * presence Read
GalagoService * service Read / Write / Construct Only
gchar * username Read / Write / Construct Only

Signals

void avatar-set Action
void connection-state-changed Action
void contact-added Action
void contact-removed Action
void display-name-changed Action
void presence-created Action
void presence-deleted Action

Types and Values

Object Hierarchy

    GObject
    ╰── GalagoObject
        ╰── GalagoAccount

Description

The GalagoAccount object represents an account on a messaging or VoIP service, The account may belong to the local user, or someone on the user's contact list.

Each GalagoAccount is owned and managed by a GalagoService, and has an associated GalagoPerson. To create a GalagoAccount, use galago_service_create_account().

Functions

galago_account_set_connected ()

void
galago_account_set_connected (GalagoAccount *account,
                              gboolean connected);

Sets whether or not the account is connected.

Parameters

account

The account.

 

connected

The connected state.

 

galago_account_get_service ()

GalagoService *
galago_account_get_service (const GalagoAccount *account);

Returns an account's service.

Parameters

account

The account.

 

Returns

The account's service.


galago_account_get_person ()

GalagoPerson *
galago_account_get_person (const GalagoAccount *account);

Returns the person that owns an account.

Parameters

account

The account.

 

Returns

The person that owns the account.


galago_account_get_username ()

const char *
galago_account_get_username (const GalagoAccount *account);

Returns an account's username.

Parameters

account

The account.

 

Returns

The account's username.


galago_account_is_connected ()

gboolean
galago_account_is_connected (const GalagoAccount *account);

Returns whether or not an account is connected.

Parameters

account

The account.

 

Returns

The account's connected state.


galago_account_set_display_name ()

void
galago_account_set_display_name (GalagoAccount *account,
                                 const char *display_name);

Sets the account's displayed name.

This is the alias that the account may be shown as on another client. It's purely optional.

Parameters

account

The account.

 

display_name

The display name.

 

galago_account_get_display_name ()

const char *
galago_account_get_display_name (const GalagoAccount *account);

Returns the account's displayed name. If the displayed name is not explicitly set, this will return the screen name.

Parameters

account

The account.

 

Returns

The displayed name.


galago_account_is_display_name_set ()

gboolean
galago_account_is_display_name_set (const GalagoAccount *account);

Returns whether or not a custom displayed name is set.

Parameters

account

The account.

 

Returns

TRUE if a custom displayed name is set, or FALSE.


galago_account_add_contact ()

void
galago_account_add_contact (GalagoAccount *account,
                            GalagoAccount *contact);

Adds a contact to an account.

Parameters

account

The account.

 

contact

The contact's account to add.

 

galago_account_remove_contact ()

void
galago_account_remove_contact (GalagoAccount *account,
                               GalagoAccount *contact);

Removes a contact from an account.

Parameters

account

The account.

 

contact

The contact's account to remove.

 

galago_account_get_contact ()

GalagoAccount *
galago_account_get_contact (const GalagoAccount *account,
                            const char *username,
                            gboolean query);

Returns the contact with the specified username in an account.

Parameters

account

The account.

 

username

The username.

 

query

TRUE if a remote query should be done if there is no local contact found, or FALSE.

 

Returns

The contact's account, if found, or NULL.


galago_account_get_contacts ()

GList *
galago_account_get_contacts (const GalagoAccount *account,
                             gboolean query);

Returns a list of accounts of users seen from this account.

This may emit a contact-added signal for every object that returns. If your code connects to this signal and calls galago_account_get_contacts() as a result, you will want to add a lock so that you don't end up with unwanted side-effects.

Parameters

account

The account.

 

query

TRUE if a remote query should be done if there is no local contact found, or FALSE.

 

Returns

A list of accounts of other users, or NULL.


galago_account_create_presence ()

GalagoPresence *
galago_account_create_presence (GalagoAccount *account);

Creates an account's presence.

The account should be a local account. If the account already has a presence, this will return the existing one.

Parameters

account

The account.

 

Returns

The presence.


galago_account_get_presence ()

GalagoPresence *
galago_account_get_presence (const GalagoAccount *account,
                             gboolean query);

Returns the account's presence.

Parameters

account

The account.

 

query

TRUE if a remote query should be done if there is no local presence found, or FALSE.

 

Returns

The presence, if found, or NULL.


galago_account_set_avatar ()

void
galago_account_set_avatar (GalagoAccount *account,
                           GalagoImage *avatar);

Sets the account's avatar. The account should be a local account.

Parameters

account

The account.

 

avatar

The avatar to set.

 

galago_account_get_avatar ()

GalagoImage *
galago_account_get_avatar (const GalagoAccount *account,
                           gboolean query);

Returns the account's avatar.

Parameters

account

The account.

 

query

TRUE if a remote query should be done if there is no local avatar found, or FALSE.

 

Returns

The avatar, if found, or NULL.

Types and Values

struct GalagoAccount

struct GalagoAccount;

This is an opaque structure representing an account. This should not be used directly. Use the accessor functions below.


GALAGO_DBUS_ACCOUNT_INTERFACE

#define GALAGO_DBUS_ACCOUNT_INTERFACE "org.freedesktop.Galago.Account"

The D-BUS interface that GalagoAccount maps to.

Property Details

The “avatar” property

  “avatar”                   GalagoImage *

The account's avatar.

Flags: Read / Write


The “connected” property

  “connected”                gboolean

The account's connected state.

Flags: Read / Write

Default value: FALSE


The “display-name” property

  “display-name”             gchar *

The account's username intended for display.

Flags: Read / Write

Default value: NULL


The “person” property

  “person”                   GalagoPerson *

The person the account belongs to.

Flags: Read / Write / Construct Only


The “presence” property

  “presence”                 GalagoPresence *

The account's presence.

Flags: Read


The “service” property

  “service”                  GalagoService *

The service the account is on.

Flags: Read / Write / Construct Only


The “username” property

  “username”                 gchar *

The account's username.

Flags: Read / Write / Construct Only

Default value: NULL

Signal Details

The “avatar-set” signal

void
user_function (GalagoAccount *account,
               gpointer       avatar,
               gpointer       user_data)

Emitted whenever an avatar is set for this account.

Parameters

account

The object which received the signal.

 

avatar

The avatar set.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “connection-state-changed” signal

void
user_function (GalagoAccount *account,
               gpointer       user_data)

Emitted when the state of the connection changes, when the account goes online or offline.

Parameters

account

The object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “contact-added” signal

void
user_function (GalagoAccount *account,
               gpointer       contact,
               gpointer       user_data)

Emitted whenever a contact has been added to this account.

Parameters

account

The object which received the signal.

 

contact

The contact added to this account.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “contact-removed” signal

void
user_function (GalagoAccount *account,
               gpointer       contact,
               gpointer       user_data)

Emitted whenever a contact has been removed from this account.

Parameters

account

The object which received the signal.

 

contact

The contact removed from this account.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “display-name-changed” signal

void
user_function (GalagoAccount *account,
               gpointer       user_data)

Emitted whenever the display name of the account changes.

Parameters

account

The object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “presence-created” signal

void
user_function (GalagoAccount *account,
               gpointer       presence,
               gpointer       user_data)

Emitted whenever a new GalagoPresence object is created for this account.

Parameters

account

The object which received the signal.

 

presence

The new presence object.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action


The “presence-deleted” signal

void
user_function (GalagoAccount *account,
               gpointer       user_data)

Emitted whenever a GalagoPresence object associated with this account is destroyed.

Parameters

account

The object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: Action