telepathy-glib: base-call-channel: Ignore transitions with the same state

Simon McVittie smcv at kemper.freedesktop.org
Thu Jan 3 10:22:38 PST 2013


Module: telepathy-glib
Branch: master
Commit: fd0448c174cfd169f297a8e3e306319806c4c074
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=fd0448c174cfd169f297a8e3e306319806c4c074

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