aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-contact.c
diff options
context:
space:
mode:
authorCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-02-24 03:32:57 +0800
committerCosimo Alfarano <cosimo.alfarano@collabora.co.uk>2010-02-26 01:26:57 +0800
commit8d4d46e440c7a6bd321fc098265db8ede27c07de (patch)
treebcdffe751459a38bd950d5424d628d831c5243a7 /libempathy/empathy-contact.c
parent8e24107b437f63d9b2ca93e0d5b7379ee87af98d (diff)
downloadgsoc2013-empathy-8d4d46e440c7a6bd321fc098265db8ede27c07de.tar
gsoc2013-empathy-8d4d46e440c7a6bd321fc098265db8ede27c07de.tar.gz
gsoc2013-empathy-8d4d46e440c7a6bd321fc098265db8ede27c07de.tar.bz2
gsoc2013-empathy-8d4d46e440c7a6bd321fc098265db8ede27c07de.tar.lz
gsoc2013-empathy-8d4d46e440c7a6bd321fc098265db8ede27c07de.tar.xz
gsoc2013-empathy-8d4d46e440c7a6bd321fc098265db8ede27c07de.tar.zst
gsoc2013-empathy-8d4d46e440c7a6bd321fc098265db8ede27c07de.zip
TPL Enabling patch, all-in-one.
By default TPL is disabled, use --enable-tpl configure option to enable it.
Diffstat (limited to 'libempathy/empathy-contact.c')
-rw-r--r--libempathy/empathy-contact.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/libempathy/empathy-contact.c b/libempathy/empathy-contact.c
index a440ef23b..feba1c0b7 100644
--- a/libempathy/empathy-contact.c
+++ b/libempathy/empathy-contact.c
@@ -27,6 +27,9 @@
#include <telepathy-glib/account-manager.h>
#include <telepathy-glib/util.h>
+#ifdef ENABEL_TPL
+#include <telepathy-logger/contact.h>
+#endif /* ENABLE_TPL */
#include "empathy-contact.h"
#include "empathy-utils.h"
@@ -408,6 +411,33 @@ empathy_contact_new (TpContact *tp_contact)
NULL);
}
+#ifdef ENABLE_TPL
+EmpathyContact *
+empathy_contact_from_tpl_contact (TpAccount *account,
+ TplContact *tpl_contact)
+{
+ EmpathyContact *retval;
+ gboolean is_user;
+
+ g_return_val_if_fail (TPL_IS_CONTACT (tpl_contact), NULL);
+
+ is_user = (TPL_CONTACT_USER == tpl_contact_get_contact_type (tpl_contact));
+
+ retval = g_object_new (EMPATHY_TYPE_CONTACT,
+ "id", tpl_contact_get_alias (tpl_contact),
+ "name", tpl_contact_get_identifier (tpl_contact),
+ "account", account,
+ "is-user", is_user,
+ NULL);
+
+ if (!EMP_STR_EMPTY (tpl_contact_get_avatar_token (tpl_contact)))
+ empathy_contact_load_avatar_cache (retval,
+ tpl_contact_get_avatar_token (tpl_contact));
+
+ return retval;
+}
+#endif /* ENABLE_TPL */
+
EmpathyContact *
empathy_contact_new_for_log (TpAccount *account,
const gchar *id,