From 0782268f203de61956dfc96d9211ebd48cf722bb Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Tue, 16 Oct 2012 20:33:37 +0200 Subject: [PATCH] base-call-channel: Set state to ENDED in hangup only if not set This avoids an extra CallStateChanged signal from being emitted if the implementation of the hangup virtual method already set the state to ENDED. Fixes: https://bugs.freedesktop.org/56044 --- telepathy-glib/base-call-channel.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c index af82ba1..055c006 100644 --- a/telepathy-glib/base-call-channel.c +++ b/telepathy-glib/base-call-channel.c @@ -1438,9 +1438,13 @@ tp_base_call_channel_hangup (TpSvcChannelTypeCall *iface, if (klass->hangup != NULL) klass->hangup (self, reason, detailed_reason, message); - tp_base_call_channel_set_state (self, TP_CALL_STATE_ENDED, - tp_base_channel_get_self_handle (tp_base), - reason, detailed_reason, message); + if (tp_base_call_channel_get_state (TP_BASE_CALL_CHANNEL (self)) != + TP_CALL_STATE_ENDED) + { + tp_base_call_channel_set_state (self, TP_CALL_STATE_ENDED, + tp_base_channel_get_self_handle (tp_base), + reason, detailed_reason, message); + } tp_svc_channel_type_call_return_from_hangup (context); } -- 1.7.12.1