Top |
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 |
GStrv | contact-groups | Read |
TpContactInfoList * | contact-info | Read |
guint | handle | Read |
gchar * | identifier | Read |
gboolean | is-blocked | Read |
GHashTable_gchararray+GValue_* | location | Read |
GVariant * | location-vardict | 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 |
void | contact-groups-changed | Run Last |
void | presence-changed | Run Last |
void | subscription-states-changed | Run Last |
TpContact | |
enum | TpContactFeature |
#define | TP_CONTACT_FEATURE_INVALID |
#define | NUM_TP_CONTACT_FEATURES |
#define | TP_NUM_CONTACT_FEATURES |
#define | TP_TYPE_CONTACT_FEATURE |
void (*TpConnectionContactsByHandleCb) (TpConnection *connection
,guint n_contacts
,TpContact * const *contacts
,guint n_failed
,const TpHandle *failed
,const GError *error
,gpointer user_data
,GObject *weak_object
);
TpConnectionContactsByHandleCb
is deprecated and should not be used in newly-written code.
Signature of a callback used to receive the result of
tp_connection_get_contacts_by_handle()
.
If an unrecoverable error occurs (for instance, if connection
becomes disconnected) the whole operation fails, and no contacts or
invalid handles are returned.
If some or even all of the handles
passed to
tp_connection_get_contacts_by_handle()
were not valid, this is not
considered to be a failure. error
will be NULL
in this situation,
contacts
will contain contact objects for those handles that were
valid (possibly none of them), and invalid
will contain the handles
that were not valid.
connection |
The connection |
|
n_contacts |
The number of TpContact objects successfully created (one per valid handle), or 0 on unrecoverable errors |
|
contacts |
An array of |
[array length=n_contacts] |
n_failed |
The number of invalid handles that were passed to
|
|
failed |
An array of |
[array length=n_failed] |
error |
|
|
user_data |
the |
|
weak_object |
the |
Since: 0.7.18
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 tp_connection_has_immortal_handles()
would return TRUE
and
identifier
is non-NULL
, this function always succeeds.
On connections without immortal handles, it is not possible to guarantee
that handle
remains valid 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_id()
.
Similarly, 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()
.
connection |
a connection |
|
handle |
a handle of type |
|
identifier |
the normalized identifier (XMPP JID, etc.)
corresponding to |
[transfer none] |
Since: 0.13.9
void tp_connection_get_contacts_by_handle (TpConnection *self
,guint n_handles
,const TpHandle *handles
,guint n_features
,const TpContactFeature *features
,TpConnectionContactsByHandleCb callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
tp_connection_get_contacts_by_handle
is deprecated and should not be used in newly-written code.
Use tp_simple_client_factory_ensure_contact()
instead.
Create a number of TpContact objects and make asynchronous method calls
to hold their handles and 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.
self |
A connection, which must have the |
|
n_handles |
The number of handles in |
|
handles |
An array of handles
of type |
[array length=n_handles][element-type uint] |
n_features |
The number of features in |
|
features |
An array of features that
must be ready for use (if supported) before the callback is called (may
be |
[array length=n_features][allow-none][element-type uint] |
callback |
A user callback to call when the contacts are ready |
|
user_data |
Data to pass to the callback |
|
destroy |
Called to destroy |
|
weak_object |
An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled. |
[allow-none] |
Since: 0.7.18
void (*TpConnectionContactsByIdCb) (TpConnection *connection
,guint n_contacts
,TpContact * const *contacts
,const gchar * const *requested_ids
,GHashTable *failed_id_errors
,const GError *error
,gpointer user_data
,GObject *weak_object
);
TpConnectionContactsByIdCb
is deprecated and should not be used in newly-written code.
Signature of a callback used to receive the result of
tp_connection_get_contacts_by_id()
.
requested_ids
contains the IDs that were converted to handles successfully.
The normalized form of requested_ids[i] is
tp_contact_get_identifier (contacts[i]).
If some or even all of the ids
passed to
tp_connection_get_contacts_by_id()
were not valid, this is not
considered to be a fatal error. error
will be NULL
in this situation,
contacts
will contain contact objects for those IDs that were
valid (it may be empty), and failed_id_errors
will map the IDs
that were not valid to a corresponding GError (if the connection manager
complies with the Telepathy spec, it will have domain TP_ERROR
and code
TP_ERROR_INVALID_HANDLE
).
If an unrecoverable error occurs (for instance, if connection
becomes disconnected) the whole operation fails, and no contacts
or requested IDs are returned. failed_id_errors
will contain all the IDs
that were requested, mapped to a corresponding GError (either one
indicating that the ID was invalid, if that was determined before the
fatal error occurred, or a copy of error
).
connection |
The connection |
|
n_contacts |
The number of TpContact objects successfully created (one per valid ID), or 0 on unrecoverable errors |
|
contacts |
An array of |
[array length=n_contacts] |
requested_ids |
An array of |
[array length=n_contacts] |
failed_id_errors |
A hash table in which the keys are IDs and the values are errors (GError). |
[element-type utf8 GLib.Error] |
error |
|
|
user_data |
the |
|
weak_object |
the |
Since: 0.7.18
void tp_connection_get_contacts_by_id (TpConnection *self
,guint n_ids
,const gchar * const *ids
,guint n_features
,const TpContactFeature *features
,TpConnectionContactsByIdCb callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
tp_connection_get_contacts_by_id
is deprecated and should not be used in newly-written code.
Use tp_connection_dup_contact_by_id_async()
instead.
Create a number of TpContact objects and make asynchronous method calls
to obtain their handles and 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.
self |
A connection, which must have the |
|
n_ids |
The number of IDs in |
|
ids |
An array of strings representing the desired contacts by their identifiers in the IM protocol (XMPP JIDs, SIP URIs, MSN Passports, AOL screen-names etc.). |
[array length=n_ids][transfer none] |
n_features |
The number of features in |
|
features |
An array of features
that must be ready for use (if supported)
before the callback is called (may be |
[array length=n_features][allow-none] |
callback |
A user callback to call when the contacts are ready |
|
user_data |
Data to pass to the callback |
|
destroy |
Called to destroy |
|
weak_object |
An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled. |
[allow-none] |
Since: 0.7.18
void (*TpConnectionUpgradeContactsCb) (TpConnection *connection
,guint n_contacts
,TpContact * const *contacts
,const GError *error
,gpointer user_data
,GObject *weak_object
);
TpConnectionUpgradeContactsCb
is deprecated and should not be used in newly-written code.
Signature of a callback used to receive the result of
tp_connection_upgrade_contacts()
.
If an unrecoverable error occurs (for instance, if connection
becomes
disconnected) it is indicated by error
, but the contacts in contacts
are still provided.
connection |
The connection |
|
n_contacts |
The number of TpContact objects for which an upgrade was requested |
|
contacts |
An array of |
[array length=n_contacts] |
error |
An unrecoverable error, or |
|
user_data |
the |
|
weak_object |
the |
Since: 0.7.18
void tp_connection_upgrade_contacts (TpConnection *self
,guint n_contacts
,TpContact * const *contacts
,guint n_features
,const TpContactFeature *features
,TpConnectionUpgradeContactsCb callback
,gpointer user_data
,GDestroyNotify destroy
,GObject *weak_object
);
tp_connection_upgrade_contacts
is deprecated and should not be used in newly-written code.
Use tp_connection_upgrade_contacts_async()
instead.
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.
self |
A connection, which must have the |
|
n_contacts |
The number of contacts in |
|
contacts |
An array of TpContact objects
associated with |
[array length=n_contacts] |
n_features |
The number of features in |
|
features |
An array of features that must be ready for use (if supported) before the callback is called. |
[array length=n_features] |
callback |
A user callback to call when the contacts are ready |
|
user_data |
Data to pass to the callback |
|
destroy |
Called to destroy |
|
weak_object |
An object to pass to the callback, which will be weakly referenced; if this object is destroyed, the operation will be cancelled. |
[allow-none] |
Since: 0.7.18
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.
self |
||
n_contacts |
The number of contacts in |
|
contacts |
An array of TpContact objects
associated with |
[array length=n_contacts] |
Since: 0.11.7
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()
.
Since: 0.7.18
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()
.
Since: 0.7.18
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()
.
Since: 0.11.6
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()
.
Since: 0.11.6
const gchar * const *
tp_contact_get_client_types (TpContact *self
);
Return the contact's client types or NULL
if the client types are
unspecified.
Since: 0.13.1
TpAccount *
tp_contact_get_account (TpContact *self
);
Return the TpAccount of self
's “connection”.
See tp_connection_get_account()
for details.
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
TpConnection *
tp_contact_get_connection (TpContact *self
);
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
TpHandle
tp_contact_get_handle (TpContact *self
);
Return the contact's handle, which is of type TP_HANDLE_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.
Since: 0.7.18
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()
.
Since: 0.7.18
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()
.
Since: 0.7.18
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()
.
Since: 0.7.18
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 either the Presence or
SimplePresence interfaces, return the type of the contact's presence.
Otherwise, return TP_CONNECTION_PRESENCE_TYPE_UNSET
.
Since: 0.7.18
GHashTable *
tp_contact_get_location (TpContact *self
);
Return the contact's user-defined location or NULL
if the location is
unspecified.
This remains valid until the main loop is re-entered; if the caller
requires a hash table that will persist for longer than that, it must be
reffed with g_hash_table_ref()
.
the same
GHashTable (or NULL
) as the “location” property.
[element-type utf8 GObject.Value][transfer none]
Since: 0.11.1
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.
Since: 0.19.10
TpCapabilities *
tp_contact_get_capabilities (TpContact *self
);
Since: 0.11.3
GList *
tp_contact_get_contact_info (TpContact *self
);
tp_contact_get_contact_info
is deprecated and should not be used in newly-written code.
Since 0.19.9. New code should use
tp_contact_dup_contact_info()
instead.
Returns a newly allocated GList of contact's vCard fields. The list must be
freed with g_list_free()
after used.
Note that the TpContactInfoFields in the returned GList are not
dupped before returning from this function. One could copy every item in the
list using tp_contact_info_field_copy()
.
Same as the “contact-info” property.
a GList of TpContactInfoField, or NULL
if the feature is not yet
prepared.
[element-type TelepathyGLib.ContactInfoField][transfer container]
Since: 0.11.7
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.
a GList of TpContactInfoField, or NULL
if the feature is not yet
prepared.
[element-type TelepathyGLib.ContactInfoField][transfer full]
Since: 0.19.9
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.
self |
||
cancellable |
optional GCancellable object, |
|
callback |
a callback to call when the request is satisfied |
|
user_data |
data to pass to |
Since: 0.11.7
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()
.
Since: 0.11.7
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
Since: 0.13.12
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
Since: 0.13.12
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.
Since: 0.13.12
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()
.
Since: 0.13.14
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
.
self |
||
n_groups |
the number of groups, or -1 if |
|
groups |
the set of
groups which the contact should be in (may be |
[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 |
Since: 0.13.14
gboolean tp_contact_set_contact_groups_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes an async set of self
contact groups.
Since: 0.13.14
gboolean tp_contact_has_feature (TpContact *self
,TpContactFeature feature
);
Since: 0.7.18
void tp_connection_dup_contact_by_id_async (TpConnection *self
,const gchar *id
,guint n_features
,const TpContactFeature *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.
self |
A connection, which must have the |
|
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.) |
|
n_features |
The number of features in |
|
features |
An array of features
that must be ready for use (if supported)
before the callback is called (may be |
[array length=n_features][allow-none] |
callback |
A user callback to call when the contact is ready |
|
user_data |
Data to pass to the callback |
Since: 0.19.0
TpContact * tp_connection_dup_contact_by_id_finish (TpConnection *self
,GAsyncResult *result
,GError **error
);
Finishes tp_connection_dup_contact_by_id_async()
.
Since: 0.19.0
void tp_connection_upgrade_contacts_async (TpConnection *self
,guint n_contacts
,TpContact * const *contacts
,guint n_features
,const TpContactFeature *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.
self |
A connection, which must have the |
|
n_contacts |
The number of contacts in |
|
contacts |
An array of TpContact objects
associated with |
[array length=n_contacts] |
n_features |
The number of features in |
|
features |
An array of features that must be ready for use (if supported) before the callback is called. |
[array length=n_features] |
callback |
A user callback to call when the contacts are ready |
|
user_data |
Data to pass to the callback |
Since: 0.19.0
gboolean tp_connection_upgrade_contacts_finish (TpConnection *self
,GAsyncResult *result
,GPtrArray **contacts
,GError **error
);
Finishes tp_connection_upgrade_contacts_async()
.
self |
||
result |
a GAsyncResult |
|
contacts |
a location to set a GPtrArray of upgraded TpContact, or |
[element-type TelepathyGLib.Contact][transfer container][out][allow-none] |
error |
a GError to fill |
Since: 0.19.0
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.
self |
||
message |
an optional message |
|
callback |
a callback to call when the operation finishes |
|
user_data |
data to pass to |
Since: 0.15.5
gboolean tp_contact_request_subscription_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes tp_contact_request_subscription_async()
Since: 0.15.5
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.
self |
||
callback |
a callback to call when the operation finishes |
|
user_data |
data to pass to |
Since: 0.15.5
gboolean tp_contact_authorize_publication_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes tp_contact_authorize_publication_async()
Since: 0.15.5
void tp_contact_remove_async (TpContact *self
,GAsyncReadyCallback callback
,gpointer user_data
);
Convenience wrapper for tp_connection_remove_contacts_async()
on a single contact.
self |
||
callback |
a callback to call when the operation finishes |
|
user_data |
data to pass to |
Since: 0.15.5
gboolean tp_contact_remove_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes tp_contact_remove_async()
Since: 0.15.5
void tp_contact_unsubscribe_async (TpContact *self
,GAsyncReadyCallback callback
,gpointer user_data
);
Convenience wrapper for tp_connection_unsubscribe_async()
on a single contact.
self |
||
callback |
a callback to call when the operation finishes |
|
user_data |
data to pass to |
Since: 0.15.5
gboolean tp_contact_unsubscribe_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes tp_contact_unsubscribe_async()
Since: 0.15.5
void tp_contact_unpublish_async (TpContact *self
,GAsyncReadyCallback callback
,gpointer user_data
);
Convenience wrapper for tp_connection_unpublish_async()
on a single contact.
self |
||
callback |
a callback to call when the operation finishes |
|
user_data |
data to pass to |
Since: 0.15.5
gboolean tp_contact_unpublish_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes tp_contact_unpublish_async()
Since: 0.15.5
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.
self |
||
group |
the group to alter. |
|
callback |
a callback to call when the operation finishes |
|
user_data |
data to pass to |
Since: 0.15.5
gboolean tp_contact_add_to_group_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes tp_contact_add_to_group_async()
Since: 0.15.5
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.
self |
||
group |
the group to alter. |
|
callback |
a callback to call when the operation finishes |
|
user_data |
data to pass to |
Since: 0.15.5
gboolean tp_contact_remove_from_group_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes tp_contact_remove_from_group_async()
Since: 0.15.5
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()
.
self |
||
report_abusive |
If |
|
callback |
a callback to call when the operation finishes |
|
user_data |
data to pass to |
Since: 0.17.0
gboolean tp_contact_block_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes tp_contact_block_async()
Since: 0.17.0
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()
.
self |
||
callback |
a callback to call when the operation finishes |
|
user_data |
data to pass to |
Since: 0.17.0
gboolean tp_contact_unblock_finish (TpContact *self
,GAsyncResult *result
,GError **error
);
Finishes tp_contact_unblock_async()
Since: 0.17.0
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 TpContactFeature flags. 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.
Note that releasing a TpContact object might release handle references
held by calling tp_cli_connection_call_request_handles()
,
tp_cli_connection_run_request_handles()
,
tp_cli_connection_call_hold_handles()
,
tp_cli_connection_run_hold_handles()
,
tp_cli_connection_interface_contacts_call_get_contact_attributes()
or
tp_cli_connection_interface_contacts_run_get_contact_attributes()
directly.
Those functions should be avoided in favour of using TpContact,
tp_connection_hold_handles()
, tp_connection_request_handles()
and
tp_connection_get_contact_attributes()
.
Since: 0.7.18
Enumeration representing the features a TpContact can optionally support. When requesting a TpContact, library users specify the desired features; the TpContact code will only initialize state for those features, to avoid unwanted D-Bus round-trips and signal connections.
Since 0.11.5, there is a corresponding GEnumClass type,
TP_TYPE_CONTACT_FEATURE
.
“location” (available since 0.11.1) and “location-vardict” (since 0.19.10) |
||
“capabilities” (available since 0.11.3) |
||
“avatar-file” and
“avatar-mime-type”. Implies |
||
“contact-info” (available since 0.11.7) |
||
“client-types” (available since 0.13.1) |
||
“subscribe-state”,
“publish-state” and “publish-request”. Require a
Connection implementing the |
||
“contact-groups” (available since 0.13.14) |
||
“is-blocked”. Require
Connection implementing the |
Since: 0.7.18
#define TP_CONTACT_FEATURE_INVALID ((TpContactFeature) -1)
An invalid TpContactFeature. Used as list termination. See for example
tp_simple_client_factory_add_contact_features_varargs()
.
Since: 0.15.5
#define NUM_TP_CONTACT_FEATURES TP_NUM_CONTACT_FEATURES
1 higher than the highest TpContactFeature supported by this version of
telepathy-glib. Use TP_NUM_CONTACT_FEATURES
in new code.
Since: 0.7.18
#define TP_NUM_CONTACT_FEATURES (TP_CONTACT_FEATURE_CONTACT_BLOCKING + 1)
1 higher than the highest TpContactFeature supported by this version of telepathy-glib.
Since: 0.19.0
#define TP_TYPE_CONTACT_FEATURE (tp_contact_feature_get_type ())
The GEnumClass type of a TpContactFeature.
Since: 0.11.5
“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.
This is never NULL
for contact objects that are visible to library-user
code.
Owner: TpContact
Flags: Read
Default value: NULL
“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
.
Owner: TpContact
Flags: Read
Since: 0.11.6
“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”.
Owner: TpContact
Flags: Read
Default value: NULL
Since: 0.11.6
“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
).
Owner: TpContact
Flags: Read
Default value: NULL
“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
.
Owner: TpContact
Flags: Read
Since: 0.11.3
“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.
Owner: TpContact
Flags: Read
Since: 0.13.1
“connection”
property“connection” TpConnection *
The TpConnection to which this contact belongs.
Owner: TpContact
Flags: Read
“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.
Owner: TpContact
Flags: Read
Since: 0.13.14
“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.
Owner: TpContact
Flags: Read
Since: 0.11.7
“handle”
property “handle” guint
The contact's handle in the Telepathy D-Bus API, a handle of type
TP_HANDLE_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.
Owner: TpContact
Flags: Read
Default value: 0
“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).
This is never NULL
for contact objects that are visible to library-user
code.
Owner: TpContact
Flags: Read
Default value: NULL
“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.
Owner: TpContact
Flags: Read
Default value: FALSE
Since: 0.17.0
“location”
property “location” GHashTable_gchararray+GValue_*
If this contact has set a user-defined location, a string to
GValue * hash table containing his location. If not, NULL
.
tp_asv_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
.
Owner: TpContact
Flags: Read
Since: 0.11.1
“location-vardict”
property “location-vardict” 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
.
This property contains the same information as “location”, in a different format.
Owner: TpContact
Flags: Read
Allowed values: GVariant<a{sv}>
Default value: NULL
Since: 0.19.10
“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
.
Owner: TpContact
Flags: Read
Default value: ""
“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
.
Owner: TpContact
Flags: Read
Default value: ""
“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
.
Owner: TpContact
Flags: Read
Default value: 0
“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.
Owner: TpContact
Flags: Read
Default value: NULL
Since: 0.13.12
“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
Owner: TpContact
Flags: Read
Default value: 0
Since: 0.13.12
“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
Owner: TpContact
Flags: Read
Default value: 0
Since: 0.13.12
“contact-groups-changed”
signalvoid 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.
contact |
||
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
“presence-changed”
signalvoid user_function (TpContact *contact, guint type, gchar *status, gchar *message, gpointer user_data)
Emitted when this contact's presence changes.
contact |
||
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
“subscription-states-changed”
signalvoid user_function (TpContact *contact, guint subscribe, guint publish, gchar *publish_request, gpointer user_data)
Emitted when this contact's subscription states changes.
contact |
||
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