FolksPersonaStore

FolksPersonaStore — A store for FolksPersonas.

Functions

Properties

Signals

void personas-changed Run Last
void removed Run Last

Types and Values

Object Hierarchy

    GEnum
    ├── FolksPersonaDetail
    ╰── FolksPersonaStoreTrust
    GObject
    ╰── FolksPersonaStore

Description

After creating a PersonaStore instance, you must connect to the "personas-changed" signal, then call folks_persona_store_prepare(), otherwise a race condition may occur between emission of "personas-changed" and your code connecting to it.

Functions

FOLKS_TYPE_PERSONA_STORE

#define FOLKS_TYPE_PERSONA_STORE (folks_persona_store_get_type ())

The type for FolksPersonaStore.


folks_persona_store_prepare ()

void
folks_persona_store_prepare (FolksPersonaStore *self,
                             GAsyncReadyCallback _callback_,
                             gpointer _user_data_);

Prepare the PersonaStore for use.

This connects the PersonaStore to whichever backend-specific services it requires to be able to provide FolksPersonas. This should be called after connecting to the "personas-changed" signal, or a race condition could occur, with the signal being emitted before your code has connected to it, and FolksPersonas getting "lost" as a result.

This is normally handled transparently by the FolksIndividualAggregator.

If this function throws an error, the PersonaStore will not be functional.

This function is guaranteed to be idempotent (since version 0.3.0).

Concurrent calls to this function from different threads will block until preparation has completed. However, concurrent calls to this function from a single thread might not, i.e. the first call will block but subsequent calls might return before the first one. (Though they will be safe in every other respect.)

GError will be returned in error

if preparing the backend-specific services failed — this will be a backend-specific error

See also: folks_persona_store_prepare_finish()

Parameters

self

the FolksPersonaStore instance

 

_callback_

callback to call when the request is satisfied.

[scope async]

_user_data_

the data to pass to _callback_ function.

[closure]

Since 0.1.11


folks_persona_store_prepare_finish ()

