[next] telepathy-glib: Add tp_contact_get_account()

Simon McVittie smcv at kemper.freedesktop.org
Wed Apr 25 07:26:04 PDT 2012


Module: telepathy-glib
Branch: next
Commit: 299785c6addba3d40c35a4caa9cf479b2905bf92
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=299785c6addba3d40c35a4caa9cf479b2905bf92

Author: Xavier Claessens <xavier.claessens at collabora.co.uk>
Date:   Wed Feb  8 14:37:01 2012 +0100

Add tp_contact_get_account()

---

 docs/reference/telepathy-glib-sections.txt |    1 +
 telepathy-glib/contact.c                   |   22 +++++++++++++++++++++-
 telepathy-glib/contact.h                   |    1 +
 3 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/docs/reference/telepathy-glib-sections.txt b/docs/reference/telepathy-glib-sections.txt
index 1f42fca..0e1f950 100644
--- a/docs/reference/telepathy-glib-sections.txt
+++ b/docs/reference/telepathy-glib-sections.txt
@@ -4927,6 +4927,7 @@ tp_contact_get_avatar_token
 tp_contact_get_avatar_file
 tp_contact_get_avatar_mime_type
 tp_contact_get_client_types
+tp_contact_get_account
 tp_contact_get_connection
 tp_contact_get_handle
 tp_contact_get_identifier
diff --git a/telepathy-glib/contact.c b/telepathy-glib/contact.c
index da74b15..367cb40 100644
--- a/telepathy-glib/contact.c
+++ b/telepathy-glib/contact.c
@@ -259,6 +259,27 @@ struct _TpContactPrivate {
 
 
 /**
+ * tp_contact_get_account:
+ * @self: a contact
+ *
+ * Return the #TpAccount of @self's #TpContact:connection.
+ * See tp_connection_get_account() for details.
+ *
+ * Returns: (transfer none): a borrowed reference to @self's account
+ *  (it must be referenced with g_object_ref if it must remain valid
+ *  longer than the contact)
+ *
+ * Since: 0.UNRELEASED
+ */
+TpAccount *
+tp_contact_get_account (TpContact *self)
+{
+  g_return_val_if_fail (TP_IS_CONTACT (self), NULL);
+
+  return tp_connection_get_account (self->priv->connection);
+}
+
+/**
  * tp_contact_get_connection:
  * @self: a contact
  *
@@ -278,7 +299,6 @@ tp_contact_get_connection (TpContact *self)
   return self->priv->connection;
 }
 
-
 /**
  * tp_contact_get_handle:
  * @self: a contact
diff --git a/telepathy-glib/contact.h b/telepathy-glib/contact.h
index 1a91a2d..f1dc7b6 100644
--- a/telepathy-glib/contact.h
+++ b/telepathy-glib/contact.h
@@ -72,6 +72,7 @@ typedef enum {
 #define TP_CONTACT_FEATURE_INVALID ((TpContactFeature) -1)
 
 /* Basic functionality, always available */
+TpAccount *tp_contact_get_account (TpContact *self);
 TpConnection *tp_contact_get_connection (TpContact *self);
 TpHandle tp_contact_get_handle (TpContact *self);
 const gchar *tp_contact_get_identifier (TpContact *self);



More information about the telepathy-commits mailing list