TpContact

TpContact — object representing a contact

Functions

TpContact * tp_connection_dup_contact_if_possible ()
TpAccount * tp_contact_get_account ()
TpConnection * tp_contact_get_connection ()
TpHandle tp_contact_get_handle ()
const gchar * tp_contact_get_identifier ()
gboolean tp_contact_has_feature ()
const gchar * tp_contact_get_alias ()
const gchar * tp_contact_get_avatar_token ()
GFile * tp_contact_get_avatar_file ()
const gchar * tp_contact_get_avatar_mime_type ()
const gchar * const * tp_contact_get_client_types ()
const gchar * tp_contact_get_presence_message ()
const gchar * tp_contact_get_presence_status ()
TpConnectionPresenceType tp_contact_get_presence_type ()
GVariant * tp_contact_dup_location ()
TpCapabilities * tp_contact_get_capabilities ()
GList * tp_contact_dup_contact_info ()
void tp_connection_refresh_contact_info ()
void tp_contact_request_contact_info_async ()
gboolean tp_contact_request_contact_info_finish ()
gboolean tp_contact_is_blocked ()
void tp_contact_block_async ()
gboolean tp_contact_block_finish ()
void tp_contact_unblock_async ()
gboolean tp_contact_unblock_finish ()
TpSubscriptionState tp_contact_get_subscribe_state ()
TpSubscriptionState tp_contact_get_publish_state ()
const gchar * tp_contact_get_publish_request ()
void tp_connection_dup_contact_by_id_async ()
TpContact * tp_connection_dup_contact_by_id_finish ()
void tp_connection_upgrade_contacts_async ()
gboolean tp_connection_upgrade_contacts_finish ()
void tp_contact_request_subscription_async ()
gboolean tp_contact_request_subscription_finish ()
void tp_contact_authorize_publication_async ()
gboolean tp_contact_authorize_publication_finish ()
void tp_contact_remove_async ()
gboolean tp_contact_remove_finish ()
void tp_contact_unsubscribe_async ()
gboolean tp_contact_unsubscribe_finish ()
void tp_contact_unpublish_async ()
gboolean tp_contact_unpublish_finish ()
const gchar * const * tp_contact_get_contact_groups ()
void tp_contact_set_contact_groups_async ()
gboolean tp_contact_set_contact_groups_finish ()
void tp_contact_add_to_group_async ()
gboolean tp_contact_add_to_group_finish ()
void tp_contact_remove_from_group_async ()
gboolean tp_contact_remove_from_group_finish ()

Properties

gchar * alias Read
GFile * avatar-file Read
gchar * avatar-mime-type Read
gchar * avatar-token Read
TpCapabilities * capabilities Read
GStrv client-types Read
TpConnection * connection Read / Write / Construct Only
GStrv contact-groups Read
TpContactInfoList * contact-info Read
guint handle Read / Write / Construct Only
gchar * identifier Read / Write / Construct Only
gboolean is-blocked Read
GVariant * location Read
gchar * presence-message Read
gchar * presence-status Read
guint presence-type Read
gchar * publish-request Read
guint publish-state Read
guint subscribe-state Read

Signals

void contact-groups-changed Run Last
void presence-changed Run Last
void subscription-states-changed Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── TpContact

Includes

#include <telepathy-glib/telepathy-glib.h>

Description

TpContact objects represent the contacts on a particular TpConnection.

Functions

tp_connection_dup_contact_if_possible ()

TpContact *
tp_connection_dup_contact_if_possible (TpConnection *connection,
                                       TpHandle handle,
                                       const gchar *identifier);

Try to return an existing contact object or create a new contact object immediately.

If identifier is non-NULL, this function always succeeds.

If identifier is NULL, it might not be possible to find the identifier for handle without making asynchronous D-Bus calls, so it might be necessary to delay processing of messages or other events until a TpContact can be constructed asynchronously, for instance by using tp_connection_get_contacts_by_handle().

Parameters

connection

a connection

 

handle

a handle of type TP_ENTITY_TYPE_CONTACT

 

identifier

the normalized identifier (XMPP JID, etc.) corresponding to handle , or NULL if not known.

[transfer none]

Returns

a contact or NULL.

[transfer full]

Since 0.13.9


tp_contact_get_account ()

TpAccount *
tp_contact_get_account (TpContact *self);

Return the TpAccount of self 's “connection”. See tp_connection_get_account() for details.

