comparison 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
comparison
equal deleted inserted replaced
5942:d0320de18feb 5943:a4f2aba0848d
81 81
82 AccountsDialog *accounts_dialog; 82 AccountsDialog *accounts_dialog;
83 83
84 GaimAccount *account; 84 GaimAccount *account;
85 GaimProtocol protocol; 85 GaimProtocol protocol;
86 const char *protocol_id;
86 GaimPlugin *plugin; 87 GaimPlugin *plugin;
87 GaimPluginProtocolInfo *prpl_info; 88 GaimPluginProtocolInfo *prpl_info;
88 89
89 GaimProxyType new_proxy_type; 90 GaimProxyType new_proxy_type;
90 91
181 182
182 static void 183 static void
183 set_account_protocol_cb(GtkWidget *item, GaimProtocol protocol, 184 set_account_protocol_cb(GtkWidget *item, GaimProtocol protocol,
184 AccountPrefsDialog *dialog) 185 AccountPrefsDialog *dialog)
185 { 186 {
186 dialog->protocol = protocol; 187 if ((dialog->plugin = gaim_find_prpl(protocol)) != NULL)
187
188 if ((dialog->plugin = gaim_find_prpl(dialog->protocol)) != NULL)
189 dialog->prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin); 188 dialog->prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin);
189
190 dialog->protocol_id = dialog->plugin->info->id;
190 191
191 add_login_options(dialog, dialog->top_vbox); 192 add_login_options(dialog, dialog->top_vbox);
192 add_user_options(dialog, dialog->top_vbox); 193 add_user_options(dialog, dialog->top_vbox);
193 add_protocol_options(dialog, dialog->bottom_vbox); 194 add_protocol_options(dialog, dialog->bottom_vbox);
194 } 195 }
923 if (dialog->account == NULL) { 924 if (dialog->account == NULL) {
924 const char *screenname; 925 const char *screenname;
925 926
926 screenname = gtk_entry_get_text(GTK_ENTRY(dialog->screenname_entry)); 927 screenname = gtk_entry_get_text(GTK_ENTRY(dialog->screenname_entry));
927 928
928 dialog->account = gaim_account_new(screenname, dialog->protocol); 929 dialog->account = gaim_account_new(screenname, dialog->protocol_id);
929 } 930 }
930 else { 931 else {
931 /* Protocol */ 932 /* Protocol */
932 gaim_account_set_protocol(dialog->account, dialog->protocol); 933 gaim_account_set_protocol_id(dialog->account, dialog->protocol_id);
933 } 934 }
934 935
935 /* Alias */ 936 /* Alias */
936 value = gtk_entry_get_text(GTK_ENTRY(dialog->alias_entry)); 937 value = gtk_entry_get_text(GTK_ENTRY(dialog->alias_entry));
937 938