From c869a07bd607249f604ca6e6c2f2823dd9a6d4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=ADcolas=20Lazarte=20Kaqui?= Date: Tue, 20 Sep 2011 15:11:38 -0300 Subject: [PATCH] When not set the key user try to join no key --- SparkleLib/SparkleListenerBase.cs | 4 ---- SparkleLib/SparkleListenerIrc.cs | 18 ++++++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) 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); } } }