changeset 29945:5e7ff3ed7ad0

jabber: Remove old prpl action to set mood as now the general mood setting UI can do all that the old one does. Maybe finch needs a UI for it?
author Marcus Lundblad <ml@update.uu.se>
date Sat, 06 Mar 2010 21:32:18 +0000
parents 1b861e13ae45
children 537f8fd047c6
files libpurple/protocols/jabber/pep.c libpurple/protocols/jabber/usermood.c libpurple/protocols/jabber/usermood.h
diffstat 3 files changed, 0 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/pep.c	Fri Mar 05 22:21:04 2010 +0000
+++ b/libpurple/protocols/jabber/pep.c	Sat Mar 06 21:32:18 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	Fri Mar 05 22:21:04 2010 +0000
+++ b/libpurple/protocols/jabber/usermood.c	Sat Mar 06 21:32:18 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	Fri Mar 05 22:21:04 2010 +0000
+++ b/libpurple/protocols/jabber/usermood.h	Sat Mar 06 21:32:18 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 */);