diff src/gaimrc.c @ 5580:86456ec3ca25

[gaim-migrate @ 5984] More nifty stuff! Accounts now get converted, and other niceties. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 31 May 2003 02:27:03 +0000
parents 5e7de337a053
children b07aa997ddd8
line wrap: on
line diff
--- a/src/gaimrc.c	Sat May 31 02:20:09 2003 +0000
+++ b/src/gaimrc.c	Sat May 31 02:27:03 2003 +0000
@@ -157,7 +157,6 @@
 #define OPT_ACCT_REM_PASS	0x00000004
 #define OPT_ACCT_MAIL_CHECK      0x00000008
 
-GSList *gaim_accounts = NULL;
 static guint misc_options;
 static guint logging_options;
 static guint blist_options;
@@ -589,6 +588,36 @@
 	}
 #endif
 
+	/* I hate this part. We must convert the protocol options. */
+	switch (gaim_account_get_protocol(account)) {
+		case GAIM_PROTO_TOC:
+		case GAIM_PROTO_OSCAR:
+		case GAIM_PROTO_JABBER:
+			gaim_account_set_string(account, "server", p->value[0]);
+			gaim_account_set_int(account, "port", atoi(p->value[1]));
+			break;
+
+		case GAIM_PROTO_MSN:
+		case GAIM_PROTO_NAPSTER:
+		case GAIM_PROTO_YAHOO:
+			gaim_account_set_string(account, "server", p->value[3]);
+			gaim_account_set_int(account, "port", atoi(p->value[4]));
+			break;
+
+		case GAIM_PROTO_IRC:
+			gaim_account_set_string(account, "server", p->value[0]);
+			gaim_account_set_int(account, "port", atoi(p->value[1]));
+			gaim_account_set_string(account, "charset", p->value[2]);
+			break;
+
+		case GAIM_PROTO_GADUGADU:
+			gaim_account_set_string(account, "nick", p->value[0]);
+			break;
+
+		default:
+			break;
+	}
+
 	if (!fgets(buf, sizeof(buf), f))
 		return account;
 
@@ -663,9 +692,7 @@
 
 		if (strcmp(p->option, "user")==0 ||
 		    strcmp(p->option, "current_user")==0) {
-			if((account=gaimrc_read_user(f))!=NULL)
-				gaim_accounts = g_slist_append(gaim_accounts, account);
-			else {
+			if((account=gaimrc_read_user(f))==NULL) {
 				gaim_debug(GAIM_DEBUG_ERROR, "gaimrc",
 						   "Error reading in users from .gaimrc\n");
 				return;