FolksIndividual

FolksIndividual — A physical person, aggregated from the various FolksPersonas the person might have, such as their different IM addresses or vCard entries.

Synopsis

#define             FOLKS_TYPE_INDIVIDUAL
FolksIndividual *   folks_individual_new                (GeeSet *personas);
FolksTrustLevel     folks_individual_get_trust_level    (FolksIndividual *self);
gboolean            folks_individual_get_is_user        (FolksIndividual *self);
const gchar *       folks_individual_get_id             (FolksIndividual *self);
GeeSet *            folks_individual_get_personas       (FolksIndividual *self);
void                folks_individual_set_personas       (FolksIndividual *self,
                                                         GeeSet *value);
struct              FolksIndividual;
enum                FolksTrustLevel;

Object Hierarchy

  GObject
   +----FolksIndividual
  GEnum
   +----FolksTrustLevel

Implemented Interfaces

FolksIndividual implements FolksAliasDetails, FolksAvatarDetails, FolksBirthdayDetails, FolksEmailDetails, FolksFavouriteDetails, FolksGenderDetails, FolksGroupDetails, FolksImDetails, FolksLocalIdDetails, FolksNameDetails, FolksNoteDetails, FolksPresenceDetails, FolksPhoneDetails, FolksPostalAddressDetails, FolksRoleDetails, FolksUrlDetails and FolksWebServiceDetails.

Properties

  "alias"                    gchar*                : Read / Write
  "avatar"                   GLoadableIcon*        : Read / Write
  "birthday"                 GDateTime*            : Read / Write
  "calendar-event-id"        gchar*                : Read / Write
  "email-addresses"          GeeSet*               : Read / Write
  "full-name"                gchar*                : Read / Write
  "gender"                   FolksGender           : Read / Write
  "groups"                   GeeSet*               : Read / Write
  "id"                       gchar*                : Read
  "im-addresses"             GeeMultiMap*          : Read / Write
  "is-favourite"             gboolean              : Read / Write
  "is-user"                  gboolean              : Read
  "local-ids"                GeeSet*               : Read / Write
  "nickname"                 gchar*                : Read / Write
  "notes"                    GeeSet*               : Read / Write
  "personas"                 GeeSet*               : Read / Write
  "phone-numbers"            GeeSet*               : Read / Write
  "postal-addresses"         GeeSet*               : Read / Write
  "presence-message"         gchar*                : Read / Write
  "presence-status"          gchar*                : Read / Write
  "presence-type"            FolksPresenceType     : Read / Write
  "roles"                    GeeSet*               : Read / Write
  "structured-name"          FolksStructuredName*  : Read / Write
  "trust-level"              FolksTrustLevel       : Read
  "urls"                     GeeSet*               : Read / Write
  "web-service-addresses"    GeeMultiMap*          : Read / Write

Signals

  "personas-changed"                               : Run Last
  "removed"                                        : Run Last

Description

When choosing the values of single-valued properties (such as "alias" and "avatar"; but not multi-valued properties such as "groups" and "im-addresses") from the FolksPersonas in the individual to present as the values of those properties of the individual, it is guaranteed that if the individual contains a persona from the primary persona store (see "primary-store"), its property values will be chosen above all others. This means that any changes to property values made through folks (which are normally written to the primary store) will always be used by folks_individual_new()s.

No further guarantees are made about the order of preference used for choosing which property values to use for the folks_individual_new(), other than that the order may vary between properties, but is guaranteed to be stable for a given property.

Details

FOLKS_TYPE_INDIVIDUAL

#define FOLKS_TYPE_INDIVIDUAL (folks_individual_get_type ())

The type for FolksIndividual.


folks_individual_new ()

FolksIndividual *   folks_individual_new                (GeeSet *personas);

Create a new Individual.

The Individual can optionally be seeded with the FolksPersonas in `personas`. Otherwise, it will have to have personas added using the "personas" property after construction.

personas :

a list of FolksPersonas to initialise the folks_individual_new() with, or `null`. [in][allow-none]

Returns :

a new Individual

Since 0.5.1


folks_individual_get_trust_level ()

FolksTrustLevel     folks_individual_get_trust_level    (FolksIndividual *self);

self :