Parameters

self

a contact

 

Returns

a borrowed reference to self 's account (it must be referenced with g_object_ref if it must remain valid longer than the contact).

[transfer none]

Since 0.19.0


tp_contact_get_connection ()

TpConnection *
tp_contact_get_connection (TpContact *self);

Parameters

self

a contact

 

Returns

a borrowed reference to the “connection” (it must be referenced with g_object_ref if it must remain valid longer than the contact).

[transfer none]

Since 0.7.18


tp_contact_get_handle ()

TpHandle
tp_contact_get_handle (TpContact *self);

Return the contact's handle, which is of type TP_ENTITY_TYPE_CONTACT, or 0 if the “connection” has become invalid.

This handle is referenced using the Telepathy D-Bus API and remains referenced for as long as self exists and the “connection” remains valid.

However, the caller of this function does not gain an additional reference to the handle.

Parameters

self

a contact

 

Returns

the same handle as the “handle” property

Since 0.7.18


tp_contact_get_identifier ()

const gchar *
tp_contact_get_identifier (TpContact *self);

Return the contact's identifier. This remains valid for as long as self exists; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same non-NULL identifier as the “identifier” property

Since 0.7.18


tp_contact_has_feature ()

gboolean
tp_contact_has_feature (TpContact *self,
                        GQuark feature);

Parameters

self

a contact

 

feature

a desired feature

 

Returns

TRUE if self has been set up to track the feature feature

Since 0.99.1


tp_contact_get_alias ()

const gchar *
tp_contact_get_alias (TpContact *self);

Return the contact's alias. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same non-NULL alias as the “alias”

Since 0.7.18


tp_contact_get_avatar_token ()

const gchar *
tp_contact_get_avatar_token (TpContact *self);

Return the contact's avatar token. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same token as the “avatar-token” property (possibly NULL)

Since 0.7.18


tp_contact_get_avatar_file ()

GFile *
tp_contact_get_avatar_file (TpContact *self);

Return the contact's avatar file. This remains valid until the main loop is re-entered; if the caller requires a GFile that will persist for longer than that, it must be reffed with g_object_ref().

Parameters

self

a contact

 

Returns

the same GFile as the “avatar-file” property (possibly NULL).

[transfer none]

Since 0.11.6


tp_contact_get_avatar_mime_type ()

const gchar *
tp_contact_get_avatar_mime_type (TpContact *self);

Return the contact's avatar MIME type. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same MIME type as the “avatar-mime-type” property (possibly NULL)

Since 0.11.6


tp_contact_get_client_types ()

const gchar * const *
tp_contact_get_client_types (TpContact *self);

Return the contact's client types or NULL if the client types are unspecified.

Parameters

self

a contact

 

Returns

the same GStrv as the “client-types” property.

[array zero-terminated=1][transfer none]

Since 0.13.1


tp_contact_get_presence_message ()

const gchar *
tp_contact_get_presence_message (TpContact *self);

Return the contact's user-defined status message, or an empty string. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same non-NULL message as the “presence-message” property

Since 0.7.18


tp_contact_get_presence_status ()

const gchar *
tp_contact_get_presence_status (TpContact *self);

Return the name of the contact's presence status, or an empty string. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

Parameters

self

a contact

 

Returns

the same non-NULL status name as the “presence-status” property

Since 0.7.18


tp_contact_get_presence_type ()

TpConnectionPresenceType
tp_contact_get_presence_type (TpContact *self);

If this object has been set up to track TP_CONTACT_FEATURE_PRESENCE and the underlying connection supports the Presence interface, return the type of the contact's presence.

Otherwise, return TP_CONNECTION_PRESENCE_TYPE_UNSET.

Parameters

self

a contact

 

Returns

the same presence type as the “presence-type” property

Since 0.7.18


tp_contact_dup_location ()

GVariant *
tp_contact_dup_location (TpContact *self);

Return the contact's user-defined location, or NULL if the location is unspecified.

This function returns the same information as tp_contact_get_location(), but in a different format.

Parameters

self

a contact

 

Returns

a variant of type G_VARIANT_TYPE_VARDICT, the same as the “location” property

Since 0.19.10


tp_contact_get_capabilities ()

TpCapabilities *
tp_contact_get_capabilities (TpContact *self);

Parameters

self

a contact

 

Returns

the same TpCapabilities (or NULL) as the “capabilities” property.

