[Telepathy-commits] [telepathy-glib/master] Ensure all group flags are printed in mixin's debug output

Will Thompson will.thompson at collabora.co.uk
Tue Jan 6 07:30:47 PST 2009


The stringification code has a case for the first eight members of the
TpChannelGroupFlags enum, but didn't do anything with any unhandled
flags.
---
 telepathy-glib/group-mixin.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/telepathy-glib/group-mixin.c b/telepathy-glib/group-mixin.c
index 2025d1c..7bb2980 100644
--- a/telepathy-glib/group-mixin.c
+++ b/telepathy-glib/group-mixin.c
@@ -1100,6 +1100,7 @@ tp_group_mixin_get_handle_owners_async (TpSvcChannelInterfaceGroup *obj,
       if (i++ > 0) \
         g_string_append (str, "|"); \
       g_string_append (str, #flag + 22); \
+      flags &= ~flag; \
     }
 
 static gchar *
@@ -1119,6 +1120,17 @@ group_flags_to_string (TpChannelGroupFlags flags)
   GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_MESSAGE_REJECT);
   GFTS_APPEND_FLAG_IF_SET (TP_CHANNEL_GROUP_FLAG_MESSAGE_RESCIND);
 
+  /* Print out any remaining flags that weren't removed in the above cases
+   * numerically.
+   */
+  if (flags != 0)
+    {
+      if (i > 0)
+        g_string_append (str, "|");
+
+      g_string_append_printf (str, "%u", flags);
+    }
+
   g_string_append (str, TP_ANSI_BOLD_ON "]");
 
   return g_string_free (str, FALSE);
-- 
1.5.6.5




More information about the Telepathy-commits mailing list