Mercurial > pidgin
comparison libgaim/protocols/oscar/oscar.c @ 14392:92eb7a040663
[gaim-migrate @ 17099]
Better connection error messages for dnsquery failures in
general and for oscar
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 31 Aug 2006 09:44:51 +0000 |
parents | 01daacf7b771 |
children | 648e33275d9d |
comparison
equal
deleted
inserted
replaced
14391:6e89bfd2b33f | 14392:92eb7a040663 |
---|---|
895 /* Notify the conversation window that we've left the chat */ | 895 /* Notify the conversation window that we've left the chat */ |
896 serv_got_chat_left(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(cc->conv))); | 896 serv_got_chat_left(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(cc->conv))); |
897 | 897 |
898 /* Destroy the chat_connection */ | 898 /* Destroy the chat_connection */ |
899 od->oscar_chats = g_slist_remove(od->oscar_chats, cc); | 899 od->oscar_chats = g_slist_remove(od->oscar_chats, cc); |
900 flap_connection_schedule_destroy(cc->conn, OSCAR_DISCONNECT_DONE); | 900 flap_connection_schedule_destroy(cc->conn, OSCAR_DISCONNECT_DONE, NULL); |
901 oscar_chat_destroy(cc); | 901 oscar_chat_destroy(cc); |
902 } | 902 } |
903 | 903 |
904 /** | 904 /** |
905 * This is the callback function anytime gaim_proxy_connect() | 905 * This is the callback function anytime gaim_proxy_connect() |
925 if (source < 0) | 925 if (source < 0) |
926 { | 926 { |
927 gaim_debug_error("oscar", "unable to connect FLAP server " | 927 gaim_debug_error("oscar", "unable to connect FLAP server " |
928 "of type 0x%04hx\n", conn->type); | 928 "of type 0x%04hx\n", conn->type); |
929 if (conn->type == SNAC_FAMILY_AUTH) | 929 if (conn->type == SNAC_FAMILY_AUTH) |
930 gaim_connection_error(gc, _("Could not connect to authentication server")); | 930 { |
931 if (conn->type == SNAC_FAMILY_LOCATE) | 931 gchar *msg; |
932 gaim_connection_error(gc, _("Could not connect to BOS server")); | 932 msg = g_strdup_printf(_("Could not connect to authentication server:\n%s"), |
933 else /* Maybe we should call this for BOS connections, too? */ | 933 error_message); |
934 gaim_connection_error(gc, msg); | |
935 g_free(msg); | |
936 } | |
937 else if (conn->type == SNAC_FAMILY_LOCATE) | |
938 { | |
939 gchar *msg; | |
940 msg = g_strdup_printf(_("Could not connect to BOS server:\n%s"), | |
941 error_message); | |
942 gaim_connection_error(gc, msg); | |
943 g_free(msg); | |
944 } | |
945 else | |
946 { | |
947 /* Maybe we should call this for BOS connections, too? */ | |
934 flap_connection_schedule_destroy(conn, | 948 flap_connection_schedule_destroy(conn, |
935 OSCAR_DISCONNECT_COULD_NOT_CONNECT); | 949 OSCAR_DISCONNECT_COULD_NOT_CONNECT, error_message); |
950 } | |
936 return; | 951 return; |
937 } | 952 } |
938 | 953 |
939 gaim_debug_info("oscar", "connected to FLAP server of type 0x%04hx\n", | 954 gaim_debug_info("oscar", "connected to FLAP server of type 0x%04hx\n", |
940 conn->type); | 955 conn->type); |
1300 gaim_debug_misc("oscar", "Reg status: %hu\n", info->regstatus); | 1315 gaim_debug_misc("oscar", "Reg status: %hu\n", info->regstatus); |
1301 gaim_debug_misc("oscar", "E-mail: %s\n", | 1316 gaim_debug_misc("oscar", "E-mail: %s\n", |
1302 (info->email != NULL) ? info->email : "null"); | 1317 (info->email != NULL) ? info->email : "null"); |
1303 gaim_debug_misc("oscar", "BOSIP: %s\n", info->bosip); | 1318 gaim_debug_misc("oscar", "BOSIP: %s\n", info->bosip); |
1304 gaim_debug_info("oscar", "Closing auth connection...\n"); | 1319 gaim_debug_info("oscar", "Closing auth connection...\n"); |
1305 flap_connection_schedule_destroy(conn, OSCAR_DISCONNECT_DONE); | 1320 flap_connection_schedule_destroy(conn, OSCAR_DISCONNECT_DONE, NULL); |
1306 | 1321 |
1307 for (i = 0; i < strlen(info->bosip); i++) { | 1322 for (i = 0; i < strlen(info->bosip); i++) { |
1308 if (info->bosip[i] == ':') { | 1323 if (info->bosip[i] == ':') { |
1309 port = atoi(&(info->bosip[i+1])); | 1324 port = atoi(&(info->bosip[i+1])); |
1310 break; | 1325 break; |
1615 | 1630 |
1616 newconn->connect_data = gaim_proxy_connect(account, host, port, | 1631 newconn->connect_data = gaim_proxy_connect(account, host, port, |
1617 connection_established_cb, newconn); | 1632 connection_established_cb, newconn); |
1618 if (newconn->connect_data == NULL) | 1633 if (newconn->connect_data == NULL) |
1619 { | 1634 { |
1620 flap_connection_schedule_destroy(newconn, OSCAR_DISCONNECT_COULD_NOT_CONNECT); | 1635 flap_connection_schedule_destroy(newconn, |
1636 OSCAR_DISCONNECT_COULD_NOT_CONNECT, | |
1637 _("gaim_proxy_connect() failed")); | |
1621 gaim_debug_error("oscar", "Unable to connect to FLAP server " | 1638 gaim_debug_error("oscar", "Unable to connect to FLAP server " |
1622 "of type 0x%04hx\n", redir->group); | 1639 "of type 0x%04hx\n", redir->group); |
1623 } | 1640 } |
1624 g_free(host); | 1641 g_free(host); |
1625 | 1642 |
6513 | 6530 |
6514 option = gaim_account_option_string_new(_("Encoding"), "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); | 6531 option = gaim_account_option_string_new(_("Encoding"), "encoding", OSCAR_DEFAULT_CUSTOM_ENCODING); |
6515 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | 6532 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
6516 | 6533 |
6517 option = gaim_account_option_bool_new( | 6534 option = gaim_account_option_bool_new( |
6518 _("Always use AIM/ICQ proxy server\n(slower, but does not reveal your IP address)"), "always_use_rv_proxy", | 6535 _("Always use AIM/ICQ proxy server for file transfers\n(slower, but does not reveal your IP address)"), "always_use_rv_proxy", |
6519 OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY); | 6536 OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY); |
6520 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); | 6537 prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); |
6521 | 6538 |
6522 /* Preferences */ | 6539 /* Preferences */ |
6523 gaim_prefs_add_none("/plugins/prpl/oscar"); | 6540 gaim_prefs_add_none("/plugins/prpl/oscar"); |