libpurple/protocols/jabber/usermood.c

changeset 31935
77896a9a09c2
parent 29825
c1309b5a16a5
child 32438
dc8991868906
child 33801
6dbfcd72998e
--- a/libpurple/protocols/jabber/usermood.c	Sun Jun 26 20:37:03 2011 +0000
+++ b/libpurple/protocols/jabber/usermood.c	Mon Jun 27 05:24:53 2011 +0000
@@ -177,12 +177,12 @@
 	xmlnode_set_attrib(publish,"node","http://jabber.org/protocol/mood");
 	moodnode = xmlnode_new_child(xmlnode_new_child(publish, "item"), "mood");
 	xmlnode_set_namespace(moodnode, "http://jabber.org/protocol/mood");
-	if (mood) {
+	if (mood && *mood) {
 		/* if mood is NULL, set an empty mood node, meaning: unset mood */
 	    xmlnode_new_child(moodnode, mood);
 	}
 
-	if (text && text[0] != '\0') {
+	if (text && *text) {
 		xmlnode *textnode = xmlnode_new_child(moodnode, "text");
 		xmlnode_insert_data(textnode, text, -1);
 	}
@@ -195,4 +195,4 @@
 PurpleMood *jabber_get_moods(PurpleAccount *account)
 {
 	return moods;
-}
\ No newline at end of file
+}

mercurial