Contact
Object Hierarchy:
TelepathyGLib.Contact
TelepathyGLib.Contact
TelepathyGLib.Contact
GLib.Object
GLib.Object
GLib.Object->TelepathyGLib.Contact
Description:
[ CCode ( type_id = "tp_contact_get_type ()" ) ] [ Version ( since = "0.7.18" ) ]public class Contact : Object
An object representing a contact on a Connection .
Contact objects support tracking a number of attributes of contacts, as described by the
ContactFeature flags. Features can be specified when instantiating contact
objects (with get_contacts_by_id or
get_contacts_by_handle ), or added to an existing contact
object with upgrade_contacts . For example, a client wishing to
keep track of a contact's alias would set ALIAS , and then listen
for the "notify::alias" signal, emitted whenever the alias property
changes.
Note that releasing a Contact 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
Contact , hold_handles ,
request_handles and
get_contact_attributes .
Content:
Properties:
public string alias { get ; }
The contact's alias if available, falling back to their
identifier if no alias is available or if the
Contact has not been set up to track
ALIAS .
public File avatar_file { get ; }
File to the latest cached avatar image,
or null
if this contact has no avatar, or if the avatar data is not yet retrieved.
public string avatar_mime_type { get ; }
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.
public string avatar_token { get ; }
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.
public Capabilities capabilities { get ; }
The capabilities supported by this contact.
public string [] client_types { get ; }
A GStrv
containing the client types of this contact.
public Connection connection { get ; }
public string [] contact_groups { get ; }
a GStrv
with names of groups of which a contact is a
member.
public ContactInfoList contact_info { owned get ; }
public uint handle { get ; }
The contact's handle in the Telepathy D-Bus API, a handle of type
CONTACT representing the string given by
identifier .
public string identifier { get ; }
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).
public bool is_blocked { get ; }
true
if the contact has been blocked.
public Variant location_vardict { owned get ; }
If this contact has set a user-defined location, a string to variant
map containing his location.
public string presence_message { get ; }
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 ).
public string presence_status { get ; }
A string representing the presence status of this contact.
public uint presence_type { get ; }
public string publish_request { get ; }
The message that contact sent when they requested permission to see
the local user's presence, if publish_state is
ASK , an empty string ("") otherwise.
public uint publish_state { get ; }
A
SubscriptionState indicating the state of this contact's subscription to the local user's presence.
public uint subscribe_state { get ; }
A
SubscriptionState indicating the state of the local user's subscription to this contact's presence.
Creation methods:
Methods:
public async bool add_to_group_async (string group) throws Error
public async bool authorize_publication_async () throws Error
public async bool block_async (bool report_abusive) throws Error
Block communications with a contact, optionally reporting the contact
as abusive to the server administrators.
public List <ContactInfoField > dup_contact_info ()
Returns a newly allocated List of contact's
vCard fields.
public Variant dup_location ()
Return the contact's user-defined location, or null
if
the location is unspecified.
public unowned Account get_account ()
public unowned string get_alias ()
Return the contact's alias.
public unowned File get_avatar_file ()
Return the contact's avatar file.
public unowned string get_avatar_mime_type ()
Return the contact's avatar MIME type.
public unowned string get_avatar_token ()
Return the contact's avatar token.
public unowned Capabilities get_capabilities ()
public unowned string [] get_client_types ()
Return the contact's client types or null
if the client
types are unspecified.
public unowned Connection get_connection ()
public unowned string [] get_contact_groups ()
Return names of groups of which a contact is a member.
public List <unowned ContactInfoField > get_contact_info ()
Returns a newly allocated List of contact's
vCard fields.
public Handle get_handle ()
Return the contact's handle, which is of type
CONTACT , or 0 if the
connection has become invalid.
public unowned string get_identifier ()
Return the contact's identifier.
public unowned HashTable <string ,Value ?> get_location ()
Return the contact's user-defined location or null
if the
location is unspecified.
public unowned string get_presence_message ()
Return the contact's user-defined status message, or an empty string.
public unowned string get_presence_status ()
Return the name of the contact's presence status, or an empty string.
public ConnectionPresenceType get_presence_type ()
If this object has been set up to track
PRESENCE and the underlying connection supports either the
Presence or SimplePresence interfaces, return the type of the contact's presence.
public unowned string get_publish_request ()
If
publish_state is set to
ASK , return the message that this remote contact sent when
they requested permission to see the local user's presence, an empty string ("") otherwise.
public SubscriptionState get_publish_state ()
Return the state of this remote contact's subscription to the local
user's presence.
public SubscriptionState get_subscribe_state ()
Return the state of the local user's subscription to this remote
contact's presence.
public bool has_feature (ContactFeature feature)
public async bool remove_async () throws Error
public async bool remove_from_group_async (string group) throws Error
public async bool request_contact_info_async (Cancellable ? cancellable) throws Error
Requests an asynchronous request of the contact info of
this .
public async bool request_subscription_async (string message) throws Error
public async bool set_contact_groups_async (string []? groups) throws Error
Add this to the given groups
(creating new groups if necessary), and remove it from all other groups.
public async bool unblock_async () throws Error
Unblock communications with a contact.
public async bool unpublish_async () throws Error
public async bool unsubscribe_async () throws Error
Signals:
public signal void contact_groups_changed (string [] added, string [] removed)
Emitted when this contact's groups changes.
public signal void presence_changed (uint type, string status, string message)
Emitted when this contact's presence changes.
public signal void subscription_states_changed (uint subscribe, uint publish, string publish_request)
Emitted when this contact's subscription states changes.
Inherited Members:
All known members inherited from class GLib.Object
@get
@new
@ref
@set
add_toggle_ref
add_weak_pointer
bind_property
connect
constructed
disconnect
dispose
dup_data
dup_qdata
force_floating
freeze_notify
get_class
get_data
get_property
get_qdata
get_type
getv
interface_find_property
interface_install_property
interface_list_properties
is_floating
new_valist
new_with_properties
newv
notify
notify_property
ref_count
ref_sink
remove_toggle_ref
remove_weak_pointer
replace_data
replace_qdata
set_data
set_data_full
set_property
set_qdata
set_qdata_full
set_valist
setv
steal_data
steal_qdata
thaw_notify
unref
watch_closure
weak_ref
weak_unref