# HG changeset patch # User Paul Aurich # Date 1244180525 0 # Node ID c3fcdd59ab763d01d6149eb64c32adae3e26036d # Parent b58672890b3f61660ccc8a408d1148090b954f8a Allow Gadu-Gadu accounts to specify Connect Server. Refs #6691. Modified patch from kreez. Awaiting name for COPYRIGHT/ChangeLog. diff -r b58672890b3f -r c3fcdd59ab76 libpurple/protocols/gg/gg.c --- a/libpurple/protocols/gg/gg.c Fri Jun 05 04:27:53 2009 +0000 +++ b/libpurple/protocols/gg/gg.c Fri Jun 05 05:42:05 2009 +0000 @@ -1759,6 +1759,7 @@ PurpleStatus *status; struct gg_login_params *glp; GGPInfo *info; + const char *address; if (ggp_setup_proxy(account) == -1) return; @@ -1789,6 +1790,26 @@ glp->status = ggp_to_gg_status(status, &glp->status_descr); glp->tls = 0; + address = purple_account_get_string(account, "gg_server", ""); + if (address && *address) { + struct in_addr *addr = gg_gethostbyname(address); + + purple_debug_info("gg", "Using gg server given by user (%s)\n", address); + + if (addr == NULL) { + purple_debug_error("gg", "gg_gethostbyname returned error (%d): %s\n", + errno, g_strerror(errno)); + purple_connection_error_reason(gc, + PURPLE_CONNECTION_ERROR_NETWORK_ERROR, /* should this be a settings error? */ + _("Unable to resolve server")); + return; + } + + glp->server_addr = inet_addr(inet_ntoa(*addr)); + glp->server_port = 8074; + } else + purple_debug_info("gg", "Trying to retrieve address from gg appmsg service\n"); + info->session = gg_login(glp); if (info->session == NULL) { purple_connection_error_reason (gc, @@ -2367,6 +2388,11 @@ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option); + option = purple_account_option_string_new(_("GG server"), + "gg_server", ""); + prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, + option); + my_protocol = plugin; gg_debug_handler = purple_gg_debug_handler;