aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-utils.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-02-16 05:29:18 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-02-16 05:29:18 +0800
commitfefd48ada4f353f364ff7ea1d1bf661a7e84180d (patch)
tree5bb1a9607d6dd7465007e1c586ed257f45197ce8 /libempathy/empathy-utils.c
parent4a1cece4951911afba0456ee23730328f635d1b3 (diff)
downloadgsoc2013-empathy-fefd48ada4f353f364ff7ea1d1bf661a7e84180d.tar
gsoc2013-empathy-fefd48ada4f353f364ff7ea1d1bf661a7e84180d.tar.gz
gsoc2013-empathy-fefd48ada4f353f364ff7ea1d1bf661a7e84180d.tar.bz2
gsoc2013-empathy-fefd48ada4f353f364ff7ea1d1bf661a7e84180d.tar.lz
gsoc2013-empathy-fefd48ada4f353f364ff7ea1d1bf661a7e84180d.tar.xz
gsoc2013-empathy-fefd48ada4f353f364ff7ea1d1bf661a7e84180d.tar.zst
gsoc2013-empathy-fefd48ada4f353f364ff7ea1d1bf661a7e84180d.zip
Merge commit 'sjoerd/master'
svn path=/trunk/; revision=635
Diffstat (limited to 'libempathy/empathy-utils.c')
-rw-r--r--libempathy/empathy-utils.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 070e45a0e..7548c58fb 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -463,6 +463,28 @@ empathy_call_with_contact (EmpathyContact *contact)
#endif
}
+#ifdef HAVE_VOIP
+struct empathy_call_cb_user_data {
+ guint handler;
+ GObject *factory;
+};
+
+static void
+empathy_call_with_contact_id_got_handle_cb (EmpathyContact *contact,
+ GParamSpec *property, gpointer user_data) {
+
+ struct empathy_call_cb_user_data *ud =
+ (struct empathy_call_cb_user_data *) user_data;
+
+ g_signal_handler_disconnect (contact, ud->handler);
+
+ empathy_call_with_contact (contact);
+ g_object_unref (ud->factory);
+ g_object_unref (contact);
+ g_free (ud);
+}
+#endif
+
void
empathy_call_with_contact_id (McAccount *account, const gchar *contact_id)
{
@@ -472,9 +494,19 @@ 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_call_with_contact (contact);
- g_object_unref (contact);
- g_object_unref (factory);
+
+ if (empathy_contact_get_handle (contact) != 0) {
+ empathy_call_with_contact (contact);
+ g_object_unref (contact);
+ g_object_unref (factory);
+ } else {
+ struct empathy_call_cb_user_data *ud;
+ ud = g_malloc0 (sizeof (struct empathy_call_cb_user_data));
+ ud->factory = G_OBJECT (factory);
+ ud->handler = g_signal_connect (G_OBJECT (contact), "notify::handle",
+ G_CALLBACK (empathy_call_with_contact_id_got_handle_cb), ud);
+ }
+
#endif
}