diff --git a/SparkleLib/SparkleListenerBase.cs b/SparkleLib/SparkleListenerBase.cs index e212c919..f865ffed 100644 --- a/SparkleLib/SparkleListenerBase.cs +++ b/SparkleLib/SparkleListenerBase.cs @@ -57,10 +57,6 @@ namespace SparkleLib { uri = "irc://204.62.14.135/"; } - if (key == null) { - key = "12345"; - } - Uri announce_uri = new Uri (uri); // We use only one listener per server to keep diff --git a/SparkleLib/SparkleListenerIrc.cs b/SparkleLib/SparkleListenerIrc.cs index 5b65f725..ab7a03ed 100644 --- a/SparkleLib/SparkleListenerIrc.cs +++ b/SparkleLib/SparkleListenerIrc.cs @@ -111,9 +111,14 @@ namespace SparkleLib { foreach (string channel in base.channels) { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); - this.client.RfcJoin (channel); + if (key != null) { + SparkleHelpers.DebugInfo ("ListenerIrc", "Ussing key"); + this.client.RfcJoin (channel, key); + this.client.RfcMode (channel, "+k " + key); + } else { + this.client.RfcJoin (channel); + } this.client.RfcMode (channel, "+s"); - this.client.RfcMode (channel, "+k " + key); } // List to the channel, this blocks the thread @@ -140,9 +145,14 @@ namespace SparkleLib { if (IsConnected) { SparkleHelpers.DebugInfo ("ListenerIrc", "Joining channel " + channel); - this.client.RfcJoin (channel); + if (key != null) { + SparkleHelpers.DebugInfo ("ListenerIrc", "Ussing key"); + this.client.RfcJoin (channel, key); + this.client.RfcMode (channel, "+k " + key); + } else { + this.client.RfcJoin (channel); + } this.client.RfcMode (channel, "+s"); - this.client.RfcMode (channel, "+k " + key); } } }