[Telepathy-commits] [telepathy-glib/master] Include details['error'] in channel::invalidated

Will Thompson will.thompson at collabora.co.uk
Tue Jan 6 11:35:04 PST 2009


---
 telepathy-glib/channel-group.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/telepathy-glib/channel-group.c b/telepathy-glib/channel-group.c
index a52e748..18c3957 100644
--- a/telepathy-glib/channel-group.c
+++ b/telepathy-glib/channel-group.c
@@ -848,10 +848,20 @@ handle_members_changed (TpChannel *self,
 
       if (handle == self->priv->group_self_handle)
         {
+          const gchar *error_detail = tp_asv_get_string (details, "error");
+
           self->priv->group_remove_reason = reason;
           g_free (self->priv->group_remove_message);
-          self->priv->group_remove_message = g_strdup (message);
+
+          /* If there's an error detail and a message, "$error: $message", else
+           * just the non-empty one (or indeed the empty string).
+           */
+          self->priv->group_remove_message = g_strdup_printf ("%s%s%s",
+              (error_detail != NULL ? error_detail : ""),
+              (error_detail != NULL && message[0] != '\0' ? ": " : ""),
+              message);
         }
+
       /* FIXME: should check against the Connection's self-handle too,
        * after I add that API */
     }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list