From 1146d93912bb4374bf2b391e71584bcef1da3df6 Mon Sep 17 00:00:00 2001 From: Emanuele Aina Date: Tue, 13 Mar 2012 15:55:08 +0100 Subject: Disconnect when a call is ENDED 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 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/empathy-call-window.c') diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 565c65d00..9b057c0ef 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -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 -- cgit v1.2.3