Mercurial > pidgin.yaz
changeset 27119:f3b0232ef1ea
merge of '58446e074cca7b8a7348254c03cfce2c5534fd63'
and '80305ffb91d9fc37e61e28c36fdc60fa02826699'
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Fri, 05 Jun 2009 05:44:44 +0000 |
parents | c3fcdd59ab76 (diff) 9c36a340fcaf (current diff) |
children | 804141095de5 9a79f8a99259 |
files | |
diffstat | 1 files changed, 26 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/gg/gg.c Fri Jun 05 05:15:09 2009 +0000 +++ b/libpurple/protocols/gg/gg.c Fri Jun 05 05:44:44 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;