From 9cb83957db187a8027f369640e0c61404fb10fdc Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 17 Oct 2012 14:48:11 +0200 Subject: [PATCH 2/2] base-call-channel: Don't call set_state from set_ringing and set_queued ... because they only change the flags and not the state. Instead emit CallStateChanged directly. Fixes: https://bugs.freedesktop.org/56044 --- telepathy-glib/base-call-channel.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c index 825c42f..0fb7027 100644 --- a/telepathy-glib/base-call-channel.c +++ b/telepathy-glib/base-call-channel.c @@ -754,6 +754,25 @@ call_state_to_string (TpCallState state) return state_str; } +static void +tp_base_call_channel_flags_changed (TpBaseCallChannel *self, + guint actor_handle, + TpCallStateChangeReason reason, + const gchar *dbus_reason, + const gchar *message) +{ + g_value_array_free (self->priv->reason); + self->priv->reason = _tp_base_call_state_reason_new (actor_handle, reason, + dbus_reason, message); + + if (tp_base_channel_is_registered (TP_BASE_CHANNEL (self))) + { + tp_svc_channel_type_call_emit_call_state_changed (self, + self->priv->state, self->priv->flags, self->priv->reason, + self->priv->details); + } +} + /** * tp_base_call_channel_set_state: * @self: a #TpBaseCallChannel @@ -1292,7 +1311,7 @@ tp_base_call_channel_set_ringing (TpSvcChannelTypeCall *iface, self->priv->flags |= TP_CALL_FLAG_LOCALLY_RINGING; self->priv->flags &= ~TP_CALL_FLAG_LOCALLY_QUEUED; - tp_base_call_channel_set_state (self, self->priv->state, + tp_base_call_channel_flags_changed (self, tp_base_channel_get_self_handle ((TpBaseChannel *) self), TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "Local client has started ringing"); @@ -1333,7 +1352,7 @@ tp_base_call_channel_set_queued (TpSvcChannelTypeCall *iface, klass->set_queued (self); self->priv->flags |= TP_CALL_FLAG_LOCALLY_QUEUED; - tp_base_call_channel_set_state (self, self->priv->state, + tp_base_call_channel_flags_changed (self, tp_base_channel_get_self_handle ((TpBaseChannel *) self), TP_CALL_STATE_CHANGE_REASON_PROGRESS_MADE, "", "Local client has queued the call"); -- 1.7.12.1