comparison libpurple/protocols/jabber/usermood.c @ 29916:6bcf405d5c63

Allow a PRPL to have get_moods return NULL to disable mood setting. Fixes not showing the "Set Mood" menu for XMPP accounts not supporting PEP such as gmail.com
author Marcus Lundblad <ml@update.uu.se>
date Wed, 03 Mar 2010 22:08:27 +0000
parents 1c6c2f5ecf53
children 9f6a657af957
comparison
equal deleted inserted replaced
29902:27a94015e239 29916:6bcf405d5c63
117 {"worried", N_("Worried"), NULL}, 117 {"worried", N_("Worried"), NULL},
118 /* Mark the last record. */ 118 /* Mark the last record. */
119 {NULL, NULL, NULL} 119 {NULL, NULL, NULL}
120 }; 120 };
121 121
122 static PurpleMood empty_moods[] = {
123 {NULL, NULL, NULL}
124 };
125
126 static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) { 122 static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) {
127 /* it doesn't make sense to have more than one item here, so let's just pick the first one */ 123 /* it doesn't make sense to have more than one item here, so let's just pick the first one */
128 xmlnode *item = xmlnode_get_child(items, "item"); 124 xmlnode *item = xmlnode_get_child(items, "item");
129 const char *newmood = NULL; 125 const char *newmood = NULL;
130 char *moodtext = NULL; 126 char *moodtext = NULL;
266 if (js->pep) { 262 if (js->pep) {
267 purple_debug_info("jabber", "get_moods: account supports PEP\n"); 263 purple_debug_info("jabber", "get_moods: account supports PEP\n");
268 return moods; 264 return moods;
269 } else { 265 } else {
270 purple_debug_info("jabber", "get_moods: account doesn't support PEP\n"); 266 purple_debug_info("jabber", "get_moods: account doesn't support PEP\n");
271 return empty_moods; 267 return NULL;
272 } 268 }
273 } 269 }