comparison 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
comparison
equal deleted inserted replaced
1895:7043542b3565 1896:c5ab9cf3819a
1237 if (roombuddy) 1237 if (roombuddy)
1238 buddy_settopic(roombuddy->data, subj); 1238 buddy_settopic(roombuddy->data, subj);
1239 // Display inside the room window 1239 // Display inside the room window
1240 if (r == s) { 1240 if (r == s) {
1241 // No specific resource (this is certainly history) 1241 // No specific resource (this is certainly history)
1242 mbuf = g_strdup_printf("The topic has been set to: %s", subj); 1242 if (*subj)
1243 mbuf = g_strdup_printf("The topic has been set to: %s", subj);
1244 else
1245 mbuf = g_strdup_printf("The topic has been cleared");
1243 } else { 1246 } else {
1244 mbuf = g_strdup_printf("%s has set the topic to: %s", r, subj); 1247 if (*subj)
1248 mbuf = g_strdup_printf("%s has set the topic to: %s", r, subj);
1249 else
1250 mbuf = g_strdup_printf("%s has cleared the topic", r);
1245 } 1251 }
1246 scr_WriteIncomingMessage(s, mbuf, 0, 1252 scr_WriteIncomingMessage(s, mbuf, 0,
1247 HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); 1253 HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0);
1248 if (settings_opt_get_int("log_muc_conf")) 1254 if (settings_opt_get_int("log_muc_conf"))
1249 hlog_write_message(s, 0, -1, mbuf); 1255 hlog_write_message(s, 0, -1, mbuf);