# HG changeset patch # User Christian Hammond # Date 1055592079 0 # Node ID db4df0be06fd7f7004f4ad8ff9463910ad007537 # Parent d6b5cab288bb8ff4ac7dd4b47584f32fac1a50c6 [gaim-migrate @ 6298] Added a little bit of code to prevent duplicate accounts, but it doesn't fix the problem of importing all new accounts when are importing from the old .gaimrc and also have an accounts.xml already established. committer: Tailor Script diff -r d6b5cab288bb -r db4df0be06fd src/account.c --- a/src/account.c Sat Jun 14 11:55:15 2003 +0000 +++ b/src/account.c Sat Jun 14 12:01:19 2003 +0000 @@ -126,9 +126,20 @@ gaim_account_new(const char *username, GaimProtocol protocol) { GaimAccount *account; + GList *l; g_return_val_if_fail(username != NULL, NULL); + for (l = gaim_accounts_get_all(); l != NULL; l = l->next) { + account = l->data; + + if (!strcmp(gaim_account_get_username(account), username) && + gaim_account_get_protocol(account) == protocol) { + + return account; + } + } + account = g_new0(GaimAccount, 1); gaim_account_set_username(account, username); @@ -1192,6 +1203,9 @@ { g_return_if_fail(account != NULL); + if (g_list_find(accounts, account) != NULL) + return; + accounts = g_list_append(accounts, account); schedule_accounts_save();