comparison src/account.c @ 5780:a9029bed0479

[gaim-migrate @ 6205] Auto-login works again. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 07 Jun 2003 00:43:28 +0000
parents 758fa27534b3
children d89cadcafbec
comparison
equal deleted inserted replaced
5779:758fa27534b3 5780:a9029bed0479
762 data->tag = TAG_HOST; 762 data->tag = TAG_HOST;
763 else if (!strcmp(element_name, "port")) 763 else if (!strcmp(element_name, "port"))
764 data->tag = TAG_PORT; 764 data->tag = TAG_PORT;
765 else if (!strcmp(element_name, "settings")) { 765 else if (!strcmp(element_name, "settings")) {
766 if ((value = g_hash_table_lookup(atts, "ui")) != NULL) { 766 if ((value = g_hash_table_lookup(atts, "ui")) != NULL) {
767 gaim_debug(GAIM_DEBUG_INFO, "account", "Found ui: %s\n", value);
768 data->setting_ui = g_strdup(value); 767 data->setting_ui = g_strdup(value);
769 } 768 }
770 } 769 }
771 else if (!strcmp(element_name, "setting")) { 770 else if (!strcmp(element_name, "setting")) {
772 data->tag = TAG_SETTING; 771 data->tag = TAG_SETTING;
874 gaim_proxy_info_set_port(data->proxy_info, atoi(buffer)); 873 gaim_proxy_info_set_port(data->proxy_info, atoi(buffer));
875 } 874 }
876 } 875 }
877 else if (data->tag == TAG_SETTING) { 876 else if (data->tag == TAG_SETTING) {
878 if (data->setting_ui != NULL) { 877 if (data->setting_ui != NULL) {
879 gaim_debug(GAIM_DEBUG_INFO, "account",
880 "Setting account. UI = %s, setting = %s, buffer = %s\n",
881 data->setting_ui, data->setting_name, buffer);
882
883 if (data->setting_type == GAIM_PREF_STRING) 878 if (data->setting_type == GAIM_PREF_STRING)
884 gaim_account_set_ui_string(data->account, data->setting_ui, 879 gaim_account_set_ui_string(data->account, data->setting_ui,
885 data->setting_name, buffer); 880 data->setting_name, buffer);
886 else if (data->setting_type == GAIM_PREF_INT) 881 else if (data->setting_type == GAIM_PREF_INT)
887 gaim_account_set_ui_int(data->account, data->setting_ui, 882 gaim_account_set_ui_int(data->account, data->setting_ui,
963 if (filename == NULL) { 958 if (filename == NULL) {
964 accounts_loaded = TRUE; 959 accounts_loaded = TRUE;
965 return FALSE; 960 return FALSE;
966 } 961 }
967 962
968 gaim_debug(GAIM_DEBUG_INFO, "accounts", "Reading %s\n", filename);
969
970 if (!g_file_get_contents(filename, &contents, &length, &error)) { 963 if (!g_file_get_contents(filename, &contents, &length, &error)) {
971 gaim_debug(GAIM_DEBUG_ERROR, "accounts", 964 gaim_debug(GAIM_DEBUG_ERROR, "accounts",
972 "Error reading accounts: %s\n", error->message); 965 "Error reading accounts: %s\n", error->message);
973 966
974 g_error_free(error); 967 g_error_free(error);
1003 } 996 }
1004 997
1005 g_markup_parse_context_free(context); 998 g_markup_parse_context_free(context);
1006 g_free(contents); 999 g_free(contents);
1007 1000
1008 gaim_debug(GAIM_DEBUG_INFO, "accounts", "Finished reading %s\n",
1009 filename);
1010 g_free(filename); 1001 g_free(filename);
1011 1002
1012 accounts_loaded = TRUE; 1003 accounts_loaded = TRUE;
1013 1004
1014 return TRUE; 1005 return TRUE;
1218 GaimAccount *account; 1209 GaimAccount *account;
1219 GList *l; 1210 GList *l;
1220 1211
1221 g_return_if_fail(ui != NULL); 1212 g_return_if_fail(ui != NULL);
1222 1213
1223 for (l = gaim_connections_get_all(); l != NULL; l = l->next) { 1214 for (l = gaim_accounts_get_all(); l != NULL; l = l->next) {
1224 account = l->data; 1215 account = l->data;
1225 1216
1226 if (gaim_account_get_auto_login(account, ui)) 1217 if (gaim_account_get_auto_login(account, ui) &&
1218 gaim_account_get_remember_password(account)) {
1219
1227 gaim_account_connect(account); 1220 gaim_account_connect(account);
1221 }
1228 } 1222 }
1229 } 1223 }
1230 1224
1231 void 1225 void
1232 gaim_accounts_reorder(GaimAccount *account, size_t new_index) 1226 gaim_accounts_reorder(GaimAccount *account, size_t new_index)