the FolksIndividual instance to query

Returns :

the value of the "trust-level" property

folks_individual_get_is_user ()

gboolean            folks_individual_get_is_user        (FolksIndividual *self);

self :

the FolksIndividual instance to query

Returns :

the value of the "is-user" property

folks_individual_get_id ()

const gchar *       folks_individual_get_id             (FolksIndividual *self);

self :

the FolksIndividual instance to query

Returns :

the value of the "id" property

folks_individual_get_personas ()

GeeSet *            folks_individual_get_personas       (FolksIndividual *self);

self :

the FolksIndividual instance to query

Returns :

the value of the "personas" property

folks_individual_set_personas ()

void                folks_individual_set_personas       (FolksIndividual *self,
                                                         GeeSet *value);

self :

the FolksIndividual instance to modify

value :

the new value of the "personas" property

struct FolksIndividual

struct FolksIndividual;

A physical person, aggregated from the various FolksPersonas the person might have, such as their different IM addresses or vCard entries.

When choosing the values of single-valued properties (such as "alias" and "avatar"; but not multi-valued properties such as "groups" and "im-addresses") from the FolksPersonas in the individual to present as the values of those properties of the individual, it is guaranteed that if the individual contains a persona from the primary persona store (see "primary-store"), its property values will be chosen above all others. This means that any changes to property values made through folks (which are normally written to the primary store) will always be used by folks_individual_new()s.

No further guarantees are made about the order of preference used for choosing which property values to use for the folks_individual_new(), other than that the order may vary between properties, but is guaranteed to be stable for a given property.


enum FolksTrustLevel

typedef enum {
	FOLKS_TRUST_LEVEL_NONE,
	FOLKS_TRUST_LEVEL_PERSONAS
} FolksTrustLevel;

Trust level for an FolksIndividual for use in the UI.

FOLKS_TRUST_LEVEL_NONE

The FolksIndividual's FolksPersonas aren't trusted at all.

This is the trust level for an FolksIndividual which contains one or more FolksPersonas which cannot be guaranteed to be the same FolksPersonas as were originally linked together.

For example, an FolksIndividual containing a link-local XMPP FolksPersona would have this trust level, since someone else could easily spoof the link-local XMPP FolksPersona's identity.

FOLKS_TRUST_LEVEL_PERSONAS

The FolksIndividual's FolksPersonas are trusted.

This trust level is for FolksIndividuals where it can be guaranteed that all the FolksPersonas are the same ones as when they were originally linked together.

Note that this doesn't guarantee that the user who behind each FolksPersona is who they claim to be.

Since 0.1.15

Property Details

The "alias" property

  "alias"                    gchar*                : Read / Write

alias.

Default value: NULL


The "avatar" property

  "avatar"                   GLoadableIcon*        : Read / Write

avatar.


The "birthday" property

  "birthday"                 GDateTime*            : Read / Write

birthday.


The "calendar-event-id" property

  "calendar-event-id"        gchar*                : Read / Write

calendar-event-id.

Default value: NULL


The "email-addresses" property

  "email-addresses"          GeeSet*               : Read / Write

email-addresses.


The "full-name" property

  "full-name"                gchar*                : Read / Write

full-name.

Default value: NULL


The "gender" property

  "gender"                   FolksGender           : Read / Write

gender.

Default value: FOLKS_GENDER_UNSPECIFIED


The "groups" property

  "groups"                   GeeSet*               : Read / Write

groups.


The "id" property

  "id"                       gchar*                : Read

A unique identifier for the Individual.

This uniquely identifies the Individual, and persists across FolksIndividualAggregator instances. It may not persist across linking the Individual with other Individuals.

This is an opaque string and has no structure.

If an identifier is required which will be used for a long-lived link between different stored data, it may be more desirable to use the "uid" of the most relevant FolksPersona in the Individual instead. For example, if storing references to Individuals who are tagged in a photo, it may be safer to store the UID of the Persona whose backend provided the photo (e.g. Facebook).

Default value: NULL


The "im-addresses" property

  "im-addresses"             GeeMultiMap*          : Read / Write

im-addresses.


The "is-favourite" property

  "is-favourite"             gboolean              : Read / Write

is-favourite.

Default value: FALSE


