Bug 116437

Summary: konversation's JOIN command doesn't parse '0' (zero) correctly
Product: [Applications] konversation Reporter: Caio Begotti <caio1982>
Component: generalAssignee: Konversation Developers <konversation-devel>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:

Description Caio Begotti 2005-11-15 19:46:08 UTC
Version:           0.18 (#3016) or newer, probably all versions released (using KDE KDE 3.4.2)
Installed from:    Debian testing/unstable Packages
Compiler:          GCC 4.0.3 I believe that's the correct version as it seems to be the default on Debian Unstable
OS:                Linux

[16:23:01] <caio1982> cartman: is the "/join 0" bug fixed in the latest konversation or it wasnt even mentioned 'til now?
[16:23:11] <caio1982> i just discovered it right now, in the bad way :P
[16:23:15] <cartman> never mentioned to me
[16:23:33] <caio1982> if you do "/join 3,lala" it'll join the both channels correctly, with #
[16:23:55] <caio1982> but if you do "/join #3,0" it'll join the channel "3" and will quit every channel you are in
[16:24:34] <caio1982> cartman: sounds like a bug in the original ircd and almost none clients have it fixed, as far as a friend is telling me in pvt
[16:24:42] <cartman> caio1982: yup
[16:24:49] <cartman> caio1982: thats so old :)

I suspect that this log explains the bug very, very well :)
Not only the first channel (parameter) to JOIN should be parsed like that, but also everything the user might specify, so we won't get any more person quitting a lot of channels at once with no reason :D
Comment 1 Caio Begotti 2005-11-15 19:55:51 UTC
It's indirectly related to this bug https://bugs.kde.org/show_bug.cgi?id=91932
"Bug 91932: automatically add the # when /join-ing channels (as in bitchx)"
Comment 2 Ismail Donmez 2005-11-15 20:02:48 UTC
SVN commit 480613 by cartman:

Protect against #foo,0 tricks and also add a fixme to be RFC 2812 complaint
BUG:116437



 M  +5 -1      outputfilter.cpp  
 M  +1 -1      outputfilter.h  


--- trunk/extragear/network/konversation/src/outputfilter.cpp #480612:480613
@@ -257,10 +257,14 @@
         return changeMode(parameter,'v','-');
     }
 
-    OutputFilterResult OutputFilter::parseJoin(const QString &channelName)
+    OutputFilterResult OutputFilter::parseJoin(QString channelName)
     {
         OutputFilterResult result;
 
+        if(channelName.contains(",")) // Protect against #foo,0 tricks
+            channelName = channelName.remove(",0");
+        //else if(channelName == "0") // FIXME IRC RFC 2812 section 3.2.1
+                        
         if(channelName.isEmpty())
         {
             result = usage(i18n("Usage: %1JOIN <channel> [password]").arg(commandChar));
--- trunk/extragear/network/konversation/src/outputfilter.h #480612:480613
@@ -93,7 +93,7 @@
             OutputFilterResult parseSMsg(const QString& parameter);
             OutputFilterResult parseDescribe(const QString& parameter);
             OutputFilterResult parseNotice(const QString& parameter);
-            OutputFilterResult parseJoin(const QString& parameter);
+            OutputFilterResult parseJoin(QString parameter);
             OutputFilterResult parsePart(const QString& parameter);
             OutputFilterResult parseQuit(const QString& parameter);
             OutputFilterResult parseKick(const QString& parameter);