diff src/protocols/gg/gg.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 ad8d15bbbd2d
line wrap: on
line diff
--- a/src/protocols/gg/gg.c	Sun Sep 29 17:00:14 2002 +0000
+++ b/src/protocols/gg/gg.c	Mon Sep 30 01:05:18 2002 +0000
@@ -1,6 +1,6 @@
 /*
  * gaim - Gadu-Gadu Protocol Plugin
- * $Id: gg.c 3516 2002-08-29 01:47:15Z seanegan $
+ * $Id: gg.c 3670 2002-09-30 01:05:18Z seanegan $
  *
  * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
  * 
@@ -99,10 +99,6 @@
 	int type;
 };
 
-static char *agg_name()
-{
-	return "Gadu-Gadu";
-}
 
 static gchar *charset_convert(const gchar *locstr, const char *encsrc, const char *encdst)
 {
@@ -308,20 +304,6 @@
 	return m;
 }
 
-static GList *agg_user_opts()
-{
-	GList *m = NULL;
-	struct proto_user_opt *puo;
-
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = _("Nick:");
-	puo->def = _("Gadu-Gadu User");
-	puo->pos = USEROPT_NICK;
-	m = g_list_append(m, puo);
-
-	return m;
-}
-
 static void main_callback(gpointer data, gint source, GaimInputCondition cond)
 {
 	struct gaim_connection *gc = data;
@@ -1241,14 +1223,14 @@
 
 void gg_init(struct prpl *ret)
 {
+	struct proto_user_opt *puo;
 	ret->protocol = PROTO_GADUGADU;
 	ret->options = 0;
-	ret->name = agg_name;
+	ret->name = g_strdup("Gadu-Gadu");
 	ret->list_icon = agg_list_icon;
 	ret->away_states = agg_away_states;
 	ret->actions = agg_actions;
 	ret->do_action = agg_do_action;
-	ret->user_opts = agg_user_opts;
 	ret->buddy_menu = agg_buddy_menu;
 	ret->chat_info = NULL;
 	ret->login = agg_login;
@@ -1278,32 +1260,22 @@
 	ret->chat_send = NULL;
 	ret->keepalive = agg_keepalive;
 	ret->normalize = NULL;
+     
+	puo = g_new0(struct proto_user_opt, 1);
+	puo->label = g_strdup(_("Nick:"));
+	puo->def = g_strdup(_("Gadu-Gadu User"));
+	puo->pos = USEROPT_NICK;
+	ret->user_opts = g_list_append(ret->user_opts, puo);
+
 	my_protocol = ret;
 }
 
 #ifndef STATIC
 
-char *gaim_plugin_init(GModule *handle)
-{
-	load_protocol(gg_init, sizeof(struct prpl));
-	return NULL;
-}
-
-void gaim_plugin_remove()
+void *gaim_prpl_init(struct prpl *prpl)
 {
-	struct prpl *p = find_prpl(PROTO_GADUGADU);
-	if (p == my_protocol)
-		unload_protocol(p);
-}
-
-char *name()
-{
-	return "Gadu-Gadu";
-}
-
-char *description()
-{
-	return PRPL_DESC("Gadu-Gadu");
+	gg_init(prpl);
+	prpl->plug->desc.api_version = PLUGIN_API_VERSION;
 }
 
 #endif