From: Sean E. <sea...@us...> - 2002-09-30 01:05:49
|
Update of /cvsroot/gaim/gaim/src/protocols/icq In directory usw-pr-cvs1:/tmp/cvs-serv18273/src/protocols/icq Modified Files: gaim_icq.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: gaim_icq.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/icq/gaim_icq.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- gaim_icq.c 29 Aug 2002 01:47:14 -0000 1.26 +++ gaim_icq.c 30 Sep 2002 01:05:16 -0000 1.27 @@ -23,10 +23,6 @@ static guint ack_timer = 0; -static char *icq_name() { - return "ICQ"; -} - static void icq_do_log(icq_Link *link, time_t time, unsigned char level, const char *log) { debug_printf("ICQ debug %d: %s", level, log); } @@ -474,19 +470,6 @@ return m; } -static GList *icq_user_opts() { - GList *m = NULL; - struct proto_user_opt *puo; - - puo = g_new0(struct proto_user_opt, 1); - puo->label = "Nick:"; - puo->def = "Gaim User"; - puo->pos = USEROPT_NICK; - m = g_list_append(m, puo); - - return m; -} - static GList *icq_away_states(struct gaim_connection *gc) { GList *m = NULL; @@ -504,12 +487,12 @@ static struct prpl *my_protocol = NULL; void icq_init(struct prpl *ret) { + struct proto_user_opt *puo; ret->protocol = PROTO_ICQ; - ret->name = icq_name; + ret->name = g_strdup("ICQ"); ret->list_icon = icq_list_icon; ret->away_states = icq_away_states; ret->buddy_menu = icq_buddy_menu; - ret->user_opts = icq_user_opts; ret->login = icq_login; ret->close = icq_close; ret->send_im = icq_send_msg; @@ -520,6 +503,12 @@ ret->set_away = icq_set_away; ret->keepalive = icq_keepalive; + puo = g_new0(struct proto_user_opt, 1); + puo->label = g_strdup("Nick:"); + puo->def = g_strdup("Gaim User"); + puo->pos = USEROPT_NICK; + ret->user_opts = g_list_append(ret->user_opts, puo); + my_protocol = ret; icq_SocketNotify = icq_sock_notify; @@ -528,27 +517,9 @@ #ifndef STATIC -char *gaim_plugin_init(GModule *handle) -{ - load_protocol(icq_init, sizeof(struct prpl)); - return NULL; -} - -void gaim_plugin_remove() -{ - struct prpl *p = find_prpl(PROTO_ICQ); - if (p == my_protocol) - unload_protocol(p); -} - -char *name() -{ - return "ICQ"; -} - -char *description() +void *gaim_prpl_init(struct prpl *prpl) { - return PRPL_DESC("ICQ"); + icq_init(prpl); + prpl->plug->desc.api_version = PLUGIN_API_VERSION; } - #endif |