]> git.0d.be Git - empathy.git/commitdiff
Disconnect when a call is ENDED
authorEmanuele Aina <emanuele.aina@collabora.com>
Tue, 13 Mar 2012 14:55:08 +0000 (15:55 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 15 Mar 2012 15:16:47 +0000 (16:16 +0100)
If for some unspecified reason a call go to the TP_CALL_STATE_ENDED
state, reinitialize the call window.

https://bugzilla.gnome.org/show_bug.cgi?id=671931

src/empathy-call-window.c

index 565c65d002998cf4e3dd5ff39ff003aa831c4005..9b057c0ef2e4378b2e833bba0c05c402557504b9 100644 (file)
@@ -3182,10 +3182,12 @@ empathy_call_window_state_changed_cb (EmpathyCallHandler *handler,
   TpCallChannel *call;
   gboolean can_send_video;
 
-  if (state == TP_CALL_STATE_ENDED &&
-      !tp_strdiff (reason, TP_ERROR_STR_INSUFFICIENT_BALANCE))
+  if (state == TP_CALL_STATE_ENDED)
     {
-      show_balance_error (self);
+      DEBUG ("Call ended: %s", (reason != NULL && reason[0] != '\0') ? reason : "unspecified reason");
+      empathy_call_window_disconnected (self, TRUE);
+      if (!tp_strdiff (reason, TP_ERROR_STR_INSUFFICIENT_BALANCE))
+          show_balance_error (self);
       return;
     }
 
@@ -3982,9 +3984,10 @@ static void
 empathy_call_window_hangup_cb (gpointer object,
     EmpathyCallWindow *self)
 {
+  /* stopping the call will put it the ENDED state and
+   * from state_changed_cb we'll reconfigure the window
+   */
   empathy_call_handler_stop_call (self->priv->handler);
-
-  empathy_call_window_disconnected (self, TRUE);
 }
 
 static void