[next] telepathy-glib: base-call-channel: Don' t call set_state from set_ringing and set_queued

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


Module: telepathy-glib
Branch: next
Commit: 1dcb667751898544efad73b8e42d91ff58119e0d
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=1dcb667751898544efad73b8e42d91ff58119e0d

Author: Debarshi Ray <rishi at gnu.org>
Date:   Wed Oct 17 14:48:11 2012 +0200

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 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/telepathy-glib/base-call-channel.c b/telepathy-glib/base-call-channel.c
index 6b994a6..045a2b3 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
@@ -1290,7 +1309,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");
@@ -1331,7 +1350,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");



More information about the telepathy-commits mailing list