aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-05-10 18:25:21 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-05-15 19:24:23 +0800
commit4180f9c6cb1cb97e22e8c5ca54ba1c04111f6198 (patch)
tree5c720306bf52f2c5f53c1725b0164b39a3e79896
parent7cd2e3923c1d000a9c88d9951dea9ef5772b6e0c (diff)
downloadgsoc2013-empathy-4180f9c6cb1cb97e22e8c5ca54ba1c04111f6198.tar
gsoc2013-empathy-4180f9c6cb1cb97e22e8c5ca54ba1c04111f6198.tar.gz
gsoc2013-empathy-4180f9c6cb1cb97e22e8c5ca54ba1c04111f6198.tar.bz2
gsoc2013-empathy-4180f9c6cb1cb97e22e8c5ca54ba1c04111f6198.tar.lz
gsoc2013-empathy-4180f9c6cb1cb97e22e8c5ca54ba1c04111f6198.tar.xz
gsoc2013-empathy-4180f9c6cb1cb97e22e8c5ca54ba1c04111f6198.tar.zst
gsoc2013-empathy-4180f9c6cb1cb97e22e8c5ca54ba1c04111f6198.zip
contact-widget: use empathy_client_factory_dup_contact_by_id_async()
https://bugzilla.gnome.org/show_bug.cgi?id=675597
-rw-r--r--libempathy-gtk/empathy-contact-widget.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 22e408507..5a3658cd0 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -36,10 +36,10 @@
#include <telepathy-glib/util.h>
#include <telepathy-glib/interfaces.h>
-#include <libempathy/empathy-tp-contact-factory.h>
#include <libempathy/empathy-location.h>
#include <libempathy/empathy-time.h>
#include <libempathy/empathy-utils.h>
+#include <libempathy/empathy-client-factory.h>
#include "empathy-calendar-button.h"
#include "empathy-contact-widget.h"
@@ -1492,21 +1492,29 @@ contact_widget_set_contact (EmpathyContactWidget *self,
}
static void
-contact_widget_got_contact_cb (TpConnection *connection,
- EmpathyContact *contact,
- const GError *error,
- gpointer user_data,
- GObject *weak_object)
+contact_widget_got_contact_cb (GObject *source,
+ GAsyncResult *result,
+ gpointer user_data)
{
EmpathyContactWidget *self = user_data;
+ GError *error = NULL;
+ EmpathyContact *contact;
+
+ contact = empathy_client_factory_dup_contact_by_id_finish (
+ EMPATHY_CLIENT_FACTORY (source), result, &error);
- if (error != NULL)
+ if (contact == NULL)
{
DEBUG ("Error: %s", error->message);
- return;
+ g_error_free (error);
+ goto out;
}
contact_widget_set_contact (self, contact);
+
+ g_object_unref (contact);
+out:
+ g_object_unref (self);
}
static void
@@ -1526,9 +1534,14 @@ contact_widget_change_contact (EmpathyContactWidget *self)
id = gtk_entry_get_text (GTK_ENTRY (self->priv->widget_id));
if (!EMP_STR_EMPTY (id))
{
- empathy_tp_contact_factory_get_from_id (connection, id,
- contact_widget_got_contact_cb, self, NULL,
- G_OBJECT (self));
+ EmpathyClientFactory *factory;
+
+ factory = empathy_client_factory_dup ();
+
+ empathy_client_factory_dup_contact_by_id_async (factory, connection,
+ id, contact_widget_got_contact_cb, g_object_ref (self));
+
+ g_object_unref (factory);
}
}
else