Mercurial > pidgin
diff src/protocols/icq/gaim_icq.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 | 7a3f16a375a5 |
children | 8b3491f1ca56 |
line wrap: on
line diff
--- a/src/protocols/icq/gaim_icq.c Sun Sep 29 17:00:14 2002 +0000 +++ b/src/protocols/icq/gaim_icq.c Mon Sep 30 01:05:18 2002 +0000 @@ -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) +void *gaim_prpl_init(struct prpl *prpl) { - 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); + icq_init(prpl); + prpl->plug->desc.api_version = PLUGIN_API_VERSION; } - -char *name() -{ - return "ICQ"; -} - -char *description() -{ - return PRPL_DESC("ICQ"); -} - #endif