changeset 17623:a8420fd18545

Added an option to require SSL or TLS when connecting to an XMPP server.
author Andreas Monitzer <pidgin@monitzer.com>
date Sun, 08 Jul 2007 22:52:48 +0000
parents 1b74553c5c08
children ca20c706ee50
files libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/libxmpp.c
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sun Jul 08 20:43:53 2007 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sun Jul 08 22:52:48 2007 +0000
@@ -138,6 +138,9 @@
 	if(xmlnode_get_child(packet, "starttls")) {
 		if(jabber_process_starttls(js, packet))
 			return;
+	} else if(purple_account_get_bool(js->gc->account, "require_tls", FALSE) && !js->gsc) {
+		purple_connection_error(js->gc, _("You require encryption, but it is not available on this server."));
+		return;
 	}
 
 	if(js->registration) {
--- a/libpurple/protocols/jabber/libxmpp.c	Sun Jul 08 20:43:53 2007 +0000
+++ b/libpurple/protocols/jabber/libxmpp.c	Sun Jul 08 22:52:48 2007 +0000
@@ -201,7 +201,11 @@
         split = purple_account_user_split_new(_("Resource"), "Home", '/');
         prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
 
-        option = purple_account_option_bool_new(_("Force old (port 5223) SSL"), "old_ssl", FALSE);
+		option = purple_account_option_bool_new(_("Require SSL/TLS"), "require_tls", FALSE);
+		prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+												   option);
+
+		option = purple_account_option_bool_new(_("Force old (port 5223) SSL"), "old_ssl", FALSE);
         prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
                         option);