# HG changeset patch # User Christian Hammond # Date 1054503400 0 # Node ID eb685809108bac47d8024d7172dfb019e7f3463e # Parent 1693a3027dc812630dbdf8d15e9a16651f44488e [gaim-migrate @ 6057] When a prpl couldn't load, the account's prpl ID got set to -1 and the account config file had to be manually editted. Now that's fixed, and it stores the ID on load and writes it on save. committer: Tailor Script diff -r 1693a3027dc8 -r eb685809108b src/account.c --- a/src/account.c Sun Jun 01 21:18:48 2003 +0000 +++ b/src/account.c Sun Jun 01 21:36:40 2003 +0000 @@ -67,6 +67,7 @@ GaimAccount *account; GaimProtocol protocol; + char *protocol_id; GString *buffer; @@ -134,10 +135,11 @@ if (account->gc != NULL) gaim_connection_destroy(account->gc); - if (account->username != NULL) g_free(account->username); - if (account->alias != NULL) g_free(account->alias); - if (account->password != NULL) g_free(account->password); - if (account->user_info != NULL) g_free(account->user_info); + if (account->username != NULL) g_free(account->username); + if (account->alias != NULL) g_free(account->alias); + if (account->password != NULL) g_free(account->password); + if (account->user_info != NULL) g_free(account->user_info); + if (account->protocol_id != NULL) g_free(account->protocol_id); g_hash_table_destroy(account->settings); @@ -546,6 +548,7 @@ GList *l; GaimPlugin *plugin; + data->protocol_id = g_strdup(buffer); data->protocol = -1; for (l = gaim_plugins_get_protocols(); l != NULL; l = l->next) { @@ -561,8 +564,12 @@ } } } - else if (data->tag == TAG_NAME) + else if (data->tag == TAG_NAME) { data->account = gaim_account_new(buffer, data->protocol); + data->account->protocol_id = data->protocol_id; + + data->protocol_id = NULL; + } else if (data->tag == TAG_PASSWORD) { gaim_account_set_password(data->account, buffer); gaim_account_set_remember_password(data->account, TRUE); @@ -706,16 +713,11 @@ static void gaim_accounts_write(FILE *fp, GaimAccount *account) { - GaimPlugin *plugin; const char *password, *alias, *user_info, *buddy_icon; char *esc; - plugin = gaim_find_prpl(gaim_account_get_protocol(account)); - fprintf(fp, " \n"); - fprintf(fp, " %s\n", - (plugin != NULL && plugin->info != NULL && plugin->info->id != NULL - ? plugin->info->id : "unknown")); + fprintf(fp, " %s\n", account->protocol_id); esc = g_markup_escape_text(gaim_account_get_username(account), -1); fprintf(fp, " %s\n", esc); g_free(esc); diff -r 1693a3027dc8 -r eb685809108b src/account.h --- a/src/account.h Sun Jun 01 21:18:48 2003 +0000 +++ b/src/account.h Sun Jun 01 21:36:40 2003 +0000 @@ -41,6 +41,7 @@ gboolean check_mail; /**< Check for mail. */ GaimProtocol protocol; /**< The account protocol. */ + char *protocol_id; /**< The ID of the protocol. */ GaimConnection *gc; /**< The connection handle. */