[next] telepathy-glib: base-call-channel: Ignore transitions with the same state
Xavier Claessens
xclaesse at kemper.freedesktop.org
Wed Dec 26 01:08:11 PST 2012
Module: telepathy-glib
Branch: next
Commit: dfca38a93e2c504c1a4643eec291c4ddb4368f4f
URL: http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=dfca38a93e2c504c1a4643eec291c4ddb4368f4f
Author: Debarshi Ray <rishi at gnu.org>
Date: Wed Oct 17 10:50:24 2012 +0200
base-call-channel: Ignore transitions with the same state
Fixes: https://bugs.freedesktop.org/56044
---
telepathy-glib/base-call-channel.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c
index af82ba1..6b994a6 100644
--- a/telepathy-glib/base-call-channel.c
+++ b/telepathy-glib/base-call-channel.c
@@ -791,6 +791,9 @@ tp_base_call_channel_set_state (TpBaseCallChannel *self,
self->priv->reason = _tp_base_call_state_reason_new (actor_handle, reason,
dbus_reason, message);
+ if (old_state == state)
+ return;
+
if (self->priv->state != TP_CALL_STATE_INITIALISED)
self->priv->flags &= ~TP_CALL_FLAG_LOCALLY_RINGING;
@@ -809,8 +812,7 @@ tp_base_call_channel_set_state (TpBaseCallChannel *self,
call_state_to_string (self->priv->state));
/* Move from INITIALISING to INITIALISED if we are already connected */
- if (self->priv->state != old_state &&
- self->priv->state == TP_CALL_STATE_INITIALISING &&
+ if (self->priv->state == TP_CALL_STATE_INITIALISING &&
_tp_base_call_channel_is_connected (self))
{
self->priv->state = TP_CALL_STATE_INITIALISED;
@@ -827,8 +829,7 @@ tp_base_call_channel_set_state (TpBaseCallChannel *self,
}
/* Move from ACCEPTED to ACTIVE if we are already connected */
- if (self->priv->state != old_state &&
- self->priv->state == TP_CALL_STATE_ACCEPTED &&
+ if (self->priv->state == TP_CALL_STATE_ACCEPTED &&
_tp_base_call_channel_is_connected (self))
{
self->priv->state = TP_CALL_STATE_ACTIVE;
More information about the telepathy-commits
mailing list