comparison src/account.c @ 6621:42fdf16f1dad

[gaim-migrate @ 7145] Individual accounts remember the "No Proxy" setting instead of reverting back to "Use Global Proxy Settings" Proxy settings for individual accounts do not revert to "No Proxy" if you open an account, don't change the proxy drop down, then save the account. Those two sound like the same thing, but they're different. I think. Added the "use environmental variables" setting in a way that isn't horrible. We're not using that thing that splits the proxy variable into host:port yet. I'll do that later. I would have done that earlier, but I had to go buy a bike. Also, I'd like to show what the environmental variables are set to somewhere. That'll come later. Also a patch from Robot101: (22:10:25) Bzubhipheron: I have a patch that replaces #define WFLAG_* with GaimMessageFlags GAIM_MESSAGE_* (22:10:30) Bzubhipheron: (an enum in disguise) (22:14:18) Bzubhipheron: GaimMessageFlags protrays much better typing information than "int". most of the other #defines are gone, and glib standardises on enums for its flags too. (22:14:27) Bzubhipheron: (gone or going) (22:14:45) Bzubhipheron: and it makes the prototype of my message queueing stuff prettier. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 25 Aug 2003 02:49:42 +0000
parents 0473a28ce807
children 0c5637b5462e
comparison
equal deleted inserted replaced
6620:7230e5920911 6621:42fdf16f1dad
928 else if (data->tag == TAG_TYPE) { 928 else if (data->tag == TAG_TYPE) {
929 if (data->in_proxy) { 929 if (data->in_proxy) {
930 if (!strcmp(buffer, "global")) 930 if (!strcmp(buffer, "global"))
931 gaim_proxy_info_set_type(data->proxy_info, 931 gaim_proxy_info_set_type(data->proxy_info,
932 GAIM_PROXY_USE_GLOBAL); 932 GAIM_PROXY_USE_GLOBAL);
933 else if (!strcmp(buffer, "none"))
934 gaim_proxy_info_set_type(data->proxy_info, GAIM_PROXY_NONE);
933 else if (!strcmp(buffer, "http")) 935 else if (!strcmp(buffer, "http"))
934 gaim_proxy_info_set_type(data->proxy_info, GAIM_PROXY_HTTP); 936 gaim_proxy_info_set_type(data->proxy_info, GAIM_PROXY_HTTP);
935 else if (!strcmp(buffer, "socks4")) 937 else if (!strcmp(buffer, "socks4"))
936 gaim_proxy_info_set_type(data->proxy_info, GAIM_PROXY_SOCKS4); 938 gaim_proxy_info_set_type(data->proxy_info, GAIM_PROXY_SOCKS4);
937 else if (!strcmp(buffer, "socks5")) 939 else if (!strcmp(buffer, "socks5"))
938 gaim_proxy_info_set_type(data->proxy_info, GAIM_PROXY_SOCKS5); 940 gaim_proxy_info_set_type(data->proxy_info, GAIM_PROXY_SOCKS5);
941 else if (!strcmp(buffer, "envvar"))
942 gaim_proxy_info_set_type(data->proxy_info, GAIM_PROXY_USE_ENVVAR);
939 else 943 else
940 gaim_debug(GAIM_DEBUG_ERROR, "account", 944 gaim_debug(GAIM_DEBUG_ERROR, "account",
941 "Invalid proxy type found when loading account " 945 "Invalid proxy type found when loading account "
942 "information for %s\n", 946 "information for %s\n",
943 gaim_account_get_username(data->account)); 947 gaim_account_get_username(data->account));
982 data->setting_name = NULL; 986 data->setting_name = NULL;
983 } 987 }
984 else if (!strcmp(element_name, "proxy")) { 988 else if (!strcmp(element_name, "proxy")) {
985 data->in_proxy = FALSE; 989 data->in_proxy = FALSE;
986 990
987 if (gaim_proxy_info_get_type(data->proxy_info) == GAIM_PROXY_NONE) { 991 if (gaim_proxy_info_get_type(data->proxy_info) == GAIM_PROXY_USE_GLOBAL) {
988 gaim_proxy_info_destroy(data->proxy_info); 992 gaim_proxy_info_destroy(data->proxy_info);
989 data->proxy_info = NULL; 993 data->proxy_info = NULL;
990 } 994 }
991 else if (*buffer != '\0') { 995 else if (*buffer != '\0') {
992 gaim_account_set_proxy_info(data->account, data->proxy_info); 996 gaim_account_set_proxy_info(data->account, data->proxy_info);
1171 g_hash_table_foreach(account->settings, write_setting, fp); 1175 g_hash_table_foreach(account->settings, write_setting, fp);
1172 fprintf(fp, " </settings>\n"); 1176 fprintf(fp, " </settings>\n");
1173 1177
1174 g_hash_table_foreach(account->ui_settings, write_ui_setting_list, fp); 1178 g_hash_table_foreach(account->ui_settings, write_ui_setting_list, fp);
1175 1179
1176 if ((proxy_info = gaim_account_get_proxy_info(account)) != NULL && 1180 if ((proxy_info = gaim_account_get_proxy_info(account)) != NULL)
1177 (proxy_type = gaim_proxy_info_get_type(proxy_info)) != GAIM_PROXY_NONE)
1178 { 1181 {
1179 const char *value; 1182 const char *value;
1180 int int_value; 1183 int int_value;
1181 1184
1185 proxy_type = gaim_proxy_info_get_type(proxy_info);
1186
1182 fprintf(fp, " <proxy>\n"); 1187 fprintf(fp, " <proxy>\n");
1183 fprintf(fp, " <type>%s</type>\n", 1188 fprintf(fp, " <type>%s</type>\n",
1184 (proxy_type == GAIM_PROXY_USE_GLOBAL ? "global" : 1189 (proxy_type == GAIM_PROXY_USE_GLOBAL ? "global" :
1190 proxy_type == GAIM_PROXY_NONE ? "none" :
1185 proxy_type == GAIM_PROXY_HTTP ? "http" : 1191 proxy_type == GAIM_PROXY_HTTP ? "http" :
1186 proxy_type == GAIM_PROXY_SOCKS4 ? "socks4" : 1192 proxy_type == GAIM_PROXY_SOCKS4 ? "socks4" :
1187 proxy_type == GAIM_PROXY_SOCKS5 ? "socks5" : "unknown")); 1193 proxy_type == GAIM_PROXY_SOCKS5 ? "socks5" :
1188 1194 proxy_type == GAIM_PROXY_USE_ENVVAR ? "envvar" : "unknown"));
1189 if (proxy_type != GAIM_PROXY_USE_GLOBAL) { 1195
1196 if (proxy_type != GAIM_PROXY_USE_GLOBAL &&
1197 proxy_type != GAIM_PROXY_NONE &&
1198 proxy_type != GAIM_PROXY_USE_ENVVAR) {
1190 if ((value = gaim_proxy_info_get_host(proxy_info)) != NULL) 1199 if ((value = gaim_proxy_info_get_host(proxy_info)) != NULL)
1191 fprintf(fp, " <host>%s</host>\n", value); 1200 fprintf(fp, " <host>%s</host>\n", value);
1192 1201
1193 if ((int_value = gaim_proxy_info_get_port(proxy_info)) != 0) 1202 if ((int_value = gaim_proxy_info_get_port(proxy_info)) != 0)
1194 fprintf(fp, " <port>%d</port>\n", int_value); 1203 fprintf(fp, " <port>%d</port>\n", int_value);