void
folks_persona_store_prepare_finish (FolksPersonaStore *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Prepare the PersonaStore for use.

This connects the PersonaStore to whichever backend-specific services it requires to be able to provide FolksPersonas. This should be called after connecting to the "personas-changed" signal, or a race condition could occur, with the signal being emitted before your code has connected to it, and FolksPersonas getting "lost" as a result.

This is normally handled transparently by the FolksIndividualAggregator.

If this function throws an error, the PersonaStore will not be functional.

This function is guaranteed to be idempotent (since version 0.3.0).

Concurrent calls to this function from different threads will block until preparation has completed. However, concurrent calls to this function from a single thread might not, i.e. the first call will block but subsequent calls might return before the first one. (Though they will be safe in every other respect.)

GError will be returned in error

if preparing the backend-specific services failed — this will be a backend-specific error

See also: folks_persona_store_prepare()

Parameters

self

the FolksPersonaStore instance

 

_res_

a GAsyncResult

 

error

location to store the error occuring, or NULL to ignore

 

Since 0.1.11


folks_persona_store_flush ()

void
folks_persona_store_flush (FolksPersonaStore *self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);

Flush any pending changes to the PersonaStore's backing store.

PersonaStores may (transparently) implement caching or I/O queueing which means that changes to their FolksPersonas may not be immediately written to the PersonaStore's backing store. Calling this function will force all pending changes to be flushed to the backing store.

This must not be called before folks_persona_store_prepare().

See also: folks_persona_store_flush_finish()

Parameters

self

the FolksPersonaStore instance

 

_callback_

callback to call when the request is satisfied.

[scope async]

_user_data_

the data to pass to _callback_ function.

[closure]

Since 0.1.17


folks_persona_store_flush_finish ()

void
folks_persona_store_flush_finish (FolksPersonaStore *self,
                                  GAsyncResult *_res_);

Flush any pending changes to the PersonaStore's backing store.

PersonaStores may (transparently) implement caching or I/O queueing which means that changes to their FolksPersonas may not be immediately written to the PersonaStore's backing store. Calling this function will force all pending changes to be flushed to the backing store.

This must not be called before folks_persona_store_prepare().

See also: folks_persona_store_flush()

Parameters

self

the FolksPersonaStore instance

 

_res_

a GAsyncResult

 

Since 0.1.17


folks_persona_store_add_persona_from_details ()

void
folks_persona_store_add_persona_from_details
                               (FolksPersonaStore *self,
                                GHashTable *details,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);

Add a new FolksPersona to the PersonaStore.

The FolksPersona will be created by the PersonaStore backend from the key-value pairs given in details.

All additions through this function will later be emitted through the personas-changed signal to be notified of the new FolksPersona. The return value is purely for convenience, since it can be complicated to correlate the provided details with the final Persona.

If the store is offline (or folks_persona_store_prepare() hasn't yet been called successfully), this function will throw FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE. It's the responsibility of the caller to cache details and re-try this function if it wishes to make offline adds work.

If the details are not recognised or are invalid, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT will be thrown. A default set of possible details are defined by FolksPersonaDetail but backends can either support a subset or superset of the suggested defaults.

If a FolksPersona with the given details already exists in the store, no error will be thrown and this function will return null.

FolksPersonaStoreError will be returned in error

if adding the persona failed

See also: folks_persona_store_add_persona_from_details_finish()

Parameters

self

the FolksPersonaStore instance

 

details

 .

a key-value map of details to use in creating the new FolksPersona

.

[in]

_callback_

callback to call when the request is satisfied.

[scope async]

_user_data_

the data to pass to _callback_ function.

[closure]

folks_persona_store_add_persona_from_details_finish ()

FolksPersona *
folks_persona_store_add_persona_from_details_finish
                               (FolksPersonaStore *self,
                                GAsyncResult *_res_,
                                GError **error);

Add a new FolksPersona to the PersonaStore.

The FolksPersona will be created by the PersonaStore backend from the key-value pairs given in details.

All additions through this function will later be emitted through the personas-changed signal to be notified of the new FolksPersona. The return value is purely for convenience, since it can be complicated to correlate the provided details with the final Persona.

If the store is offline (or folks_persona_store_prepare() hasn't yet been called successfully), this function will throw FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE. It's the responsibility of the caller to cache details and re-try this function if it wishes to make offline adds work.

If the details are not recognised or are invalid, FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT will be thrown. A default set of possible details are defined by FolksPersonaDetail but backends can either support a subset or superset of the suggested defaults.

If a FolksPersona with the given details already exists in the store, no error will be thrown and this function will return null.

FolksPersonaStoreError will be returned in error

if adding the persona failed

See also: folks_persona_store_add_persona_from_details()

Parameters

self

the FolksPersonaStore instance

 

_res_

a GAsyncResult

 

error

location to store the error occuring, or NULL to ignore.

[error-domains FolksPersonaStoreError]

Returns

the new FolksPersona or null if the corresponding Persona already existed. If non-null, the new FolksPersona will also be amongst the FolksPersona(s) in a future emission of "personas-changed".


folks_persona_store_remove_persona ()

void
folks_persona_store_remove_persona (FolksPersonaStore *self,
                                    FolksPersona *persona,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);

Remove a FolksPersona from the PersonaStore.

It isn't guaranteed that the Persona will actually be removed by the time this asynchronous function finishes. The successful removal of the Persona will be signalled through emission of "personas-changed".

If the store is offline (or folks_persona_store_prepare() hasn't yet been called successfully), this function will throw FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE. It's the responsibility of the caller to cache details and re-try this function if it wishes to make offline removals work.

FolksPersonaStoreError will be returned in error

if removing the persona failed

See also: folks_persona_store_remove_persona_finish()

Parameters

self

the FolksPersonaStore instance

 

persona

 .

the FolksPersona to remove

.

[in]

_callback_

callback to call when the request is satisfied.

[scope async]

_user_data_

the data to pass to _callback_ function.

[closure]

Since 0.1.11


folks_persona_store_remove_persona_finish ()

void
folks_persona_store_remove_persona_finish
                               (FolksPersonaStore *self,
                                GAsyncResult *_res_,
                                GError **error);

Remove a FolksPersona from the PersonaStore.

It isn't guaranteed that the Persona will actually be removed by the time this asynchronous function finishes. The successful removal of the Persona will be signalled through emission of "personas-changed".

If the store is offline (or folks_persona_store_prepare() hasn't yet been called successfully), this function will throw FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE. It's the responsibility of the caller to cache details and re-try this function if it wishes to make offline removals work.

FolksPersonaStoreError will be returned in error

if removing the persona failed

See also: folks_persona_store_remove_persona()

Parameters

self

the FolksPersonaStore instance

 

_res_

a GAsyncResult

 

error

location to store the error occuring, or NULL to ignore.

[error-domains FolksPersonaStoreError]

Since 0.1.11


folks_persona_store_get_type_id ()

const gchar *
folks_persona_store_get_type_id (FolksPersonaStore *self);

Get and return the current value of the "type-id" property.

The type of PersonaStore this is.

This is the same for all PersonaStores provided by a given FolksBackend.

This is guaranteed to always be available; even before folks_persona_store_prepare() is called. It is immutable over the life of the FolksPersonaStore.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "type-id" property


folks_persona_store_get_display_name ()

const gchar *
folks_persona_store_get_display_name (FolksPersonaStore *self);

Get and return the current value of the "display-name" property.

The human-readable, service-specific name used to represent the PersonaStore to the user.

For example: foo@xmpp.example.org.

This should be used whenever the user needs to be presented with a familiar, service-specific name. For instance, in a prompt for the user to select a specific IM account from which to initiate a chat.

This is not guaranteed to be unique even within this PersonaStore's FolksBackend. Its value may change throughout the life of the store.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "display-name" property

Since 0.1.13


folks_persona_store_get_id ()

const gchar *
folks_persona_store_get_id (FolksPersonaStore *self);

Get and return the current value of the "id" property.

The instance identifier for this PersonaStore.

Since each FolksBackend can provide multiple different PersonaStores for different accounts or servers (for example), they each need an ID which is unique within the backend.

It is immutable over the life of the FolksPersonaStore.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "id" property


folks_persona_store_get_personas ()

GeeMap *
folks_persona_store_get_personas (FolksPersonaStore *self);

Get and return the current value of the "personas" property.

The FolksPersonas exposed by this PersonaStore.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "personas" property

Since 0.5.1


folks_persona_store_get_can_add_personas ()

FolksMaybeBool
folks_persona_store_get_can_add_personas
                               (FolksPersonaStore *self);

Get and return the current value of the "can-add-personas" property.

Whether this FolksPersonaStore can add FolksPersonas.

This value may change throughout the life of the FolksPersonaStore.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "can-add-personas" property

Since 0.3.1


folks_persona_store_get_can_alias_personas ()

FolksMaybeBool
folks_persona_store_get_can_alias_personas
                               (FolksPersonaStore *self);

folks_persona_store_get_can_alias_personas has been deprecated since version 0.6.3.1 and should not be used in newly-written code.

Replaced by “always-writeable-properties”.

Get and return the current value of the "can-alias-personas" property.

Whether this FolksPersonaStore can set the alias of FolksPersonas.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "can-alias-personas" property

Since 0.3.1


folks_persona_store_get_can_group_personas ()

FolksMaybeBool
folks_persona_store_get_can_group_personas
                               (FolksPersonaStore *self);

folks_persona_store_get_can_group_personas has been deprecated since version 0.6.3.1 and should not be used in newly-written code.

Replaced by “always-writeable-properties”.

Get and return the current value of the "can-group-personas" property.

Whether this FolksPersonaStore can set the groups of FolksPersonas.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "can-group-personas" property

Since 0.3.1


folks_persona_store_get_can_remove_personas ()

FolksMaybeBool
folks_persona_store_get_can_remove_personas
                               (FolksPersonaStore *self);

Get and return the current value of the "can-remove-personas" property.

Whether this FolksPersonaStore can remove FolksPersonas.

This value may change throughout the life of the FolksPersonaStore.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "can-remove-personas" property

Since 0.3.1


folks_persona_store_get_is_prepared ()

gboolean
folks_persona_store_get_is_prepared (FolksPersonaStore *self);

Get and return the current value of the "is-prepared" property.

Whether folks_persona_store_prepare() has successfully completed for this store.

It’s guaranteed that this will only ever change from false to true in the lifetime of the FolksPersonaStore.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "is-prepared" property

Since 0.3.0


folks_persona_store_get_is_quiescent ()

gboolean
folks_persona_store_get_is_quiescent (FolksPersonaStore *self);

Get and return the current value of the "is-quiescent" property.

Whether the store has reached a quiescent state. This will happen at some point after folks_persona_store_prepare() has successfully completed for the store. A store is in a quiescent state when all the FolksPersonas that it originally knows about have been loaded.

It's guaranteed that this property's value will only ever change after "is-prepared" has changed to true.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "is-quiescent" property

Since 0.6.2


folks_persona_store_get_is_writeable ()

gboolean
folks_persona_store_get_is_writeable (FolksPersonaStore *self);

folks_persona_store_get_is_writeable has been deprecated since version 0.6.3 and should not be used in newly-written code.

Replaced by “is-primary-store”.

Get and return the current value of the "is-writeable" property.

Whether the PersonaStore is writeable.

Only if a PersonaStore is writeable will its FolksPersonas be updated by changes to the FolksIndividuals containing them, and those changes then be written out to the relevant backing store.

If this property is false, it doesn't mean that FolksPersonas in this persona store aren't writeable at all. If their properties are updated through the FolksPersona, rather than through the FolksIndividual containing that persona, changes may be propagated to the backing store.

PersonaStores must not set this property themselves; it will be set as appropriate by the FolksIndividualAggregator.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "is-writeable" property

Since 0.1.13


folks_persona_store_set_is_writeable ()

void
folks_persona_store_set_is_writeable (FolksPersonaStore *self,
                                      gboolean value);

folks_persona_store_set_is_writeable has been deprecated since version 0.6.3 and should not be used in newly-written code.

Replaced by “is-primary-store”.

Set the value of the "is-writeable" property to value .

Whether the PersonaStore is writeable.

Only if a PersonaStore is writeable will its FolksPersonas be updated by changes to the FolksIndividuals containing them, and those changes then be written out to the relevant backing store.

If this property is false, it doesn't mean that FolksPersonas in this persona store aren't writeable at all. If their properties are updated through the FolksPersona, rather than through the FolksIndividual containing that persona, changes may be propagated to the backing store.

PersonaStores must not set this property themselves; it will be set as appropriate by the FolksIndividualAggregator.

Parameters

self

the FolksPersonaStore instance to modify

 

value

the new value of the "is-writeable" property

 

Since 0.1.13


folks_persona_store_get_trust_level ()

FolksPersonaStoreTrust
folks_persona_store_get_trust_level (FolksPersonaStore *self);

Get and return the current value of the "trust-level" property.

The trust level of the PersonaStore for linking.

Each FolksPersonaStore is assigned a trust level by the IndividualAggregator, designating whether to trust the properties of its FolksPersonas for linking to produce FolksIndividuals.

This value may change throughout the life of the FolksPersonaStore.

The trust level may be queried by clients, but must not be set by them. The setter for this property is for libfolks internal use only.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "trust-level" property

Since 0.1.13


folks_persona_store_set_trust_level ()

void
folks_persona_store_set_trust_level (FolksPersonaStore *self,
                                     FolksPersonaStoreTrust value);

Set the value of the "trust-level" property to value .

The trust level of the PersonaStore for linking.

Each FolksPersonaStore is assigned a trust level by the IndividualAggregator, designating whether to trust the properties of its FolksPersonas for linking to produce FolksIndividuals.

This value may change throughout the life of the FolksPersonaStore.

The trust level may be queried by clients, but must not be set by them. The setter for this property is for libfolks internal use only.

Parameters

self

the FolksPersonaStore instance to modify

 

value

the new value of the "trust-level" property

 

Since 0.1.13


folks_persona_store_get_always_writeable_properties ()

gchar **
folks_persona_store_get_always_writeable_properties
                               (FolksPersonaStore *self,
                                int *result_length1);

Get and return the current value of the "always-writeable-properties" property.

The names of the properties of the FolksPersonas in this store which are always writeable.

If a property name is in this list, setting the property on a persona should result in the updated value being stored in the backend's permanent storage (unless it gets rejected due to being invalid, or a different error occurs).

This property value is guaranteed to be constant for a given persona store, but may vary between persona stores in the same backend. It's guaranteed that this will always be a subset of the value of "writeable-properties" for the personas in this persona store.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "always-writeable-properties" property

Since 0.6.2


folks_persona_store_get_is_primary_store ()

gboolean
folks_persona_store_get_is_primary_store
                               (FolksPersonaStore *self);

Get and return the current value of the "is-primary-store" property.

Whether this FolksPersonaStore is the primary store to be used for linking FolksPersonas.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "is-primary-store" property

Since 0.6.3


folks_persona_store_get_is_user_set_default ()

gboolean
folks_persona_store_get_is_user_set_default
                               (FolksPersonaStore *self);

Get and return the current value of the "is-user-set-default" property.

Whether this FolksPersonaStore is marked as the default in its backend by the user.

i.e. A FolksPersonaStore for the EDS backend would set this to true if it represents the user’s default address book.

Parameters

self

the FolksPersonaStore instance to query

 

Returns

the value of the "is-user-set-default" property

Since 0.6.3


folks_persona_store_detail_key ()

const gchar *
folks_persona_store_detail_key (FolksPersonaDetail detail);

Returns the key corresponding to detail , for use in the details param of folks_persona_store_add_persona_from_details().

Parameters

detail

 .

the FolksPersonaDetail to lookup

.

[in]

Returns

the corresponding property name, or null if detail is invalid

.

[transfer none]

Since 0.5.0

Types and Values

struct FolksPersonaStore

struct FolksPersonaStore;

A store for FolksPersonas.

After creating a PersonaStore instance, you must connect to the "personas-changed" signal, then call folks_persona_store_prepare(), otherwise a race condition may occur between emission of "personas-changed" and your code connecting to it.


struct FolksPersonaStoreClass

struct FolksPersonaStoreClass {
	GObjectClass parent_class;
	void (*prepare) (FolksPersonaStore* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*prepare_finish) (FolksPersonaStore* self, GAsyncResult* _res_, GError** error);
	void (*flush) (FolksPersonaStore* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*flush_finish) (FolksPersonaStore* self, GAsyncResult* _res_);
	void (*add_persona_from_details) (FolksPersonaStore* self, GHashTable* details, GAsyncReadyCallback _callback_, gpointer _user_data_);
	FolksPersona* (*add_persona_from_details_finish) (FolksPersonaStore* self, GAsyncResult* _res_, GError** error);
	void (*remove_persona) (FolksPersonaStore* self, FolksPersona* persona, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*remove_persona_finish) (FolksPersonaStore* self, GAsyncResult* _res_, GError** error);
	const gchar* (*get_type_id) (FolksPersonaStore* self);
	GeeMap* (*get_personas) (FolksPersonaStore* self);
	FolksMaybeBool (*get_can_add_personas) (FolksPersonaStore* self);
	FolksMaybeBool (*get_can_alias_personas) (FolksPersonaStore* self);
	FolksMaybeBool (*get_can_group_personas) (FolksPersonaStore* self);
	FolksMaybeBool (*get_can_remove_personas) (FolksPersonaStore* self);
	gboolean (*get_is_prepared) (FolksPersonaStore* self);
	gboolean (*get_is_quiescent) (FolksPersonaStore* self);
	gchar** (*get_always_writeable_properties) (FolksPersonaStore* self, int* result_length1);
};

The class structure for FOLKS_TYPE_PERSONA_STORE. All the fields in this structure are private and should never be accessed directly.

Members

GObjectClass parent_class;

the parent class structure

 

prepare ()

virtual method called by folks_persona_store_prepare()

 

prepare_finish ()

asynchronous finish function for prepare, called by folks_persona_store_prepare()

 

flush ()

virtual method called by folks_persona_store_flush()

 

flush_finish ()

asynchronous finish function for flush, called by folks_persona_store_flush()

 

add_persona_from_details ()

virtual method called by folks_persona_store_add_persona_from_details()

 

add_persona_from_details_finish ()

asynchronous finish function for add_persona_from_details, called by folks_persona_store_add_persona_from_details()

 

remove_persona ()

virtual method called by folks_persona_store_remove_persona()

 

remove_persona_finish ()

asynchronous finish function for remove_persona, called by folks_persona_store_remove_persona()

 

get_type_id ()

getter method for the abstract property "type-id"

 

get_personas ()

getter method for the abstract property "personas"

 

get_can_add_personas ()

getter method for the abstract property "can-add-personas"

 

get_can_alias_personas ()

getter method for the abstract property "can-alias-personas"

 

get_can_group_personas ()

getter method for the abstract property "can-group-personas"

 

get_can_remove_personas ()

getter method for the abstract property "can-remove-personas"

 

get_is_prepared ()

getter method for the abstract property "is-prepared"

 

get_is_quiescent ()

getter method for the abstract property "is-quiescent"

 

get_always_writeable_properties ()

getter method for the abstract property "always-writeable-properties"

 

enum FolksPersonaStoreTrust

Trust level for a FolksPersonaStore's FolksPersonas for linking purposes.

Trust levels are set internally by the backends, and must not be modified by clients.

Members

FOLKS_PERSONA_STORE_TRUST_NONE

The FolksPersonas aren't trusted at all, and cannot be linked.

This should be used for FolksPersonaStores where even the FolksPersona UID could be maliciously edited to corrupt FolksPersona links, or where the UID changes regularly.

 

FOLKS_PERSONA_STORE_TRUST_PARTIAL

Only the "uid" property is trusted for linking.

In practice, this means that FolksPersonas from this FolksPersonaStore will not contribute towards the linking process, but can be linked together by their UIDs using data from FolksPersonas from a fully-trusted FolksPersonaStore.

 

FOLKS_PERSONA_STORE_TRUST_FULL

Every property in "linkable-properties" is trusted.

This should only be used for user-controlled FolksPersonaStores, as if a remote store is compromised, malicious changes could be made to its data which corrupt the user's FolksPersona links.

 

Since 0.1.13


enum FolksPersonaDetail

Definition of the available fields to be looked up with folks_persona_store_detail_key().

Members

FOLKS_PERSONA_DETAIL_INVALID

Invalid field for use in error returns.

 

FOLKS_PERSONA_DETAIL_ALIAS

Field for "alias".

 

FOLKS_PERSONA_DETAIL_AVATAR

Field for "avatar".

 

FOLKS_PERSONA_DETAIL_BIRTHDAY

Field for "birthday".

 

FOLKS_PERSONA_DETAIL_EMAIL_ADDRESSES

Field for "email-addresses".

 

FOLKS_PERSONA_DETAIL_FULL_NAME

Field for "full-name".

 

FOLKS_PERSONA_DETAIL_GENDER

Field for "gender".

 

FOLKS_PERSONA_DETAIL_IM_ADDRESSES

Field for "im-addresses".

 

FOLKS_PERSONA_DETAIL_IS_FAVOURITE

Field for "is-favourite".

 

FOLKS_PERSONA_DETAIL_LOCAL_IDS

Field for "local-ids".

 

FOLKS_PERSONA_DETAIL_LOCATION

Field for "location".

 

FOLKS_PERSONA_DETAIL_NICKNAME

Field for "nickname".

 

FOLKS_PERSONA_DETAIL_NOTES

Field for "notes".

 

FOLKS_PERSONA_DETAIL_PHONE_NUMBERS

Field for "phone-numbers".

 

FOLKS_PERSONA_DETAIL_POSTAL_ADDRESSES

Field for "postal-addresses".

 

FOLKS_PERSONA_DETAIL_ROLES

Field for "roles".

 

FOLKS_PERSONA_DETAIL_STRUCTURED_NAME

Field for "structured-name".

 

FOLKS_PERSONA_DETAIL_URLS

Field for "urls".

 

FOLKS_PERSONA_DETAIL_WEB_SERVICE_ADDRESSES

Field for "web-service-addresses".

 

FOLKS_PERSONA_DETAIL_GROUPS

Field for "groups".

 

FOLKS_PERSONA_DETAIL_IM_INTERACTION_COUNT

Field for "im-interaction-count".

 

FOLKS_PERSONA_DETAIL_LAST_IM_INTERACTION_DATETIME

Field for "last-im-interaction-datetime".

 

FOLKS_PERSONA_DETAIL_CALL_INTERACTION_COUNT

Field for "call-interaction-count".

 

FOLKS_PERSONA_DETAIL_LAST_CALL_INTERACTION_DATETIME

Field for "last-call-interaction-datetime".

 

FOLKS_PERSONA_DETAIL_ANTI_LINKS

Field for "anti-links".

 

Since 0.5.0


enum FolksPersonaStoreError

Errors from FolksPersonaStores.

Members

FOLKS_PERSONA_STORE_ERROR_INVALID_ARGUMENT

An argument to the method was invalid.

 

FOLKS_PERSONA_STORE_ERROR_CREATE_FAILED

Creation of a FolksPersona failed.

 

FOLKS_PERSONA_STORE_ERROR_UNSUPPORTED_ON_USER

Such an operation may not be performed on a FolksPersona with "is-user" set to true.

 

FOLKS_PERSONA_STORE_ERROR_STORE_OFFLINE

The FolksPersonaStore was offline (ie, this is a temporary failure).

 

FOLKS_PERSONA_STORE_ERROR_READ_ONLY

The FolksPersonaStore doesn't support write operations.

 

FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED

The operation was denied due to not having sufficient permissions.

 

FOLKS_PERSONA_STORE_ERROR_REMOVE_FAILED

Removal of a FolksPersona failed. This is a generic error which is used if no other error code (such as, e.g., FOLKS_PERSONA_STORE_ERROR_PERMISSION_DENIED) is applicable.

 

FOLKS_PERSONA_STORE_ERROR_UNSUPPORTED_ON_NON_USER

Such an operation may only be performed on a FolksPersona with "is-user" set to true.

 

Property Details

The “always-writeable-properties” property

  “always-writeable-properties” GStrv

The names of the properties of the FolksPersonas in this store which are always writeable.

If a property name is in this list, setting the property on a persona should result in the updated value being stored in the backend's permanent storage (unless it gets rejected due to being invalid, or a different error occurs).

This property value is guaranteed to be constant for a given persona store, but may vary between persona stores in the same backend. It's guaranteed that this will always be a subset of the value of "writeable-properties" for the personas in this persona store.

Flags: Read

Since 0.6.2


The “can-add-personas” property

  “can-add-personas”         FolksMaybeBool

Whether this FolksPersonaStore can add FolksPersonas.

This value may change throughout the life of the FolksPersonaStore.

Flags: Read

Default value: FOLKS_MAYBE_BOOL_UNSET

Since 0.3.1


The “can-alias-personas” property

  “can-alias-personas”       FolksMaybeBool

Whether this FolksPersonaStore can set the alias of FolksPersonas.

FolksPersonaStore:can-alias-personas has been deprecated since version 0.6.3.1 and should not be used in newly-written code.

Replaced by “always-writeable-properties”.

Flags: Read

Default value: FOLKS_MAYBE_BOOL_UNSET

Since 0.3.1


The “can-group-personas” property

  “can-group-personas”       FolksMaybeBool

Whether this FolksPersonaStore can set the groups of FolksPersonas.

FolksPersonaStore:can-group-personas has been deprecated since version 0.6.3.1 and should not be used in newly-written code.

Replaced by “always-writeable-properties”.

Flags: Read

Default value: FOLKS_MAYBE_BOOL_UNSET

Since 0.3.1


The “can-remove-personas” property

  “can-remove-personas”      FolksMaybeBool

Whether this FolksPersonaStore can remove FolksPersonas.

This value may change throughout the life of the FolksPersonaStore.

Flags: Read

Default value: FOLKS_MAYBE_BOOL_UNSET

Since 0.3.1


The “display-name” property

  “display-name”             gchar *

The human-readable, service-specific name used to represent the PersonaStore to the user.

For example: foo@xmpp.example.org.

This should be used whenever the user needs to be presented with a familiar, service-specific name. For instance, in a prompt for the user to select a specific IM account from which to initiate a chat.

This is not guaranteed to be unique even within this PersonaStore's FolksBackend. Its value may change throughout the life of the store.

Flags: Read / Write / Construct Only

Default value: NULL

Since 0.1.13


The “id” property

  “id”                       gchar *

The instance identifier for this PersonaStore.

Since each FolksBackend can provide multiple different PersonaStores for different accounts or servers (for example), they each need an ID which is unique within the backend.

It is immutable over the life of the FolksPersonaStore.

Flags: Read / Write / Construct Only

Default value: NULL


The “is-prepared” property

  “is-prepared”              gboolean

Whether folks_persona_store_prepare() has successfully completed for this store.

It’s guaranteed that this will only ever change from false to true in the lifetime of the FolksPersonaStore.

Flags: Read

Default value: FALSE

Since 0.3.0


The “is-primary-store” property

  “is-primary-store”         gboolean

Whether this FolksPersonaStore is the primary store to be used for linking FolksPersonas.

Flags: Read / Write

Default value: FALSE

Since 0.6.3


The “is-quiescent” property

  “is-quiescent”             gboolean

Whether the store has reached a quiescent state. This will happen at some point after folks_persona_store_prepare() has successfully completed for the store. A store is in a quiescent state when all the FolksPersonas that it originally knows about have been loaded.

It's guaranteed that this property's value will only ever change after "is-prepared" has changed to true.

Flags: Read

Default value: FALSE

Since 0.6.2


The “is-user-set-default” property

  “is-user-set-default”      gboolean

Whether this FolksPersonaStore is marked as the default in its backend by the user.

i.e. A FolksPersonaStore for the EDS backend would set this to true if it represents the user’s default address book.

Flags: Read / Write

Default value: FALSE

Since 0.6.3


The “is-writeable” property

  “is-writeable”             gboolean

Whether the PersonaStore is writeable.

Only if a PersonaStore is writeable will its FolksPersonas be updated by changes to the FolksIndividuals containing them, and those changes then be written out to the relevant backing store.

If this property is false, it doesn't mean that FolksPersonas in this persona store aren't writeable at all. If their properties are updated through the FolksPersona, rather than through the FolksIndividual containing that persona, changes may be propagated to the backing store.

PersonaStores must not set this property themselves; it will be set as appropriate by the FolksIndividualAggregator.

FolksPersonaStore:is-writeable has been deprecated since version 0.6.3 and should not be used in newly-written code.

Replaced by “is-primary-store”.

Flags: Read / Write

Default value: FALSE

Since 0.1.13


The “personas” property

  “personas”                 GeeMap *

The FolksPersonas exposed by this PersonaStore.

Flags: Read

Since 0.5.1


The “trust-level” property

  “trust-level”              FolksPersonaStoreTrust

The trust level of the PersonaStore for linking.

Each FolksPersonaStore is assigned a trust level by the IndividualAggregator, designating whether to trust the properties of its FolksPersonas for linking to produce FolksIndividuals.

This value may change throughout the life of the FolksPersonaStore.

The trust level may be queried by clients, but must not be set by them. The setter for this property is for libfolks internal use only.

See also: FolksPersonaStoreTrust

Flags: Read / Write

Default value: FOLKS_PERSONA_STORE_TRUST_NONE

Since 0.1.13


The “type-id” property

  “type-id”                  gchar *

The type of PersonaStore this is.

This is the same for all PersonaStores provided by a given FolksBackend.

This is guaranteed to always be available; even before folks_persona_store_prepare() is called. It is immutable over the life of the FolksPersonaStore.

Flags: Read

Default value: NULL

Signal Details

The “personas-changed” signal

void
user_function (FolksPersonaStore            *persona_store,
               GeeSet                       *added,
               GeeSet                       *removed,
               gchar                        *message,
               FolksPersona                 *actor,
               FolksGroupDetailsChangeReason reason,
               gpointer                      user_data)

Emitted when one or more FolksPersonas are added to or removed from the store.

This will not be emitted until after folks_persona_store_prepare() has been called.

Parameters

persona_store

the FolksPersonaStore instance that received the signal

 

added

 .

a set of FolksPersonas which have been removed

 

removed

 .

a set of FolksPersonas which have been removed

 

message

 .

a string message from the backend, if any

 

actor

 .

the FolksPersona who made the change, if known

 

reason

 .

the reason for the change

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since 0.5.1


The “removed” signal

void
user_function (FolksPersonaStore *persona_store,
               gpointer           user_data)

Emitted when the backing store for this PersonaStore has been removed.

At this point, the PersonaStore and all its FolksPersonas are invalid, so any client referencing it should unreference it.

This will not be emitted until after folks_persona_store_prepare() has been called.

Parameters

persona_store

the FolksPersonaStore instance that received the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last