From: Sean E. <sea...@us...> - 2002-09-30 01:05:21
|
Update of /cvsroot/gaim/gaim/src/protocols/yahoo In directory usw-pr-cvs1:/tmp/cvs-serv18273/src/protocols/yahoo Modified Files: yahoo.c Log Message: 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. Index: yahoo.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/yahoo/yahoo.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- yahoo.c 16 Sep 2002 19:50:52 -0000 1.50 +++ yahoo.c 30 Sep 2002 01:05:18 -0000 1.51 @@ -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; - my_protocol = ret; -} - -#ifndef STATIC + 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); -char *gaim_plugin_init(GModule *handle) -{ - load_protocol(yahoo_init, sizeof(struct prpl)); - return NULL; -} + 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); -void gaim_plugin_remove() -{ - struct prpl *p = find_prpl(PROTO_YAHOO); - if (p == my_protocol) - unload_protocol(p); + my_protocol = ret; } -char *name() -{ - return "Yahoo"; -} +#ifndef STATIC -char *description() +void *gaim_prpl_init(struct prpl *prpl) { - return PRPL_DESC("Yahoo"); + yahoo_init(prpl); + prpl->plug->desc.api_version = PLUGIN_API_VERSION; } #endif |