Mercurial > ~mikael > mcabber > hg
diff mcabber/mcabber/xmpp_helper.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 | 189c2a5a4e66 |
children | 84bb3e893586 |
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp_helper.c Sun Apr 11 20:02:16 2010 +0200 +++ b/mcabber/mcabber/xmpp_helper.c Mon Apr 12 20:50:19 2010 +0200 @@ -109,9 +109,11 @@ { LmMessageNode *tmp; tmp = lm_message_node_find_child(node, child); - if (tmp) - return lm_message_node_get_value(tmp); - else return NULL; + if (tmp) { + const gchar *val = lm_message_node_get_value(tmp); + return (val ? val : ""); + } + return NULL; } static LmMessageNode *hidden = NULL;