diff src/protocols/jabber/jabber.c @ 9015:67421e0dc497

[gaim-migrate @ 9791] (05:54:53) siege: that's the first pass on merging the two action sources (05:55:27) siege: using it right now, seems to be working fine. You may want to look it over though... (05:56:04) siege: found a small mem-leak in a GList getting created and not destroyed, this fixes that as well (13:20:40) KingAnt: LSchiere: Well it's probably ok. I haven't even had a chance to look at the commit for the other thing committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 22 May 2004 17:33:38 +0000
parents 294ae6548d4e
children 7ab20f829190
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Sat May 22 17:20:27 2004 +0000
+++ b/src/protocols/jabber/jabber.c	Sat May 22 17:33:38 2004 +0000
@@ -1017,8 +1017,10 @@
 	gaim_account_set_password(js->gc->account, p1);
 }
 
-static void jabber_password_change(GaimConnection *gc)
+static void jabber_password_change(GaimPluginAction *action)
 {
+
+	GaimConnection *gc = (GaimConnection *) action->context;
 	JabberStream *js = gc->proto_data;
 	GaimRequestFields *fields;
 	GaimRequestFieldGroup *group;
@@ -1044,23 +1046,19 @@
 			_("Cancel"), NULL, js);
 }
 
-static GList *jabber_actions(GaimConnection *gc)
+static GList *jabber_actions(GaimPlugin *plugin, gpointer context)
 {
 	GList *m = NULL;
-	struct proto_actions_menu *pam;
+	GaimPluginAction *act;
 
-	pam = g_new0(struct proto_actions_menu, 1);
-	pam->label = _("Set User Info");
-	pam->callback = jabber_setup_set_info;
-	pam->gc = gc;
-	m = g_list_append(m, pam);
+	act = gaim_plugin_action_new(_("Set User Info"),
+			jabber_setup_set_info);
+	m = g_list_append(m, act);
 
 	/* if (js->protocol_options & CHANGE_PASSWORD) { */
-		pam = g_new0(struct proto_actions_menu, 1);
-		pam->label = _("Change Password");
-		pam->callback = jabber_password_change;
-		pam->gc = gc;
-		m = g_list_append(m, pam);
+		act = gaim_plugin_action_new(_("Change Password"),
+				jabber_password_change);
+		m = g_list_append(m, act);
 	/* } */
 
 	return m;
@@ -1299,7 +1297,6 @@
 	jabber_status_text,
 	jabber_tooltip_text,
 	jabber_away_states,
-	jabber_actions,
 	jabber_buddy_menu,
 	jabber_chat_info,
 	jabber_login,
@@ -1374,7 +1371,7 @@
 	NULL,                                             /**< ui_info        */
 	&prpl_info,                                       /**< extra_info     */
 	&prefs_info,                                      /**< prefs_info     */
-	NULL
+	jabber_actions
 };
 
 static void