[empathy] Don't restart a call if one already in progress



commit 1e03889e1c6994166f73e83d531103ed5f02ae55
Author: Emanuele Aina <emanuele aina collabora com>
Date:   Thu Mar 15 12:41:11 2012 +0100

    Don't restart a call if one already in progress
    
    Fixes the crash when calling someone while being already in a call
    with the same contact.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671931

 src/empathy-call-window.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 9b057c0..565b9ed 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -2420,12 +2420,17 @@ empathy_call_window_present (EmpathyCallWindow *self,
 {
   g_return_if_fail (EMPATHY_IS_CALL_HANDLER (handler));
 
-  tp_clear_object (&self->priv->handler);
-  self->priv->handler = g_object_ref (handler);
-  empathy_call_window_connect_handler (self);
-
   empathy_window_present (GTK_WINDOW (self));
-  empathy_call_window_restart_call (self);
+
+  if (self->priv->call_state == DISCONNECTED)
+    {
+      /* start a new call if one is not already in progress */
+      tp_clear_object (&self->priv->handler);
+      self->priv->handler = g_object_ref (handler);
+      empathy_call_window_connect_handler (self);
+
+      empathy_call_window_restart_call (self);
+    }
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]