Mercurial > pidgin.yaz
changeset 29946:537f8fd047c6
merge of '42656ca94264f5df098e296856bcefd9f37c175d'
and 'ac8ee7f3a708dfc1481e15258fe9b5c71a7920e7'
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sat, 06 Mar 2010 21:38:42 +0000 |
parents | 5e7ff3ed7ad0 (diff) 818f2845ab47 (current diff) |
children | 7be0dbc00168 2f73b0a78f4f |
files | |
diffstat | 3 files changed, 0 insertions(+), 65 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/pep.c Sat Mar 06 16:51:30 2010 +0000 +++ b/libpurple/protocols/jabber/pep.c Sat Mar 06 21:38:42 2010 +0000 @@ -56,7 +56,6 @@ void jabber_pep_init_actions(GList **m) { /* register the PEP-specific actions */ - jabber_mood_init_action(m); jabber_nick_init_action(m); }
--- a/libpurple/protocols/jabber/usermood.c Sat Mar 06 16:51:30 2010 +0000 +++ b/libpurple/protocols/jabber/usermood.c Sat Mar 06 21:38:42 2010 +0000 @@ -170,68 +170,6 @@ jabber_pep_register_handler("http://jabber.org/protocol/mood", jabber_mood_cb); } -static void do_mood_set_from_fields(PurpleConnection *gc, PurpleRequestFields *fields) { - JabberStream *js; - const int max_mood_idx = sizeof(moods) / sizeof(moods[0]) - 1; - int selected_mood = purple_request_fields_get_choice(fields, "mood"); - - if (!PURPLE_CONNECTION_IS_VALID(gc)) { - purple_debug_error("jabber", "Unable to set mood; account offline.\n"); - return; - } - - js = gc->proto_data; - - if (selected_mood < 0 || selected_mood >= max_mood_idx) { - purple_debug_error("jabber", "Invalid mood index (%d) selected.\n", selected_mood); - return; - } - - jabber_mood_set(js, moods[selected_mood].mood, purple_request_fields_get_string(fields, "text")); -} - -static void do_mood_set_mood(PurplePluginAction *action) { - PurpleConnection *gc = (PurpleConnection *) action->context; - - PurpleRequestFields *fields; - PurpleRequestFieldGroup *group; - PurpleRequestField *field; - int i; - - fields = purple_request_fields_new(); - group = purple_request_field_group_new(NULL); - purple_request_fields_add_group(fields, group); - - field = purple_request_field_choice_new("mood", - _("Mood"), 0); - - for(i = 0; moods[i].mood; ++i) - purple_request_field_choice_add(field, _(moods[i].description)); - - purple_request_field_set_required(field, TRUE); - purple_request_field_group_add_field(group, field); - - field = purple_request_field_string_new("text", - _("Description"), NULL, - FALSE); - purple_request_field_group_add_field(group, field); - - purple_request_fields(gc, _("Edit User Mood"), - _("Edit User Mood"), - _("Please select your mood from the list."), - fields, - _("Set"), G_CALLBACK(do_mood_set_from_fields), - _("Cancel"), NULL, - purple_connection_get_account(gc), NULL, NULL, - gc); - -} - -void jabber_mood_init_action(GList **m) { - PurplePluginAction *act = purple_plugin_action_new(_("Set Mood..."), do_mood_set_mood); - *m = g_list_append(*m, act); -} - void jabber_mood_set(JabberStream *js, const char *mood, const char *text) { xmlnode *publish, *moodnode;
--- a/libpurple/protocols/jabber/usermood.h Sat Mar 06 16:51:30 2010 +0000 +++ b/libpurple/protocols/jabber/usermood.h Sat Mar 06 21:38:42 2010 +0000 @@ -30,8 +30,6 @@ void jabber_mood_init(void); -void jabber_mood_init_action(GList **m); - void jabber_mood_set(JabberStream *js, const char *mood, /* must be one of the valid strings defined in the XEP */ const char *text /* might be NULL */);