diff src/gtkaccount.c @ 5943:a4f2aba0848d

[gaim-migrate @ 6384] This should fix corruption in the blist, accounts, and pounces when some protocol plugins cannot load. Some parts of gaim now use the new unique Plugin or Protocol Plugin IDs, while some still use the old protocol numbers. Accounts kind of used both, and when prpls were missing, it had trouble finding accounts. It would find the names, even without mapping the protocol numbers to IDs, and any duplicate accounts would get nuked. That would then affect pounce saving. Anyhow, long story short (well, it's already long, too late for that), this should fix all that mess. And introduce new mess, but hopefully temporary mess. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 23 Jun 2003 02:00:15 +0000
parents faf4363e56a8
children 235a14ae42f1
line wrap: on
line diff
--- a/src/gtkaccount.c	Sun Jun 22 17:08:52 2003 +0000
+++ b/src/gtkaccount.c	Mon Jun 23 02:00:15 2003 +0000
@@ -83,6 +83,7 @@
 
 	GaimAccount *account;
 	GaimProtocol protocol;
+	const char *protocol_id;
 	GaimPlugin *plugin;
 	GaimPluginProtocolInfo *prpl_info;
 
@@ -183,10 +184,10 @@
 set_account_protocol_cb(GtkWidget *item, GaimProtocol protocol,
 						  AccountPrefsDialog *dialog)
 {
-	dialog->protocol = protocol;
+	if ((dialog->plugin = gaim_find_prpl(protocol)) != NULL)
+		dialog->prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin);
 
-	if ((dialog->plugin = gaim_find_prpl(dialog->protocol)) != NULL)
-		dialog->prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin);
+	dialog->protocol_id = dialog->plugin->info->id;
 
 	add_login_options(dialog,    dialog->top_vbox);
 	add_user_options(dialog,     dialog->top_vbox);
@@ -925,11 +926,11 @@
 
 		screenname = gtk_entry_get_text(GTK_ENTRY(dialog->screenname_entry));
 
-		dialog->account = gaim_account_new(screenname, dialog->protocol);
+		dialog->account = gaim_account_new(screenname, dialog->protocol_id);
 	}
 	else {
 		/* Protocol */
-		gaim_account_set_protocol(dialog->account, dialog->protocol);
+		gaim_account_set_protocol_id(dialog->account, dialog->protocol_id);
 	}
 
 	/* Alias */