pidgin: 42656ca9: jabber: Remove old prpl action to set mo...

malu at pidgin.im malu at pidgin.im
Sat Mar 6 16:35:47 EST 2010


-----------------------------------------------------------------
Revision: 42656ca94264f5df098e296856bcefd9f37c175d
Ancestor: 6d8a9a520e4ea4c291e8e4ddbd59bcdb988f3965
Author: malu at pidgin.im
Date: 2010-03-06T21:32:18
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/42656ca94264f5df098e296856bcefd9f37c175d

Modified files:
        libpurple/protocols/jabber/pep.c
        libpurple/protocols/jabber/usermood.c
        libpurple/protocols/jabber/usermood.h

ChangeLog: 

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?

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/pep.c	14dcf42e0a325556b421cb7d3f330552c097cc8b
+++ libpurple/protocols/jabber/pep.c	cb3cc7863a7e94d1f497c2506b0ba9b5bbb97753
@@ -56,7 +56,6 @@ void jabber_pep_init_actions(GList **m) 
 
 void jabber_pep_init_actions(GList **m) {
 	/* register the PEP-specific actions */
-	jabber_mood_init_action(m);
 	jabber_nick_init_action(m);
 }
 
============================================================
--- libpurple/protocols/jabber/usermood.c	54233369f50fbcd5ed9843dee14225cd62e99f76
+++ libpurple/protocols/jabber/usermood.c	4d680a1626b290bfcc6f053b372fd9a4822ce108
@@ -170,68 +170,6 @@ void jabber_mood_init(void) {
 	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;
 
============================================================
--- libpurple/protocols/jabber/usermood.h	f3a65f1dcc8b9e9d5d89163c8204f0b8b72232e6
+++ libpurple/protocols/jabber/usermood.h	d20b021d8b2a06f7dc870613c8c8ed2e5d04361a
@@ -30,8 +30,6 @@ void jabber_mood_init(void);
 
 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 */);


More information about the Commits mailing list