aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-12-09 17:51:13 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-12-14 17:52:33 +0800
commiteebfb2b90332782fc3ff79386e9a4808d277337b (patch)
treedb6feeac748f8e828ccda3a5274dd23bfa571b6c
parent7f9f986f3e2600fec111ebbd2302d24eb65c60f7 (diff)
downloadgsoc2013-empathy-eebfb2b90332782fc3ff79386e9a4808d277337b.tar
gsoc2013-empathy-eebfb2b90332782fc3ff79386e9a4808d277337b.tar.gz
gsoc2013-empathy-eebfb2b90332782fc3ff79386e9a4808d277337b.tar.bz2
gsoc2013-empathy-eebfb2b90332782fc3ff79386e9a4808d277337b.tar.lz
gsoc2013-empathy-eebfb2b90332782fc3ff79386e9a4808d277337b.tar.xz
gsoc2013-empathy-eebfb2b90332782fc3ff79386e9a4808d277337b.tar.zst
gsoc2013-empathy-eebfb2b90332782fc3ff79386e9a4808d277337b.zip
use tpf_persona_dup_for_contact()
https://bugzilla.gnome.org/show_bug.cgi?id=665853
-rw-r--r--libempathy/empathy-utils.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 972abe65e..c5016c235 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -1167,31 +1167,28 @@ empathy_sasl_channel_supports_mechanism (TpChannel *channel,
FolksIndividual *
empathy_create_individual_from_tp_contact (TpContact *contact)
{
- TpAccount *account;
- TpConnection *connection;
- TpfPersonaStore *store;
GeeSet *personas;
TpfPersona *persona;
FolksIndividual *individual;
- connection = tp_contact_get_connection (contact);
- account = tp_connection_get_account (connection);
-
- store = tpf_persona_store_new (account);
+ persona = tpf_persona_dup_for_contact (contact);
+ if (persona == NULL)
+ {
+ DEBUG ("Failed to get a persona for %s",
+ tp_contact_get_identifier (contact));
+ return NULL;
+ }
personas = GEE_SET (
gee_hash_set_new (FOLKS_TYPE_PERSONA, g_object_ref, g_object_unref,
g_direct_hash, g_direct_equal));
- persona = tpf_persona_new (contact, store);
-
gee_collection_add (GEE_COLLECTION (personas), persona);
individual = folks_individual_new (personas);
g_clear_object (&persona);
g_clear_object (&personas);
- g_object_unref (store);
return individual;
}