[gaim-migrate @ 6517]

Wed, 09 Jul 2003 00:36:48 +0000

author
Nathan Walp <nwalp@pidgin.im>
date
Wed, 09 Jul 2003 00:36:48 +0000
changeset 6067
4d8cd26c855b
parent 6066
444d1ed0a273
child 6068
b0c2d4bb7d88

[gaim-migrate @ 6517]
don't lose same-name accounts, and handle the default protocol a little better

src/account.c file | annotate | diff | comparison | revisions
src/gaimrc.c file | annotate | diff | comparison | revisions
--- a/src/account.c	Wed Jul 09 00:33:06 2003 +0000
+++ b/src/account.c	Wed Jul 09 00:36:48 2003 +0000
@@ -116,20 +116,24 @@
 GaimAccount *
 gaim_account_new(const char *username, const char *protocol_id)
 {
-	GaimAccount *account;
+	GaimAccount *account = NULL;
 
 	g_return_val_if_fail(username    != NULL, NULL);
-	g_return_val_if_fail(protocol_id != NULL, NULL);
 
-	account = gaim_accounts_find_with_prpl_id(username, protocol_id);
+	if(protocol_id)
+		account = gaim_accounts_find_with_prpl_id(username, protocol_id);
 
 	if (account != NULL)
 		return account;
 
 	account = g_new0(GaimAccount, 1);
 
-	gaim_account_set_username(account,    username);
-	gaim_account_set_protocol_id(account, protocol_id);
+	gaim_account_set_username(account, username);
+
+	if(protocol_id)
+		gaim_account_set_protocol_id(account, protocol_id);
+	else
+		gaim_account_set_protocol(account, GAIM_PROTO_DEFAULT);
 
 	account->settings = g_hash_table_new_full(g_str_hash, g_str_equal,
 											  g_free, delete_setting);
--- a/src/gaimrc.c	Wed Jul 09 00:33:06 2003 +0000
+++ b/src/gaimrc.c	Wed Jul 09 00:36:48 2003 +0000
@@ -520,7 +520,7 @@
 	if (strcmp(p->option, "ident"))
 		return NULL;
 
-	account = gaim_account_new(p->value[0], "prpl-oscar");
+	account = gaim_account_new(p->value[0], NULL);
 
 	gaim_account_set_password(account, p->value[1]);
 	gaim_account_set_remember_password(account, TRUE);

mercurial