aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-utils.c
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-05-29 07:13:51 +0800
committerTravis Reitter <treitter@gmail.com>2010-07-21 07:12:35 +0800
commitd6aa2f99e3e626f81b455c0fa1ff4817a4e4f2f6 (patch)
tree3db6a726bcc50a3423f601b7975d7abb166cb9a1 /libempathy/empathy-utils.c
parent57a1f36eaec69df0195e90d8a4b050574a19d6b3 (diff)
downloadgsoc2013-empathy-d6aa2f99e3e626f81b455c0fa1ff4817a4e4f2f6.tar
gsoc2013-empathy-d6aa2f99e3e626f81b455c0fa1ff4817a4e4f2f6.tar.gz
gsoc2013-empathy-d6aa2f99e3e626f81b455c0fa1ff4817a4e4f2f6.tar.bz2
gsoc2013-empathy-d6aa2f99e3e626f81b455c0fa1ff4817a4e4f2f6.tar.lz
gsoc2013-empathy-d6aa2f99e3e626f81b455c0fa1ff4817a4e4f2f6.tar.xz
gsoc2013-empathy-d6aa2f99e3e626f81b455c0fa1ff4817a4e4f2f6.tar.zst
gsoc2013-empathy-d6aa2f99e3e626f81b455c0fa1ff4817a4e4f2f6.zip
Base the contact list around libfolks metacontacts. Not yet to feature-parity
with mainline Empathy.
Diffstat (limited to 'libempathy/empathy-utils.c')
-rw-r--r--libempathy/empathy-utils.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 1c2d95b09..56da323b9 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -32,6 +32,9 @@
#include <libxml/uri.h>
+#include <folks/folks.h>
+#include <folks/folks-telepathy.h>
+
#include <telepathy-glib/account-manager.h>
#include <telepathy-glib/connection.h>
#include <telepathy-glib/channel.h>
@@ -44,6 +47,7 @@
#include "empathy-dispatch-operation.h"
#include "empathy-idle.h"
#include "empathy-tp-call.h"
+#include "empathy-tp-contact-factory.h"
#include <extensions/extensions.h>
@@ -558,3 +562,34 @@ empathy_connect_new_account (TpAccount *account,
break;
}
}
+
+TpConnectionPresenceType
+empathy_folks_presence_type_to_tp (FolksPresenceType type)
+{
+ return (TpConnectionPresenceType) type;
+}
+
+EmpathyContact *
+empathy_contact_from_folks_individual (FolksIndividual *individual)
+{
+ GList *personas, *l;
+ EmpathyContact *contact = NULL;
+
+ g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL);
+
+ personas = folks_individual_get_personas (individual);
+ for (l = personas; (l != NULL) && (contact == NULL); l = l->next)
+ {
+ TpfPersona *persona = l->data;
+
+ if (TPF_IS_PERSONA (persona))
+ {
+ TpContact *tp_contact;
+
+ tp_contact = tpf_persona_get_contact (persona);
+ contact = empathy_contact_dup_from_tp_contact (tp_contact);
+ }
+ }
+
+ return contact;
+}