From f3601cd81e760426a6f45e080fe863fedfa843a7 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Wed, 17 Oct 2012 10:50:24 +0200 Subject: [PATCH] base-call-channel: Ignore transitions with same flags and state ... unless TP_CALL_FLAG_LOCALLY_RINGING is set. This is to accommodate tp_base_call_channel_set_ringing which turns on TP_CALL_FLAG_LOCALLY_RINGING and then calls tp_base_call_channel_set_state. Fixes: https://bugs.freedesktop.org/56044 --- telepathy-glib/base-call-channel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c index af82ba1..b76cd9a 100644 --- a/telepathy-glib/base-call-channel.c +++ b/telepathy-glib/base-call-channel.c @@ -780,10 +780,12 @@ tp_base_call_channel_set_state (TpBaseCallChannel *self, const gchar *dbus_reason, const gchar *message) { + TpCallFlags old_flags; TpCallState old_state; g_return_if_fail (TP_IS_BASE_CALL_CHANNEL (self)); + old_flags = self->priv->flags; old_state = self->priv->state; self->priv->state = state; @@ -798,6 +800,11 @@ tp_base_call_channel_set_state (TpBaseCallChannel *self, self->priv->state != TP_CALL_STATE_INITIALISED) self->priv->flags &= ~TP_CALL_FLAG_LOCALLY_QUEUED; + if (old_flags == self->priv->flags && + self->priv->flags & TP_CALL_FLAG_LOCALLY_RINGING == 0 && + old_state == state) + return; + if (tp_base_channel_is_registered (TP_BASE_CHANNEL (self))) { tp_svc_channel_type_call_emit_call_state_changed (self, self->priv->state, -- 1.7.12.1