Mercurial > ~mikael > mcabber > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
1895:7043542b3565 | 1896:c5ab9cf3819a |
---|---|
107 const gchar* lm_message_node_get_child_value(LmMessageNode *node, | 107 const gchar* lm_message_node_get_child_value(LmMessageNode *node, |
108 const gchar *child) | 108 const gchar *child) |
109 { | 109 { |
110 LmMessageNode *tmp; | 110 LmMessageNode *tmp; |
111 tmp = lm_message_node_find_child(node, child); | 111 tmp = lm_message_node_find_child(node, child); |
112 if (tmp) | 112 if (tmp) { |
113 return lm_message_node_get_value(tmp); | 113 const gchar *val = lm_message_node_get_value(tmp); |
114 else return NULL; | 114 return (val ? val : ""); |
115 } | |
116 return NULL; | |
115 } | 117 } |
116 | 118 |
117 static LmMessageNode *hidden = NULL; | 119 static LmMessageNode *hidden = NULL; |
118 | 120 |
119 void lm_message_node_hide(LmMessageNode *node) | 121 void lm_message_node_hide(LmMessageNode *node) |