diff src/account.c @ 5665:132a30783c3d

[gaim-migrate @ 6081] We're going to shuffle around the init sequence in main.c again. Importing accounts should no longer screw things up, and there's better protection against invalid protocol IDs causing an account to have to be hand-editted. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 02 Jun 2003 10:21:33 +0000
parents 6b3214ab8632
children 44870684dba3
line wrap: on
line diff
--- a/src/account.c	Mon Jun 02 10:10:37 2003 +0000
+++ b/src/account.c	Mon Jun 02 10:21:33 2003 +0000
@@ -33,6 +33,7 @@
 
 #include "account.h"
 #include "prefs.h"
+#include "prpl.h"
 
 typedef enum
 {
@@ -248,10 +249,21 @@
 void
 gaim_account_set_protocol(GaimAccount *account, GaimProtocol protocol)
 {
+	GaimPlugin *plugin;
+
 	g_return_if_fail(account != NULL);
 
+	plugin = gaim_find_prpl(protocol);
+
+	g_return_if_fail(plugin != NULL);
+
 	account->protocol = protocol;
 
+	if (account->protocol_id != NULL)
+		g_free(account->protocol_id);
+
+	account->protocol_id = g_strdup(plugin->info->id);
+
 	schedule_accounts_save();
 }