Mercurial > pidgin.yaz
changeset 30629:07f716427b50
We've already checked for the existance of the starttls node, so we know
it's gonna be there, so we don't need to check again
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 17 Jun 2010 21:04:40 +0000 |
parents | d24c975c68a5 |
children | 33989e3a449b |
files | libpurple/protocols/jabber/jabber.c |
diffstat | 1 files changed, 16 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Thu Jun 17 20:53:44 2010 +0000 +++ b/libpurple/protocols/jabber/jabber.c Thu Jun 17 21:04:40 2010 +0000 @@ -218,22 +218,25 @@ account = purple_connection_get_account(js->gc); - if((starttls = xmlnode_get_child(packet, "starttls"))) { - if(purple_ssl_is_supported()) { - jabber_send_raw(js, - "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1); - return TRUE; - } else if(xmlnode_get_child(starttls, "required")) { - purple_connection_error_reason(js->gc, + if(purple_ssl_is_supported()) { + jabber_send_raw(js, + "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>", -1); + return TRUE; + } + + starttls = xmlnode_get_child(packet, "starttls"); + if(xmlnode_get_child(starttls, "required")) { + purple_connection_error_reason(js->gc, PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("Server requires TLS/SSL, but no TLS/SSL support was found.")); - return TRUE; - } else if(purple_account_get_bool(account, "require_tls", JABBER_DEFAULT_REQUIRE_TLS)) { - purple_connection_error_reason(js->gc, - PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, + return TRUE; + } + + if(purple_account_get_bool(account, "require_tls", JABBER_DEFAULT_REQUIRE_TLS)) { + purple_connection_error_reason(js->gc, + PURPLE_CONNECTION_ERROR_NO_SSL_SUPPORT, _("You require encryption, but no TLS/SSL support was found.")); - return TRUE; - } + return TRUE; } return FALSE;