irc listener: fix bugs in channel password feature
This commit is contained in:
parent
2d7325144c
commit
09aa8e2d56
|
@ -49,9 +49,8 @@ namespace SparkleLib {
|
||||||
|
|
||||||
// Option to allow access to channel when no password is defined
|
// Option to allow access to channel when no password is defined
|
||||||
try {
|
try {
|
||||||
this.allow_passwordless_join = Convert.ToBoolean (
|
string option = SparkleConfig.DefaultConfig.GetConfigOption ("allow_passwordless_join");
|
||||||
SparkleConfig.DefaultConfig.GetConfigOption ("allow_passwordless_join"));
|
this.allow_passwordless_join = (option == null || Convert.ToBoolean (option));
|
||||||
|
|
||||||
} catch (Exception) {
|
} catch (Exception) {
|
||||||
this.allow_passwordless_join = true;
|
this.allow_passwordless_join = true;
|
||||||
}
|
}
|
||||||
|
@ -134,11 +133,14 @@ namespace SparkleLib {
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (this.allow_passwordless_join) {
|
if (this.allow_passwordless_join) {
|
||||||
SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing a dangerous channel, change the setting to not access");
|
SparkleHelpers.DebugInfo ("ListenerIrc", "Accessing unprotected channel, change the setting to not access");
|
||||||
this.client.RfcJoin (channel);
|
this.client.RfcJoin (channel);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
SparkleHelpers.DebugInfo ("ListenerIrc", "Dangerous channel, change the setting to access");
|
SparkleHelpers.DebugInfo ("ListenerIrc", "Unprotected channel, change the setting to access");
|
||||||
|
base.is_connecting = false;
|
||||||
|
OnDisconnected ();
|
||||||
|
throw new ConnectionException ("Unprotected channel, change the setting to access");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue