[next] telepathy-glib: tp_base_connection_change_status: emit status-changed before StatusChanged

Simon McVittie smcv at kemper.freedesktop.org
Wed May 7 02:18:22 PDT 2014


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

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Fri Apr 11 12:56:29 2014 +0100

tp_base_connection_change_status: emit status-changed before StatusChanged

Gabble's regression tests expect to receive PresencesChanged before
StatusChanged, and PresencesChanged is triggered by the status-changed
GObject signal.

Reviewed-by: Xavier Claessens <xavier.claessens at collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77189

---

 telepathy-glib/base-connection.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 2e85e64..7c02a7c 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -1939,9 +1939,12 @@ tp_base_connection_change_status (TpBaseConnection *self,
 
   DEBUG("emitting status-changed to %u, for reason %u", status, reason);
   _tp_gdbus_connection_set_status (self->priv->connection_skeleton, status);
+  /* Emit status-changed before sending the D-Bus signal, because in practice
+   * that's what happened in telepathy-glib 0.x, as demonstrated by Gabble's
+   * regression tests failing otherwise. */
+  g_signal_emit (self, signals[STATUS_CHANGED], 0, status, reason);
   _tp_gdbus_connection_emit_status_changed (self->priv->connection_skeleton,
       status, reason);
-  g_signal_emit (self, signals[STATUS_CHANGED], 0, status, reason);
 
   /* tell subclass about the state change. In the case of
    * disconnection, shut down afterwards */



More information about the telepathy-commits mailing list