From d7a93aa6fd67383c1aff9a1e8ead5cb20bcde388 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 11 Mar 2008 12:22:25 +0000 Subject: simplify empathy_call_with_contact_id using empathy_contact_run_until_ready svn path=/trunk/; revision=750 --- libempathy/empathy-utils.c | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) (limited to 'libempathy/empathy-utils.c') diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index 2bc107455..f54f4193f 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -465,22 +465,6 @@ empathy_call_with_contact (EmpathyContact *contact) #endif } -#ifdef HAVE_VOIP -static void -got_handle_cb (EmpathyContact *contact, - GParamSpec *property, - EmpathyContactFactory *factory) -{ - g_signal_handlers_disconnect_by_func (contact, - got_handle_cb, - factory); - - empathy_call_with_contact (contact); - g_object_unref (factory); - g_object_unref (contact); -} -#endif - void empathy_call_with_contact_id (McAccount *account, const gchar *contact_id) { @@ -490,16 +474,12 @@ empathy_call_with_contact_id (McAccount *account, const gchar *contact_id) factory = empathy_contact_factory_new (); contact = empathy_contact_factory_get_from_id (factory, account, contact_id); + empathy_contact_run_until_ready (contact, EMPATHY_CONTACT_READY_HANDLE, NULL); - if (empathy_contact_get_handle (contact) != 0) { - empathy_call_with_contact (contact); - g_object_unref (contact); - g_object_unref (factory); - } else { - g_signal_connect (contact, "notify::handle", - G_CALLBACK (got_handle_cb), - factory); - } + empathy_call_with_contact (contact); + + g_object_unref (contact); + g_object_unref (factory); #endif } -- cgit v1.2.3