diff src/protocols/yahoo/yahoo.c @ 3572:bdd0bebd2d04

[gaim-migrate @ 3670] Phase II. No longer do you have to worry about protocol plugins. When Gaim probes plugins on load, it will detect protocol plugins and add them to the list of available protocols. When you try to log an account on with one of them, Gaim will automatically load the plugin--when no more accounts need the protocol--Gaim will automatically unload it. Protocol plugins are no longer available in the plugins ui, and no protocols are compiled statically by default. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 30 Sep 2002 01:05:18 +0000
parents 82180bb28f1f
children bb966d68f9e3
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Sun Sep 29 17:00:14 2002 +0000
+++ b/src/protocols/yahoo/yahoo.c	Mon Sep 30 01:05:18 2002 +0000
@@ -173,10 +173,6 @@
 	GSList *hash;
 };
 
-static char *yahoo_name() {
-	return "Yahoo";
-}
-
 #define YAHOO_PACKET_HDRLEN (4 + 2 + 2 + 2 + 2 + 4 + 4)
 
 static struct yahoo_packet *yahoo_packet_new(enum yahoo_service service, enum yahoo_status status, int id)
@@ -1128,26 +1124,6 @@
 	return m;
 }
 
-static GList *yahoo_user_opts()
-{
-	GList *m = NULL;
-	struct proto_user_opt *puo;
-
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = "Pager Host:";
-	puo->def = YAHOO_PAGER_HOST;
-	puo->pos = USEROPT_PAGERHOST;
-	m = g_list_append(m, puo);
-
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = "Pager Port:";
-	puo->def = "5050";
-	puo->pos = USEROPT_PAGERPORT;
-	m = g_list_append(m, puo);
-
-	return m;
-}
-
 static void yahoo_act_id(gpointer data, char *entry)
 {
 	struct gaim_connection *gc = data;
@@ -1435,10 +1411,10 @@
 static struct prpl *my_protocol = NULL;
 
 void yahoo_init(struct prpl *ret) {
+	struct proto_user_opt *puo;
 	ret->protocol = PROTO_YAHOO;
 	ret->options = OPT_PROTO_MAIL_CHECK;
-	ret->name = yahoo_name;
-	ret->user_opts = yahoo_user_opts;
+	ret->name = g_strdup("Yahoo");
 	ret->login = yahoo_login;
 	ret->close = yahoo_close;
 	ret->buddy_menu = yahoo_buddy_menu;
@@ -1455,32 +1431,27 @@
 	ret->send_typing = yahoo_send_typing;
 	ret->smiley_list = yahoo_smiley_list;
 
+	puo = g_new0(struct proto_user_opt, 1);
+	puo->label = g_strdup("Pager Host:");
+	puo->def = g_strdup(YAHOO_PAGER_HOST);
+	puo->pos = USEROPT_PAGERHOST;
+	ret->user_opts = g_list_append(ret->user_opts, puo);
+
+	puo = g_new0(struct proto_user_opt, 1);
+	puo->label = g_strdup("Pager Port:");
+	puo->def = g_strdup("5050");
+	puo->pos = USEROPT_PAGERPORT;
+	ret->user_opts = g_list_append(ret->user_opts, puo);
+
 	my_protocol = ret;
 }
 
 #ifndef STATIC
 
-char *gaim_plugin_init(GModule *handle)
-{
-	load_protocol(yahoo_init, sizeof(struct prpl));
-	return NULL;
-}
-
-void gaim_plugin_remove()
+void *gaim_prpl_init(struct prpl *prpl)
 {
-	struct prpl *p = find_prpl(PROTO_YAHOO);
-	if (p == my_protocol)
-		unload_protocol(p);
-}
-
-char *name()
-{
-	return "Yahoo";
-}
-
-char *description()
-{
-	return PRPL_DESC("Yahoo");
+	yahoo_init(prpl);
+	prpl->plug->desc.api_version = PLUGIN_API_VERSION;
 }
 
 #endif