The "is-user" property

  "is-user"                  gboolean              : Read

Whether the Individual is the user.

Iff the Individual represents the user – the person who owns the account in the backend for each FolksPersona in the Individual – this is `true`.

It is not guaranteed that every FolksPersona in the Individual has its "is-user" set to the same value as the Individual. For example, the user could own two Telepathy accounts, and have added the other account as a contact in each account. The accounts will expose a FolksPersona for the user (which will have "is-user" set to `true`) and a FolksPersona for the contact for the other account (which will have "is-user" set to `false`).

It is guaranteed that iff this property is set to `true` on an Individual, there will be at least one FolksPersona in the Individual with its "is-user" set to `true`.

It is guaranteed that there will only ever be one Individual with this property set to `true`.

Default value: FALSE

Since 0.3.0


The "local-ids" property

  "local-ids"                GeeSet*               : Read / Write

local-ids.


The "nickname" property

  "nickname"                 gchar*                : Read / Write

nickname.

Default value: NULL


The "notes" property

  "notes"                    GeeSet*               : Read / Write

notes.


The "personas" property

  "personas"                 GeeSet*               : Read / Write

The set of FolksPersonas encapsulated by this Individual.

No order is specified over the set of personas, as such an order may be different across each of the properties implemented by the personas (e.g. should they be ordered by presence, name, star sign, etc.?).

Changing the set of personas may cause updates to the aggregated properties provided by the Individual, resulting in property notifications for them.

Changing the set of personas will not cause permanent linking/unlinking of the added/removed personas to/from this Individual. To do that, call folks_individual_aggregator_link_personas() or folks_individual_aggregator_unlink_individual(), which will ensure the link changes are written to the appropriate backend.

Since 0.5.1


The "phone-numbers" property

  "phone-numbers"            GeeSet*               : Read / Write

phone-numbers.


The "postal-addresses" property

  "postal-addresses"         GeeSet*               : Read / Write

postal-addresses.


The "presence-message" property

  "presence-message"         gchar*                : Read / Write

presence-message.

Default value: NULL


The "presence-status" property

  "presence-status"          gchar*                : Read / Write

presence-status.

Default value: NULL


The "presence-type" property

  "presence-type"            FolksPresenceType     : Read / Write

presence-type.

Default value: FOLKS_PRESENCE_TYPE_UNSET


The "roles" property

  "roles"                    GeeSet*               : Read / Write

roles.


The "structured-name" property

  "structured-name"          FolksStructuredName*  : Read / Write

structured-name.


The "trust-level" property

  "trust-level"              FolksTrustLevel       : Read

The trust level of the Individual.

This specifies how far the Individual can be trusted to be who it claims to be. See the descriptions for the elements of FolksTrustLevel.

Clients should not allow linking of Individuals who have a trust level of TrustLevel.NONE.

Default value: FOLKS_TRUST_LEVEL_NONE

Since 0.1.15


The "urls" property

  "urls"                     GeeSet*               : Read / Write

urls.


The "web-service-addresses" property

  "web-service-addresses"    GeeMultiMap*          : Read / Write

web-service-addresses.

Signal Details

The "personas-changed" signal

void                user_function                      (FolksIndividual *individual,
                                                        GeeSet          *added,
                                                        GeeSet          *removed,
                                                        gpointer         user_data)       : Run Last

Emitted when one or more FolksPersonas are added to or removed from the Individual. As the parameters are (unordered) sets, the orders of their elements are undefined.

individual :

the FolksIndividual instance that received the signal

added :

a set of FolksPersonas which have been added

removed :

a set of FolksPersonas which have been removed

user_data :

user data set when the signal handler was connected.

Since 0.5.1


The "removed" signal

void                user_function                      (FolksIndividual *individual,
                                                        FolksIndividual *replacement_individual,
                                                        gpointer         user_data)                   : Run Last

Emitted when the last of the Individual's FolksPersonas has been removed.

At this point, the Individual is invalid, so any client referencing it should unreference it and remove it from their UI.

individual :

the FolksIndividual instance that received the signal

replacement_individual :

the individual which has replaced this one due to linking, or `null` if this individual was removed for another reason

user_data :

user data set when the signal handler was connected.

Since 0.1.13