[transfer none]

Since 0.11.3


tp_contact_dup_contact_info ()

GList *
tp_contact_dup_contact_info (TpContact *self);

Returns a newly allocated GList of contact's vCard fields. The list must be freed with tp_contact_info_list_free() after used.

Same as the “contact-info” property.

Parameters

self

a TpContact

 

Returns

a GList of TpContactInfoField, or NULL if the feature is not yet prepared.

[element-type TelepathyGLib.ContactInfoField][transfer full]

Since 0.19.9


tp_connection_refresh_contact_info ()

void
tp_connection_refresh_contact_info (TpConnection *self,
                                    guint n_contacts,
                                    TpContact * const *contacts);

Requests to refresh the “contact-info” property on each contact from contacts , requesting it from the network if an up-to-date version is not cached locally. "notify::contact-info" will be emitted when the contact's information are updated.

If TP_CONTACT_FEATURE_CONTACT_INFO is not yet set on a contact, it will be set before its property gets updated.

Parameters

self

a TpConnection

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects associated with self .

[array length=n_contacts]

Since 0.11.7


tp_contact_request_contact_info_async ()

void
tp_contact_request_contact_info_async (TpContact *self,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Requests an asynchronous request of the contact info of self . When the operation is finished, callback will be called. You can then call tp_contact_request_contact_info_finish() to get the result of the operation.

If the operation is successful, the “contact-info” property will be updated (emitting "notify::contact-info" signal) before callback is called. That means you can call tp_contact_get_contact_info() to get the new vCard inside callback .

Note that requesting the vCard from the network can take significant time, so a bigger timeout is set on the underlying D-Bus call. cancellable can be cancelled to free resources used in the D-Bus call if the caller is no longer interested in the vCard.

If TP_CONTACT_FEATURE_CONTACT_INFO is not yet set on self , it will be set before its property gets updated and callback is called.

Parameters

self

a TpContact

 

cancellable

optional GCancellable object, NULL to ignore.

 

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since 0.11.7


tp_contact_request_contact_info_finish ()

gboolean
tp_contact_request_contact_info_finish
                               (TpContact *self,
                                GAsyncResult *result,
                                GError **error);

Finishes an async request of self info. If the operation was successful, the contact's vCard can be accessed using tp_contact_get_contact_info().

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to be filled

 

Returns

TRUE if the request call was successful, otherwise FALSE

Since 0.11.7


tp_contact_is_blocked ()

gboolean
tp_contact_is_blocked (TpContact *self);

Parameters

self

a TpContact

 

Returns

the value of “is-blocked”.

Since 0.17.0


tp_contact_block_async ()

void
tp_contact_block_async (TpContact *self,
                        gboolean report_abusive,
                        GAsyncReadyCallback callback,
                        gpointer user_data);

Block communications with a contact, optionally reporting the contact as abusive to the server administrators. To block more than one contact at once, see tp_connection_block_contacts_async().

Parameters

self

a TpContact

 

report_abusive

If TRUE, report this contact as abusive to the server administrators as well as blocking him. See “can-report-abusive” to discover whether reporting abuse is supported. If “can-report-abusive” is FALSE, this parameter will be ignored.

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.17.0


tp_contact_block_finish ()

gboolean
tp_contact_block_finish (TpContact *self,
                         GAsyncResult *result,
                         GError **error);

Finishes tp_contact_block_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since 0.17.0


tp_contact_unblock_async ()

void
tp_contact_unblock_async (TpContact *self,
                          GAsyncReadyCallback callback,
                          gpointer user_data);

Unblock communications with a contact. To unblock more than one contact at once, see tp_connection_unblock_contacts_async().

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.17.0


tp_contact_unblock_finish ()

gboolean
tp_contact_unblock_finish (TpContact *self,
                           GAsyncResult *result,
                           GError **error);

Finishes tp_contact_unblock_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since 0.17.0


tp_contact_get_subscribe_state ()

TpSubscriptionState
tp_contact_get_subscribe_state (TpContact *self);

Return the state of the local user's subscription to this remote contact's presence.

This is set to TP_SUBSCRIPTION_STATE_UNKNOWN until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared

Parameters

self

a TpContact

 

Returns

the value of “subscribe-state”.

Since 0.13.12


tp_contact_get_publish_state ()

TpSubscriptionState
tp_contact_get_publish_state (TpContact *self);

Return the state of this remote contact's subscription to the local user's presence.

This is set to TP_SUBSCRIPTION_STATE_UNKNOWN until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared

Parameters

self

a TpContact

 

Returns

the value of “publish-state”.

Since 0.13.12


tp_contact_get_publish_request ()

const gchar *
tp_contact_get_publish_request (TpContact *self);

If “publish-state” is set to TP_SUBSCRIPTION_STATE_ASK, return the message that this remote contact sent when they requested permission to see the local user's presence, an empty string ("") otherwise. This remains valid until the main loop is re-entered; if the caller requires a string that will persist for longer than that, it must be copied with g_strdup().

This is set to NULL until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared, and it is guaranteed to be non-NULL afterward.

Parameters

self

a TpContact

 

Returns

the value of “publish-request”.

Since 0.13.12


tp_connection_dup_contact_by_id_async ()

void
tp_connection_dup_contact_by_id_async (TpConnection *self,
                                       const gchar *id,
                                       const GQuark *features,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Create a TpContact object and make any asynchronous method calls necessary to ensure that all the features specified in features are ready for use (if they are supported at all).

It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

Parameters

self

A connection, which must have the TP_CONNECTION_FEATURE_CONNECTED feature prepared

 

id

A strings representing the desired contact by its identifier in the IM protocol (an XMPP JID, SIP URI, MSN Passport, AOL screen-name etc.)

 

features

An array of features that must be ready for.

[transfer none][array zero-terminated=1][allow-none][element-type GLib.Quark]

callback

A user callback to call when the contact is ready

 

user_data

Data to pass to the callback

 

Since 0.19.0


tp_connection_dup_contact_by_id_finish ()

TpContact *
tp_connection_dup_contact_by_id_finish
                               (TpConnection *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_connection_dup_contact_by_id_async().

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

a TpContact or NULL on error.

[transfer full]

Since 0.19.0


tp_connection_upgrade_contacts_async ()

void
tp_connection_upgrade_contacts_async (TpConnection *self,
                                      guint n_contacts,
                                      TpContact * const *contacts,
                                      const GQuark *features,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Given several TpContact objects, make asynchronous method calls ensure that all the features specified in features are ready for use (if they are supported at all).

It is not an error to put features in features even if the connection manager doesn't support them - users of this method should have a static list of features they would like to use if possible, and use it for all connection managers.

Parameters

self

A connection, which must have the TP_CONNECTION_FEATURE_CONNECTED feature prepared

 

n_contacts

The number of contacts in contacts (must be at least 1)

 

contacts

An array of TpContact objects associated with self .

[array length=n_contacts]

features

An array of features that must be ready for.

[transfer none][array zero-terminated=1][allow-none][element-type GLib.Quark]

callback

A user callback to call when the contacts are ready

 

user_data

Data to pass to the callback

 

Since 0.19.0


tp_connection_upgrade_contacts_finish ()

gboolean
tp_connection_upgrade_contacts_finish (TpConnection *self,
                                       GAsyncResult *result,
                                       GPtrArray **contacts,
                                       GError **error);

Finishes tp_connection_upgrade_contacts_async().

Parameters

self

a TpConnection

 

result

a GAsyncResult

 

contacts

a location to set a GPtrArray of upgraded TpContact, or NULL.

[element-type TelepathyGLib.Contact][transfer container][out][allow-none]

error

a GError to fill

 

Returns

TRUE on success, FALSE otherwise.

Since 0.19.0


tp_contact_request_subscription_async ()

void
tp_contact_request_subscription_async (TpContact *self,
                                       const gchar *message,
                                       GAsyncReadyCallback callback,
                                       gpointer user_data);

Convenience wrapper for tp_connection_request_subscription_async() on a single contact.

Parameters

self

a TpContact

 

message

an optional message

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.15.5


tp_contact_request_subscription_finish ()

gboolean
tp_contact_request_subscription_finish
                               (TpContact *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_contact_request_subscription_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since 0.15.5


tp_contact_authorize_publication_async ()

void
tp_contact_authorize_publication_async
                               (TpContact *self,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

Convenience wrapper for tp_connection_authorize_publication_async() on a single contact.

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.15.5


tp_contact_authorize_publication_finish ()

gboolean
tp_contact_authorize_publication_finish
                               (TpContact *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_contact_authorize_publication_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since 0.15.5


tp_contact_remove_async ()

void
tp_contact_remove_async (TpContact *self,
                         GAsyncReadyCallback callback,
                         gpointer user_data);

Convenience wrapper for tp_connection_remove_contacts_async() on a single contact.

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.15.5


tp_contact_remove_finish ()

gboolean
tp_contact_remove_finish (TpContact *self,
                          GAsyncResult *result,
                          GError **error);

Finishes tp_contact_remove_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since 0.15.5


tp_contact_unsubscribe_async ()

void
tp_contact_unsubscribe_async (TpContact *self,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

Convenience wrapper for tp_connection_unsubscribe_async() on a single contact.

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.15.5


tp_contact_unsubscribe_finish ()

gboolean
tp_contact_unsubscribe_finish (TpContact *self,
                               GAsyncResult *result,
                               GError **error);

Finishes tp_contact_unsubscribe_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since 0.15.5


tp_contact_unpublish_async ()

void
tp_contact_unpublish_async (TpContact *self,
                            GAsyncReadyCallback callback,
                            gpointer user_data);

Convenience wrapper for tp_connection_unpublish_async() on a single contact.

Parameters

self

a TpContact

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.15.5


tp_contact_unpublish_finish ()

gboolean
tp_contact_unpublish_finish (TpContact *self,
                             GAsyncResult *result,
                             GError **error);

Finishes tp_contact_unpublish_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since 0.15.5


tp_contact_get_contact_groups ()

const gchar * const *
tp_contact_get_contact_groups (TpContact *self);

Return names of groups of which a contact is a member. It is incorrect to call this method before TP_CONTACT_FEATURE_CONTACT_GROUPS has been prepared. This remains valid until the main loop is re-entered; if the caller requires a GStrv that will persist for longer than that, it must be copied with g_strdupv().

Parameters

self

a TpContact

 

Returns

the same GStrv as the “contact-groups” property.

[array zero-terminated=1][transfer none]

Since 0.13.14


tp_contact_set_contact_groups_async ()

void
tp_contact_set_contact_groups_async (TpContact *self,
                                     gint n_groups,
                                     const gchar * const *groups,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Add self to the given groups (creating new groups if necessary), and remove it from all other groups. If the user is removed from a group of which they were the only member, the group MAY be removed automatically. You can then call tp_contact_set_contact_groups_finish() to get the result of the operation.

If the operation is successful and TP_CONTACT_FEATURE_CONTACT_GROUPS is prepared, the “contact-groups” property will be updated (emitting "notify::contact-groups" signal) and “contact-groups-changed” signal will be emitted before callback is called. That means you can call tp_contact_get_contact_groups() to get the new contact groups inside callback .

Parameters

self

a TpContact

 

n_groups

the number of groups, or -1 if groups is NULL-terminated

 

groups

the set of groups which the contact should be in (may be NULL if n_groups is 0).

[array length=n_groups][element-type utf8][allow-none]

callback

a callback to call when the request is satisfied

 

user_data

data to pass to callback

 

Since 0.13.14


tp_contact_set_contact_groups_finish ()

gboolean
tp_contact_set_contact_groups_finish (TpContact *self,
                                      GAsyncResult *result,
                                      GError **error);

Finishes an async set of self contact groups.

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to be filled

 

Returns

TRUE if the request call was successful, otherwise FALSE

Since 0.13.14


tp_contact_add_to_group_async ()

void
tp_contact_add_to_group_async (TpContact *self,
                               const gchar *group,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

Convenience wrapper for tp_connection_add_to_group_async() on a single contact.

Parameters

self

a TpContact

 

group

the group to alter.

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.15.5


tp_contact_add_to_group_finish ()

gboolean
tp_contact_add_to_group_finish (TpContact *self,
                                GAsyncResult *result,
                                GError **error);

Finishes tp_contact_add_to_group_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since 0.15.5


tp_contact_remove_from_group_async ()

void
tp_contact_remove_from_group_async (TpContact *self,
                                    const gchar *group,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Convenience wrapper for tp_connection_remove_from_group_async() on a single contact.

Parameters

self

a TpContact

 

group

the group to alter.

 

callback

a callback to call when the operation finishes

 

user_data

data to pass to callback

 

Since 0.15.5


tp_contact_remove_from_group_finish ()

gboolean
tp_contact_remove_from_group_finish (TpContact *self,
                                     GAsyncResult *result,
                                     GError **error);

Finishes tp_contact_remove_from_group_async()

Parameters

self

a TpContact

 

result

a GAsyncResult

 

error

a GError to fill

 

Returns

TRUE if the operation was successful, otherwise FALSE.

Since 0.15.5

Types and Values

TpContact

typedef struct _TpContact TpContact;

An object representing a contact on a TpConnection.

Contact objects support tracking a number of attributes of contacts, as described by the contact feature GQuarks. Features can be specified when instantiating contact objects (with tp_connection_get_contacts_by_id() or tp_connection_get_contacts_by_handle()), or added to an existing contact object with tp_connection_upgrade_contacts(). For example, a client wishing to keep track of a contact's alias would set TP_CONTACT_FEATURE_ALIAS, and then listen for the "notify::alias" signal, emitted whenever the “alias” property changes.

Since 0.7.18


TP_CONTACT_FEATURE_ALIAS

#define             TP_CONTACT_FEATURE_ALIAS

Expands to a call to a function that returns a GQuark representing the "alias" feature.

When this feature is prepared, the contact's alias has been retrieved. In particular, the “alias” property has been set.

Since 0.99.1


TP_CONTACT_FEATURE_AVATAR_TOKEN

#define             TP_CONTACT_FEATURE_AVATAR_TOKEN

Expands to a call to a function that returns a GQuark representing the "avatar token" feature.

When this feature is prepared, the contact's avatar token has been retrieved. In particular, the “avatar-token” property has been set.

Since 0.19.0


TP_CONTACT_FEATURE_AVATAR_DATA

#define             TP_CONTACT_FEATURE_AVATAR_DATA

Expands to a call to a function that returns a GQuark representing the "avatar data" feature.

When this feature is prepared, the contact's avatar has been retrieved. In particular, the “avatar-file” property has been set.

This feature also implies the TP_CONTACT_FEATURE_AVATAR_TOKEN.

Since 0.99.1


TP_CONTACT_FEATURE_CLIENT_TYPES

#define             TP_CONTACT_FEATURE_CLIENT_TYPES

Expands to a call to a function that returns a GQuark representing the "client types" feature.

When this feature is prepared, the contact's client types have been retrieved. In particular, the “client-types” property has been set.

Since 0.99.1


TP_CONTACT_FEATURE_PRESENCE

#define             TP_CONTACT_FEATURE_PRESENCE

Expands to a call to a function that returns a GQuark representing the "presence" feature.

When this feature is prepared, the contact's presence has been retrieved. In particular, the “presence-type”, “presence-status”, and “presence-message” properties have been set.

Since 0.99.1


TP_CONTACT_FEATURE_LOCATION

#define             TP_CONTACT_FEATURE_LOCATION

Expands to a call to a function that returns a GQuark representing the "location" feature.

When this feature is prepared, the contact's location has been retrieved. In particular, the “location” property has been set.

Since 0.99.1


TP_CONTACT_FEATURE_CAPABILITIES

#define             TP_CONTACT_FEATURE_CAPABILITIES

Expands to a call to a function that returns a GQuark representing the "capabilities" feature.

When this feature is prepared, the contact's capabilities have been retrieved. In particular, the “capabilities” property has been set.

Since 0.99.1


TP_CONTACT_FEATURE_CONTACT_INFO

#define             TP_CONTACT_FEATURE_CONTACT_INFO

Expands to a call to a function that returns a GQuark representing the "contact info" feature.

When this feature is prepared, the contact's contact info has been retrieved. In particular, the “contact-info” property has been set.

Since 0.99.1


TP_CONTACT_FEATURE_CONTACT_BLOCKING

#define             TP_CONTACT_FEATURE_CONTACT_BLOCKING

Expands to a call to a function that returns a GQuark representing the "contact blocking" feature.

When this feature is prepared, the contact's blocking state have been retrieved. In particular, the “is-blocked” property has been set.

This feature requires a Connection implementing the TP_IFACE_CONNECTION_INTERFACE_CONTACT_BLOCKING1 interface.

Since 0.99.1


TP_CONTACT_FEATURE_SUBSCRIPTION_STATES

#define             TP_CONTACT_FEATURE_SUBSCRIPTION_STATES

Expands to a call to a function that returns a GQuark representing the "subscription states" feature.

When this feature is prepared, the contact's subscription states have been retrieved. In particular, the “subscribe-state”, “publish-request”, and “publish-state” properties have been set.

This feature requires a Connection implementing the TP_IFACE_CONNECTION_INTERFACE_CONTACT_LIST1 interface.

Since 0.99.1


TP_CONTACT_FEATURE_CONTACT_GROUPS

#define             TP_CONTACT_FEATURE_CONTACT_GROUPS

Expands to a call to a function that returns a GQuark representing the "contact groups" feature.

When this feature is prepared, the contact's contact groups have been retrieved. In particular, the “contact-groups” property has been set.

This feature requires a Connection implementing the TP_IFACE_CONNECTION_INTERFACE_CONTACT_GROUPS1 interface.

Since 0.99.1

Property Details

The “alias” property

  “alias”                    gchar *

The contact's alias if available, falling back to their “identifier” if no alias is available or if the TpContact has not been set up to track TP_CONTACT_FEATURE_ALIAS.

This alias may have been supplied by the contact themselves, or by the local user, so it does not necessarily unambiguously identify the contact. However, it is suitable for use as a main "display name" for the contact.

Flags: Read

Default value: NULL


The “avatar-file” property

  “avatar-file”              GFile *

GFile to the latest cached avatar image, or NULL if this contact has no avatar, or if the avatar data is not yet retrieved.

When “avatar-token” changes, this property is not updated immediately, but will be updated when the new avatar data is retrieved and stored in cache. Until then, the file will keep its old value of the latest cached avatar image.

This is set to NULL if TP_CONTACT_FEATURE_AVATAR_DATA is not set on this contact. Note that setting TP_CONTACT_FEATURE_AVATAR_DATA will also implicitly set TP_CONTACT_FEATURE_AVATAR_TOKEN.

Flags: Read

Since 0.11.6


The “avatar-mime-type” property

  “avatar-mime-type”         gchar *

MIME type of the latest cached avatar image, or NULL if this contact has no avatar, or if the avatar data is not yet retrieved.

This is always the MIME type of the image given by “avatar-file”.

Flags: Read

Default value: NULL

Since 0.11.6


The “avatar-token” property

  “avatar-token”             gchar *

An opaque string representing state of the contact's avatar (depending on the protocol, this might be a hash, a timestamp or something else), or an empty string if there is no avatar.

This may be NULL if it is not known whether this contact has an avatar or not (either for network protocol reasons, or because this TpContact has not been set up to track TP_CONTACT_FEATURE_AVATAR_TOKEN).

Flags: Read

Default value: NULL


The “capabilities” property

  “capabilities”             TpCapabilities *

The capabilities supported by this contact. If the underlying Connection doesn't support the ContactCapabilities interface, this property will contain the capabilities supported by the connection. Use tp_capabilities_is_specific_to_contact() to check if the capabilities are specific to this TpContact or not.

This may be NULL if this TpContact object has not been set up to track TP_CONTACT_FEATURE_CAPABILITIES.

Flags: Read

Since 0.11.3


The “client-types” property

  “client-types”             GStrv

A GStrv containing the client types of this contact.

This is set to NULL if TP_CONTACT_FEATURE_CLIENT_TYPES is not set on this contact; it may also be NULL if that feature is prepared, but the contact's client types are unknown.

Flags: Read

Since 0.13.1


The “connection” property

  “connection”               TpConnection *

The TpConnection to which this contact belongs.

Flags: Read / Write / Construct Only


The “contact-groups” property

  “contact-groups”           GStrv

a GStrv with names of groups of which a contact is a member.

This is set to NULL if TP_CONTACT_FEATURE_CONTACT_GROUPS is not prepared on this contact, or if the connection does not implement ContactGroups interface.

Flags: Read

Since 0.13.14


The “contact-info” property

  “contact-info”             TpContactInfoList *

A GList of TpContactInfoField representing the vCard of this contact.

This is set to NULL if TP_CONTACT_FEATURE_CONTACT_INFO is not set on this contact.

Flags: Read

Since 0.11.7


The “handle” property

  “handle”                   guint

The contact's handle in the Telepathy D-Bus API, a handle of type TP_ENTITY_TYPE_CONTACT representing the string given by “identifier”.

This handle is referenced using the Telepathy D-Bus API and remains referenced for as long as the TpContact exists and the “connection” remains valid.

However, getting this property does not cause an additional reference to the handle to be held.

If the “connection” becomes invalid, this property is no longer meaningful and will be set to 0.

Flags: Read / Write / Construct Only

Default value: 0


The “identifier” property

  “identifier”               gchar *

The contact's identifier in the instant messaging protocol (e.g. XMPP JID, SIP URI, AOL screenname or IRC nick - whatever the underlying protocol uses to identify a user).

Flags: Read / Write / Construct Only

Default value: NULL


The “is-blocked” property

  “is-blocked”               gboolean

TRUE if the contact has been blocked.

This is set to FALSE if TP_CONTACT_FEATURE_CONTACT_BLOCKING is not prepared on this contact, or if the connection does not implement ContactBlocking interface.

Flags: Read

Default value: FALSE

Since 0.17.0


The “location” property

  “location”                 GVariant *

If this contact has set a user-defined location, a string to variant map containing his location. If not, NULL. tp_vardict_get_string() and similar functions can be used to access the contents.

This may be NULL even if the contact has set a location, if this TpContact object has not been set up to track TP_CONTACT_FEATURE_LOCATION.

Flags: Read

Allowed values: GVariant<a{sv}>

Default value: NULL


The “presence-message” property

  “presence-message”         gchar *

If this contact has set a user-defined status message, that message; if not, an empty string (which user interfaces may replace with a localized form of the “presence-status” or “presence-type”).

This may be an empty string even if the contact has set a message, if this TpContact object has not been set up to track TP_CONTACT_FEATURE_PRESENCE. It is never NULL.

Flags: Read

Default value: ""


The “presence-status” property

  “presence-status”          gchar *

A string representing the presence status of this contact. This may be a well-known string from the Telepathy specification, like "available", or a connection-manager-specific string, like "out-to-lunch".

This may be an empty string if this TpContact object has not been set up to track TP_CONTACT_FEATURE_PRESENCE. It is never NULL.

Flags: Read

Default value: ""


The “presence-type” property

  “presence-type”            guint

The TpConnectionPresenceType representing the type of presence status for this contact.

This is provided so even unknown values for “presence-status” can be classified into their fundamental types.

This may be TP_CONNECTION_PRESENCE_TYPE_UNSET if this TpContact has not been set up to track TP_CONTACT_FEATURE_PRESENCE.

Flags: Read

Default value: 0


The “publish-request” property

  “publish-request”          gchar *

The message that contact sent when they requested permission to see the local user's presence, if “publish-state” is TP_SUBSCRIPTION_STATE_ASK, an empty string ("") otherwise.

This is set to NULL until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared, and it is guaranteed to be non-NULL afterward.

Flags: Read

Default value: NULL

Since 0.13.12


The “publish-state” property

  “publish-state”            guint

A TpSubscriptionState indicating the state of this contact's subscription to the local user's presence.

This is set to TP_SUBSCRIPTION_STATE_UNKNOWN until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared

Flags: Read

Default value: 0

Since 0.13.12


The “subscribe-state” property

  “subscribe-state”          guint

A TpSubscriptionState indicating the state of the local user's subscription to this contact's presence.

This is set to TP_SUBSCRIPTION_STATE_UNKNOWN until TP_CONTACT_FEATURE_SUBSCRIPTION_STATES has been prepared

Flags: Read

Default value: 0

Since 0.13.12

Signal Details

The “contact-groups-changed” signal

void
user_function (TpContact *contact,
               GStrv      added,
               GStrv      removed,
               gpointer   user_data)

Emitted when this contact's groups changes. When this signal is emitted, “contact-groups” property is already updated.

Parameters

contact

A TpContact

 

added

A GStrv with added contact groups

 

removed

A GStrv with removed contact groups

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since 0.13.14


The “presence-changed” signal

void
user_function (TpContact *contact,
               guint      type,
               gchar     *status,
               gchar     *message,
               gpointer   user_data)

Emitted when this contact's presence changes.

Parameters

contact

a TpContact

 

type

The new value of “presence-type”

 

status

The new value of “presence-status”

 

message

The new value of “presence-message”

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since 0.11.7


The “subscription-states-changed” signal

void
user_function (TpContact *contact,
               guint      subscribe,
               guint      publish,
               gchar     *publish_request,
               gpointer   user_data)

Emitted when this contact's subscription states changes.

Parameters

contact

a TpContact

 

subscribe

the new value of “subscribe-state”

 

publish

the new value of “publish-state”

 

publish_request

the new value of “publish-request”

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since 0.13.12

See Also

TpConnection