From 475c4b479e780d24bfc474b34c62420743daac6a Mon Sep 17 00:00:00 2001 From: wimh Date: Fri, 21 Oct 2011 22:08:30 +0200 Subject: [PATCH] refs #18 fix handling of allow_passwordless_join setting --- SparkleLib/SparkleListenerIrc.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/SparkleLib/SparkleListenerIrc.cs b/SparkleLib/SparkleListenerIrc.cs index 7a998b38..0f9d1472 100644 --- a/SparkleLib/SparkleListenerIrc.cs +++ b/SparkleLib/SparkleListenerIrc.cs @@ -49,9 +49,8 @@ namespace SparkleLib { // Option to allow access to channel when no password is defined try { - this.allow_passwordless_join = Convert.ToBoolean ( - SparkleConfig.DefaultConfig.GetConfigOption ("allow_passwordless_join")); - + string option = SparkleConfig.DefaultConfig.GetConfigOption ("allow_passwordless_join"); + this.allow_passwordless_join = option==null || Convert.ToBoolean (option); } catch (Exception) { this.allow_passwordless_join = true; } @@ -141,6 +140,9 @@ namespace SparkleLib { } else { SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel, change the setting to access"); + base.is_connecting = false; + OnDisconnected (); + throw new ConnectionException ("Dangerous channel, change the setting to access"); } }