diff libpurple/protocols/jabber/usermood.c @ 29890:08ceb05e9fe9

merged with im.pidgin.pidgin
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Sun, 28 Feb 2010 06:13:14 +0900
parents 1c6c2f5ecf53
children 6bcf405d5c63
line wrap: on
line diff
--- a/libpurple/protocols/jabber/usermood.c	Thu Feb 25 16:27:25 2010 +0900
+++ b/libpurple/protocols/jabber/usermood.c	Sun Feb 28 06:13:14 2010 +0900
@@ -75,8 +75,8 @@
 	{"hungry", N_("Hungry"), NULL},
 	{"hurt", N_("Hurt"), NULL},
 	{"impressed", N_("Impressed"), NULL},
-	{"in_awe", N_("In_awe"), NULL},
-	{"in_love", N_("In_love"), NULL},
+	{"in_awe", N_("In awe"), NULL},
+	{"in_love", N_("In love"), NULL},
 	{"indignant", N_("Indignant"), NULL},
 	{"interested", N_("Interested"), NULL},
 	{"intoxicated", N_("Intoxicated"), NULL},
@@ -239,13 +239,14 @@
 void jabber_mood_set(JabberStream *js, const char *mood, const char *text) {
 	xmlnode *publish, *moodnode;
 
-	g_return_if_fail(mood != NULL);
-
 	publish = xmlnode_new("publish");
 	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");
-	xmlnode_new_child(moodnode, mood);
+	if (mood) {
+		/* if mood is NULL, set an empty mood node, meaning: unset mood */
+	    xmlnode_new_child(moodnode, mood);
+	}
 
 	if (text && text[0] != '\0') {
 		xmlnode *textnode = xmlnode_new_child(moodnode, "text");