# HG changeset patch # User Sadrul Habib Chowdhury # Date 1247638403 0 # Node ID b20d8387577176c2ba6fca8d85f64cb102a4f564 # Parent 606a0e577b34e8e68bcf4f1990cea73cb807674f# Parent 0d32c4c08debe0f386a3639ecf94fe44eebb3859 merge of '5d2fae2f23534be16c94035916b126cf0953435b' and 'db060a215516031bb98001e8c9c513fde6bb25df' diff -r 606a0e577b34 -r b20d83875771 libpurple/protocols/yahoo/libymsg.c --- a/libpurple/protocols/yahoo/libymsg.c Wed Jul 15 06:09:22 2009 +0000 +++ b/libpurple/protocols/yahoo/libymsg.c Wed Jul 15 06:13:23 2009 +0000 @@ -3408,6 +3408,9 @@ PurpleConnection *gc = purple_account_get_connection(account); struct yahoo_data *yd = gc->proto_data = g_new0(struct yahoo_data, 1); PurpleStatus *status = purple_account_get_active_status(account); + const char *server = NULL; + int pager_port = 0; + gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_URLDESC; purple_connection_update_progress(gc, _("Connecting"), 1, 2); @@ -3423,41 +3426,30 @@ yd->friends = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, yahoo_friend_free); yd->imvironments = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); yd->xfer_peer_idstring_map = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); - yd->peers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, yahoo_p2p_disconnect_destroy_data); + yd->peers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, + yahoo_p2p_disconnect_destroy_data); yd->sms_carrier = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); - yd->yahoo_p2p_timer = purple_timeout_add_seconds(YAHOO_P2P_KEEPALIVE_SECS, yahoo_p2p_keepalive, gc); + yd->yahoo_p2p_timer = purple_timeout_add_seconds(YAHOO_P2P_KEEPALIVE_SECS, + yahoo_p2p_keepalive, gc); yd->confs = NULL; yd->conf_id = 2; yd->last_keepalive = yd->last_ping = time(NULL); yd->current_status = get_yahoo_status_from_purple_status(status); + yd->jp = yahoo_is_japan(account); yahoo_server_check(account); yahoo_picture_check(account); - if (yahoo_is_japan(account)) { - yd->jp = TRUE; - if (purple_proxy_connect(gc, account, - purple_account_get_string(account, "server", YAHOOJP_PAGER_HOST), - purple_account_get_int(account, "port", YAHOO_PAGER_PORT), - yahoo_got_connected, gc) == NULL) - { - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to connect")); - return; - } - } else { - yd->jp = FALSE; - if (purple_proxy_connect(gc, account, - purple_account_get_string(account, "server", YAHOO_PAGER_HOST), - purple_account_get_int(account, "port", YAHOO_PAGER_PORT), - yahoo_got_connected, gc) == NULL) - { - purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, - _("Unable to connect")); - return; - } - } + server = purple_account_get_string(account, "server", + yd->jp ? YAHOOJP_PAGER_HOST : YAHOO_PAGER_HOST); + pager_port = purple_account_get_int(account, "port", YAHOO_PAGER_PORT); + + if (purple_proxy_connect(gc, account, server, pager_port, yahoo_got_connected, gc) == NULL) + purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR, + _("Unable to connect")); + + return; } void yahoo_close(PurpleConnection *gc) {