diff src/protocols/yahoo/yahoo.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/yahoo/yahoo.c	Sat May 22 17:20:27 2004 +0000
+++ b/src/protocols/yahoo/yahoo.c	Sat May 22 17:33:38 2004 +0000
@@ -446,7 +446,10 @@
 	gboolean onlist = 0;
 	char *oname = NULL;
 
-	if (!g_hash_table_lookup_extended(ht, gaim_normalize(account, name), (gpointer *) &oname, (gpointer *) &list))
+	char **oname_p = &oname;
+	GSList **list_p = &list;
+
+	if (!g_hash_table_lookup_extended(ht, gaim_normalize(account, name), (gpointer *) oname_p, (gpointer *) list_p))
 		list = gaim_find_buddies(account, name);
 	else
 		g_hash_table_steal(ht, name);
@@ -2497,37 +2500,35 @@
 	gaim_connection_set_display_name(gc, entry);
 }
 
-static void yahoo_show_act_id(GaimConnection *gc)
+static void yahoo_show_act_id(GaimPluginAction *action)
 {
+	GaimConnection *gc = (GaimConnection *) action->context;
 	gaim_request_input(gc, NULL, _("Active which ID?"), NULL,
 					   gaim_connection_get_display_name(gc), FALSE, FALSE, NULL,
 					   _("OK"), G_CALLBACK(yahoo_act_id),
 					   _("Cancel"), NULL, gc);
 }
 
-static void yahoo_show_chat_goto(GaimConnection *gc)
+static void yahoo_show_chat_goto(GaimPluginAction *action)
 {
+	GaimConnection *gc = (GaimConnection *) action->context;
 	gaim_request_input(gc, NULL, _("Join who in chat?"), NULL,
 					   "", FALSE, FALSE, NULL,
 					   _("OK"), G_CALLBACK(yahoo_chat_goto),
 					   _("Cancel"), NULL, gc);
 }
 
-static GList *yahoo_actions(GaimConnection *gc) {
+static GList *yahoo_actions(GaimPlugin *plugin, gpointer context) {
 	GList *m = NULL;
-	struct proto_actions_menu *pam;
-
-	pam = g_new0(struct proto_actions_menu, 1);
-	pam->label = _("Activate ID...");
-	pam->callback = yahoo_show_act_id;
-	pam->gc = gc;
-	m = g_list_append(m, pam);
-
-	pam = g_new0(struct proto_actions_menu, 1);
-	pam->label = _("Join user in chat...");
-	pam->callback = yahoo_show_chat_goto;
-	pam->gc = gc;
-	m = g_list_append(m, pam);
+	GaimPluginAction *act;
+
+	act = gaim_plugin_action_new(_("Activate ID..."),
+			yahoo_show_act_id);
+	m = g_list_append(m, act);
+
+	act = gaim_plugin_action_new(_("Join user in chat..."),
+			yahoo_show_chat_goto);
+	m = g_list_append(m, act);
 
 	return m;
 }
@@ -3222,7 +3223,6 @@
 	yahoo_status_text,
 	yahoo_tooltip_text,
 	yahoo_away_states,
-	yahoo_actions,
 	yahoo_buddy_menu,
 	yahoo_c_info,
 	yahoo_login,
@@ -3302,7 +3302,7 @@
 	NULL,                                             /**< ui_info        */
 	&prpl_info,                                       /**< extra_info     */
 	NULL,
-	NULL
+	yahoo_actions
 };
 
 static void