aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-widget.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2009-03-18 08:28:03 +0800
committerXavier Claessens <xclaesse@gmail.com>2009-04-22 18:21:14 +0800
commit7761eeb4a0e307c14a96906cca1a94346f39c3a6 (patch)
treea0cf285000890c0633bdc1031bddcb73f9b952d5 /libempathy-gtk/empathy-contact-widget.c
parent2914c6d76ae6a76e551ccaad01bc9edf2f375d08 (diff)
downloadgsoc2013-empathy-7761eeb4a0e307c14a96906cca1a94346f39c3a6.tar
gsoc2013-empathy-7761eeb4a0e307c14a96906cca1a94346f39c3a6.tar.gz
gsoc2013-empathy-7761eeb4a0e307c14a96906cca1a94346f39c3a6.tar.bz2
gsoc2013-empathy-7761eeb4a0e307c14a96906cca1a94346f39c3a6.tar.lz
gsoc2013-empathy-7761eeb4a0e307c14a96906cca1a94346f39c3a6.tar.xz
gsoc2013-empathy-7761eeb4a0e307c14a96906cca1a94346f39c3a6.tar.zst
gsoc2013-empathy-7761eeb4a0e307c14a96906cca1a94346f39c3a6.zip
Use tp_connection_get_self_handle where needed
Diffstat (limited to 'libempathy-gtk/empathy-contact-widget.c')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c36
1 files changed, 7 insertions, 29 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 18d7f415a..e8ddc01a2 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -707,30 +707,9 @@ contact_widget_got_contact_cb (EmpathyTpContactFactory *factory,
}
static void
-contact_widget_get_self_handle_cb (TpConnection *connection,
- TpHandle self_handle,
- const GError *error,
- gpointer information,
- GObject *weak_object)
-{
- EmpathyTpContactFactory *factory;
-
- if (error != NULL)
- {
- DEBUG ("Error: %s", error->message);
- return;
- }
-
- factory = empathy_tp_contact_factory_dup_singleton (connection);
- empathy_tp_contact_factory_get_from_handle (factory, self_handle,
- contact_widget_got_contact_cb, information, NULL,
- weak_object);
- g_object_unref (factory);
-}
-
-static void
contact_widget_change_contact (EmpathyContactWidget *information)
{
+ EmpathyTpContactFactory *factory;
TpConnection *connection;
connection = empathy_account_chooser_get_connection (
@@ -738,6 +717,7 @@ contact_widget_change_contact (EmpathyContactWidget *information)
if (!connection)
return;
+ factory = empathy_tp_contact_factory_dup_singleton (connection);
if (information->flags & EMPATHY_CONTACT_WIDGET_EDIT_ID)
{
const gchar *id;
@@ -745,22 +725,20 @@ contact_widget_change_contact (EmpathyContactWidget *information)
id = gtk_entry_get_text (GTK_ENTRY (information->widget_id));
if (!EMP_STR_EMPTY (id))
{
- EmpathyTpContactFactory *factory;
-
- factory = empathy_tp_contact_factory_dup_singleton (connection);
empathy_tp_contact_factory_get_from_id (factory, id,
contact_widget_got_contact_cb, information, NULL,
G_OBJECT (information->vbox_contact_widget));
- g_object_unref (factory);
}
}
else
{
- /* FIXME: TpConnection should have a SelfHandle property */
- tp_cli_connection_call_get_self_handle (connection, -1,
- contact_widget_get_self_handle_cb, information, NULL,
+ empathy_tp_contact_factory_get_from_handle (factory,
+ tp_connection_get_self_handle (connection),
+ contact_widget_got_contact_cb, information, NULL,
G_OBJECT (information->vbox_contact_widget));
}
+
+ g_object_unref (factory);
}
static void