Mercurial > pidgin
comparison libgaim/account.c @ 14979:c157efddc62a
[gaim-migrate @ 17758]
Don't lose the account proxy settings just because they are hidden and not in use.
Also, make the MSN HTTP method use the same proxy setup code as the core - this should improve env. var proxy handling.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Thu, 16 Nov 2006 04:58:40 +0000 |
parents | ad564b48dab0 |
children | 0a9c44ce9a4a |
comparison
equal
deleted
inserted
replaced
14978:f719225f988e | 14979:c157efddc62a |
---|---|
267 proxy_type == GAIM_PROXY_HTTP ? "http" : | 267 proxy_type == GAIM_PROXY_HTTP ? "http" : |
268 proxy_type == GAIM_PROXY_SOCKS4 ? "socks4" : | 268 proxy_type == GAIM_PROXY_SOCKS4 ? "socks4" : |
269 proxy_type == GAIM_PROXY_SOCKS5 ? "socks5" : | 269 proxy_type == GAIM_PROXY_SOCKS5 ? "socks5" : |
270 proxy_type == GAIM_PROXY_USE_ENVVAR ? "envvar" : "unknown"), -1); | 270 proxy_type == GAIM_PROXY_USE_ENVVAR ? "envvar" : "unknown"), -1); |
271 | 271 |
272 if (proxy_type != GAIM_PROXY_USE_GLOBAL && | 272 if ((value = gaim_proxy_info_get_host(proxy_info)) != NULL) |
273 proxy_type != GAIM_PROXY_NONE && | 273 { |
274 proxy_type != GAIM_PROXY_USE_ENVVAR) | 274 child = xmlnode_new_child(node, "host"); |
275 { | 275 xmlnode_insert_data(child, value, -1); |
276 if ((value = gaim_proxy_info_get_host(proxy_info)) != NULL) | 276 } |
277 { | 277 |
278 child = xmlnode_new_child(node, "host"); | 278 if ((int_value = gaim_proxy_info_get_port(proxy_info)) != 0) |
279 xmlnode_insert_data(child, value, -1); | 279 { |
280 } | 280 snprintf(buf, sizeof(buf), "%d", int_value); |
281 | 281 child = xmlnode_new_child(node, "port"); |
282 if ((int_value = gaim_proxy_info_get_port(proxy_info)) != 0) | 282 xmlnode_insert_data(child, buf, -1); |
283 { | 283 } |
284 snprintf(buf, sizeof(buf), "%d", int_value); | 284 |
285 child = xmlnode_new_child(node, "port"); | 285 if ((value = gaim_proxy_info_get_username(proxy_info)) != NULL) |
286 xmlnode_insert_data(child, buf, -1); | 286 { |
287 } | 287 child = xmlnode_new_child(node, "username"); |
288 | 288 xmlnode_insert_data(child, value, -1); |
289 if ((value = gaim_proxy_info_get_username(proxy_info)) != NULL) | 289 } |
290 { | 290 |
291 child = xmlnode_new_child(node, "username"); | 291 if ((value = gaim_proxy_info_get_password(proxy_info)) != NULL) |
292 xmlnode_insert_data(child, value, -1); | 292 { |
293 } | 293 child = xmlnode_new_child(node, "password"); |
294 | 294 xmlnode_insert_data(child, value, -1); |
295 if ((value = gaim_proxy_info_get_password(proxy_info)) != NULL) | |
296 { | |
297 child = xmlnode_new_child(node, "password"); | |
298 xmlnode_insert_data(child, value, -1); | |
299 } | |
300 } | 295 } |
301 | 296 |
302 return node; | 297 return node; |
303 } | 298 } |
304 | 299 |
655 { | 650 { |
656 gaim_proxy_info_set_password(proxy_info, data); | 651 gaim_proxy_info_set_password(proxy_info, data); |
657 g_free(data); | 652 g_free(data); |
658 } | 653 } |
659 | 654 |
660 /* If there are no values set then proxy_infourn NULL */ | 655 /* If there are no values set then proxy_info NULL */ |
661 if ((gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_USE_GLOBAL) && | 656 if ((gaim_proxy_info_get_type(proxy_info) == GAIM_PROXY_USE_GLOBAL) && |
662 (gaim_proxy_info_get_host(proxy_info) == NULL) && | 657 (gaim_proxy_info_get_host(proxy_info) == NULL) && |
663 (gaim_proxy_info_get_port(proxy_info) == 0) && | 658 (gaim_proxy_info_get_port(proxy_info) == 0) && |
664 (gaim_proxy_info_get_username(proxy_info) == NULL) && | 659 (gaim_proxy_info_get_username(proxy_info) == NULL) && |
665 (gaim_proxy_info_get_password(proxy_info) == NULL)) | 660 (gaim_proxy_info_get_password(proxy_info) == NULL)) |
1029 account->disconnecting = TRUE; | 1024 account->disconnecting = TRUE; |
1030 | 1025 |
1031 gc = gaim_account_get_connection(account); | 1026 gc = gaim_account_get_connection(account); |
1032 gaim_connection_destroy(gc); | 1027 gaim_connection_destroy(gc); |
1033 if (!gaim_account_get_remember_password(account)) | 1028 if (!gaim_account_get_remember_password(account)) |
1034 gaim_account_set_password(account, NULL); | 1029 gaim_account_set_password(account, NULL); |
1035 gaim_account_set_connection(account, NULL); | 1030 gaim_account_set_connection(account, NULL); |
1036 | 1031 |
1037 account->disconnecting = FALSE; | 1032 account->disconnecting = FALSE; |
1038 } | 1033 } |
1039 | 1034 |