Bug 97354 - channel list in whois reply isn't always parsed correctly
Summary: channel list in whois reply isn't always parsed correctly
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-18 16:39 UTC by Wouter Coekaerts
Modified: 2010-07-01 16:00 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wouter Coekaerts 2005-01-18 16:39:06 UTC
Version:           0.16 (using KDE KDE 3.3.1)
OS:                Linux

Parsing of channels in whois reply doesn't handle some "strange" (but not really uncommon) replies correctly:

On ircd-hybrid (for example EFNet), if you have voice and ops, your whois reply can have @+#channel
Konversation shows this as:
[Whois] coekie is an operator on channels: +#channel

On "ircd" (for example IRCNet), a normal user on a !ABCDEFchannel is shown as:
[Whois] coekie is owner of channels: ABCDEFfoo
(see rfc 2811 to see what ! prefixed channels are)
Comment 1 Ismail Donmez 2005-03-26 19:29:48 UTC
CVS commit by cartman: 

Fix whois replies containing @+ correctly. Fixes first part of #97354
CCBUG:97354


  M +5 -0      inputfilter.cpp   1.192


--- kdeextragear-2/konversation/konversation/inputfilter.cpp  #1.191:1.192
@@ -890,4 +890,9 @@ void InputFilter::parseServerCommand(con
               server->setChannelNick(lookChannel.mid(1), parameterList[1], 8);
             }
+            else if(lookChannel.startsWith("@+"))
+            {
+              opChannels.append(lookChannel.mid(2));
+              server->setChannelNick(lookChannel.mid(2), parameterList[1], 4);
+            }
             else if(lookChannel.startsWith("@"))
             {
Comment 2 Ismail Donmez 2005-03-26 19:51:35 UTC
Wouter can you tell me how to create a safe channel prefixed with ! or tell me how the server replies for a normal user on such a channel and for the creator ?
Comment 3 Wouter Coekaerts 2005-03-26 20:16:38 UTC
Connect to IRCNet and /join !!channel
then you'll end up a channel like !ABCDEFchannel
prefixes for voices and ops are just the same: @!ABCDEFchannel,
+!ABCDEFchannel
You *could* strip the prefix, it's not "really" part of the name (in
irssi channels have a 'real' name and visual name, which are different
for safe channels). But safe channels are hardly used, so that's
probably not worth the effort :)
But safe channels are just one case of different prefix, see CHANTYPES
for other prefixes ;)
Comment 4 Ismail Donmez 2005-03-27 11:11:52 UTC
CVS commit by cartman: 

Fix whois parsing for safe channels. Second part of #97354
BUG:97354


  M +2 -2      inputfilter.cpp   1.193


--- kdeextragear-2/konversation/konversation/inputfilter.cpp  #1.192:1.193
@@ -885,10 +885,10 @@ void InputFilter::parseServerCommand(con
               server->setChannelNick(lookChannel.mid(1), parameterList[1], 16);
             }
-            else if(lookChannel.startsWith("!"))
+            else if(lookChannel.startsWith("!") && server->isAChannel(lookChannel.mid(1))) // See bug #97354 part 2
             {
               ownerChannels.append(lookChannel.mid(1));
               server->setChannelNick(lookChannel.mid(1), parameterList[1], 8);
             }
-            else if(lookChannel.startsWith("@+"))
+            else if(lookChannel.startsWith("@+")) // See bug #97354 part 1
             {
               opChannels.append(lookChannel.mid(2));
Comment 5 Ismail Donmez 2010-07-01 16:00:54 UTC
commit ddd2d8d7f6204a8f29531483b9b938013d44ac76
Author: İsmail Dönmez <ismail@kde.org>
Date:   Sat Mar 26 18:29:41 2005 +0000

    Fix whois replies containing @+ correctly. Fixes first part of #97354
    CCBUG:97354
    
    svn path=/trunk/kdeextragear-2/konversation/; revision=400820

diff --git a/konversation/inputfilter.cpp b/konversation/inputfilter.cpp
index 347a835..98a66f2 100644
--- a/konversation/inputfilter.cpp
+++ b/konversation/inputfilter.cpp
@@ -889,6 +889,11 @@ void InputFilter::parseServerCommand(const QString &prefix, const QString &comma
               ownerChannels.append(lookChannel.mid(1));
               server->setChannelNick(lookChannel.mid(1), parameterList[1], 8);
             }
+	    else if(lookChannel.startsWith("@+"))
+	    {
+	      opChannels.append(lookChannel.mid(2));
+	      server->setChannelNick(lookChannel.mid(2), parameterList[1], 4);
+	    }
             else if(lookChannel.startsWith("@"))
             {
               opChannels.append(lookChannel.mid(1));