Mercurial > pidgin
changeset 6067:6a3b676eb36a
[gaim-migrate @ 6517]
don't lose same-name accounts, and handle the default protocol a little better
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Wed, 09 Jul 2003 00:36:48 +0000 |
parents | c99959f1bb73 |
children | ba3847f74387 |
files | src/account.c src/gaimrc.c |
diffstat | 2 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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);