diff src/protocols/silc/silc.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 85caba2f820a
line wrap: on
line diff
--- a/src/protocols/silc/silc.c	Sat May 22 17:20:27 2004 +0000
+++ b/src/protocols/silc/silc.c	Sat May 22 17:33:38 2004 +0000
@@ -525,8 +525,9 @@
 }
 
 static void
-silcgaim_attrs(GaimConnection *gc)
+silcgaim_attrs(GaimPluginAction *action)
 {
+	GaimConnection *gc = (GaimConnection *) action->context;
 	SilcGaim sg = gc->proto_data;
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
@@ -689,8 +690,9 @@
 }
 
 static void
-silcgaim_detach(GaimConnection *gc)
+silcgaim_detach(GaimPluginAction *action)
 {
+	GaimConnection *gc = (GaimConnection *) action->context;
 	SilcGaim sg;
 
 	if (!gc)
@@ -705,8 +707,9 @@
 }
 
 static void
-silcgaim_view_motd(GaimConnection *gc)
+silcgaim_view_motd(GaimPluginAction *action)
 {
+	GaimConnection *gc = (GaimConnection *) action->context;
 	SilcGaim sg;
 
 	if (!gc)
@@ -727,30 +730,24 @@
 }
 
 static GList *
-silcgaim_actions(GaimConnection *gc)
+silcgaim_actions(GaimPlugin *plugin, gpointer context)
 {
-	struct proto_actions_menu *pam;
 	GList *list = NULL;
+	GaimPluginAction *act;
 
 	if (!gaim_account_get_bool(gc->account, "reject-attrs", FALSE)) {
-		pam = g_new0(struct proto_actions_menu, 1);
-		pam->label = _("Online Status");
-		pam->callback = silcgaim_attrs;
-		pam->gc = gc;
-		list = g_list_append(list, pam);
+		act = gaim_plugin_action_new(_("Online Status"),
+				silcgaim_attrs);
+		list = g_list_append(list, act);
 	}
 
-	pam = g_new0(struct proto_actions_menu, 1);
-	pam->label = _("Detach From Server");
-	pam->callback = silcgaim_detach;
-	pam->gc = gc;
-	list = g_list_append(list, pam);
+	act = gaim_plugin_action_new(_("Detach From Server"),
+			silcgaim_detach);
+	list = g_list_append(list, act);
 
-	pam = g_new0(struct proto_actions_menu, 1);
-	pam->label = _("View Message of the Day");
-	pam->callback = silcgaim_view_motd;
-	pam->gc = gc;
-	list = g_list_append(list, pam);
+	act = gaim_plugin_action_new(_("View Message of the Day"),
+			silcgaim_view_motd);
+	list = g_list_append(list, act);
 
 	return list;
 }
@@ -951,7 +948,6 @@
 	silcgaim_status_text,
 	silcgaim_tooltip_text,
 	silcgaim_away_states,
-	silcgaim_actions,
 	silcgaim_buddy_menu,
 	silcgaim_chat_info,
 	silcgaim_login,
@@ -1026,7 +1022,7 @@
 	NULL,                                             /**< ui_info        */
 	&prpl_info,                                       /**< extra_info     */
 	&prefs_info,                                      /**< prefs_info     */
-	NULL
+	silcgaim_actions
 };
 
 static void