aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-04 20:45:38 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-11-24 19:28:44 +0800
commitef0d55ead126f53aa4544877d2df5ab712f00f28 (patch)
tree42dc29e21fd21344e89cf1806dae16b2e2e8196a /libempathy-gtk
parentedf88058847eb77f8ecc1e5b37fa76e7db9f7ad3 (diff)
downloadgsoc2013-empathy-ef0d55ead126f53aa4544877d2df5ab712f00f28.tar
gsoc2013-empathy-ef0d55ead126f53aa4544877d2df5ab712f00f28.tar.gz
gsoc2013-empathy-ef0d55ead126f53aa4544877d2df5ab712f00f28.tar.bz2
gsoc2013-empathy-ef0d55ead126f53aa4544877d2df5ab712f00f28.tar.lz
gsoc2013-empathy-ef0d55ead126f53aa4544877d2df5ab712f00f28.tar.xz
gsoc2013-empathy-ef0d55ead126f53aa4544877d2df5ab712f00f28.tar.zst
gsoc2013-empathy-ef0d55ead126f53aa4544877d2df5ab712f00f28.zip
factor out empathy_create_individual_from_tp_contact()
https://bugzilla.gnome.org/show_bug.cgi?id=663387
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-chooser.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/libempathy-gtk/empathy-contact-chooser.c b/libempathy-gtk/empathy-contact-chooser.c
index 6d93e6813..cba419bea 100644
--- a/libempathy-gtk/empathy-contact-chooser.c
+++ b/libempathy-gtk/empathy-contact-chooser.c
@@ -14,6 +14,8 @@
#include "empathy-contact-chooser.h"
+#include <libempathy/empathy-utils.h>
+
#include <libempathy-gtk/empathy-individual-store-manager.h>
#include <libempathy-gtk/empathy-individual-view.h>
#include <libempathy-gtk/empathy-ui-utils.h>
@@ -209,11 +211,7 @@ get_contacts_cb (TpConnection *connection,
EmpathyContactChooser *self =
(EmpathyContactChooser *) weak_object;
AddTemporaryIndividualCtx *ctx = user_data;
- TpAccount *account;
- TpfPersonaStore *store;
FolksIndividual *individual;
- TpfPersona *persona;
- GeeSet *personas;
if (self->priv->add_temp_ctx != ctx)
/* another request has been started */
@@ -222,18 +220,7 @@ get_contacts_cb (TpConnection *connection,
if (n_contacts != 1)
return;
- account = tp_connection_get_account (connection);
-
- store = tpf_persona_store_new (account);
- 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 (contacts[0], store);
-
- gee_collection_add (GEE_COLLECTION (personas), persona);
-
- individual = folks_individual_new (personas);
+ individual = empathy_create_individual_from_tp_contact (contacts[0]);
/* listen for updates to the capabilities */
tp_g_signal_connect_object (contacts[0], "notify::capabilities",
@@ -249,10 +236,6 @@ get_contacts_cb (TpConnection *connection,
gtk_tree_view_get_selection (GTK_TREE_VIEW (self->priv->view)),
NULL, NULL))
empathy_individual_view_select_first (self->priv->view);
-
- g_clear_object (&persona);
- g_clear_object (&personas);
- g_object_unref (store);
}
static void