diff mcabber/mcabber/xmpp.c @ 1896:c5ab9cf3819a

[MUC] Fix handling of empty room topic lm_message_node_get_child_value() didn't make any difference between a missing node and an empty one. With this patch it will return "" if the node exists but has no value.
author Mikael Berthe <mikael@lilotux.net>
date Mon, 12 Apr 2010 20:50:19 +0200
parents 7043542b3565
children decf94827efe
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp.c	Sun Apr 11 20:02:16 2010 +0200
+++ b/mcabber/mcabber/xmpp.c	Mon Apr 12 20:50:19 2010 +0200
@@ -1239,9 +1239,15 @@
       // Display inside the room window
       if (r == s) {
         // No specific resource (this is certainly history)
-        mbuf = g_strdup_printf("The topic has been set to: %s", subj);
+        if (*subj)
+          mbuf = g_strdup_printf("The topic has been set to: %s", subj);
+        else
+          mbuf = g_strdup_printf("The topic has been cleared");
       } else {
-        mbuf = g_strdup_printf("%s has set the topic to: %s", r, subj);
+        if (*subj)
+          mbuf = g_strdup_printf("%s has set the topic to: %s", r, subj);
+        else
+          mbuf = g_strdup_printf("%s has cleared the topic", r);
       }
       scr_WriteIncomingMessage(s, mbuf, 0,
                                HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0);