diff src/protocols/irc/irc.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/irc/irc.c	Sat May 22 17:20:27 2004 +0000
+++ b/src/protocols/irc/irc.c	Sat May 22 17:33:38 2004 +0000
@@ -41,7 +41,7 @@
 static const char *irc_blist_icon(GaimAccount *a, GaimBuddy *b);
 static void irc_blist_emblems(GaimBuddy *b, char **se, char **sw, char **nw, char **ne);
 static GList *irc_away_states(GaimConnection *gc);
-static GList *irc_actions(GaimConnection *gc);
+static GList *irc_actions(GaimPlugin *plugin, gpointer context);
 /* static GList *irc_chat_info(GaimConnection *gc); */
 static void irc_login(GaimAccount *account);
 static void irc_login_cb(gpointer data, gint source, GaimInputCondition cond);
@@ -59,8 +59,9 @@
 
 static const char *status_chars = "@+%&";
 
-static void irc_view_motd(GaimConnection *gc)
+static void irc_view_motd(GaimPluginAction *action)
 {
+	GaimConnection *gc = (GaimConnection *) action->context;
 	struct irc_conn *irc;
 	char *title;
 
@@ -131,16 +132,13 @@
 	return g_list_append(NULL, (gpointer)GAIM_AWAY_CUSTOM);
 }
 
-static GList *irc_actions(GaimConnection *gc)
+static GList *irc_actions(GaimPlugin *plugin, gpointer context)
 {
-	struct proto_actions_menu *pam;
 	GList *list = NULL;
+	GaimPluginAction *act = NULL;
 
-	pam = g_new0(struct proto_actions_menu, 1);
-	pam->label = _("View MOTD");
-	pam->callback = irc_view_motd;
-	pam->gc = gc;
-	list = g_list_append(list, pam);
+	act = gaim_plugin_action_new(_("View MOTD"), irc_view_motd);
+	list = g_list_append(list, act);
 
 	return list;
 }
@@ -547,7 +545,6 @@
 	NULL,
 	NULL,
 	irc_away_states,
-	irc_actions,
 	irc_buddy_menu,
 	irc_chat_join_info,
 	irc_login,
@@ -621,7 +618,7 @@
 	NULL,                                             /**< ui_info        */
 	&prpl_info,                                       /**< extra_info     */
 	NULL,
-	NULL
+	irc_actions
 };
 
 static void _init_plugin(GaimPlugin *plugin)