[Konversation-devel] [Bug 214258] Commands like /op and /deop cause an invalid MODE command to be send preceding a correct one

Travis McHenry wordsizzle at gmail.com
Tue Dec 15 23:08:35 CET 2009


https://bugs.kde.org/show_bug.cgi?id=214258


Travis McHenry <wordsizzle at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED




--- Comment #3 from Travis McHenry <wordsizzle gmail com>  2009-12-15 23:08:33 ---
commit 446b3bc892090221aa37b6a2c83901c0ea7b92a7
Author: Travis McHenry <wordsizzle at gmail.com>
Date:   Tue Dec 15 14:58:24 2009 -0700

    Fix the number of mode chars sent in op/deop

    Previously the modes portion would fill up for all the nicks
    so if you had 5 nicks, that would split into two lines with 3
    on the first and 2 on the second. But on both you would have 5
    mode chars. Now we add one mode per nick at the same time the
    nick is added.
    BUG:214258

diff --git a/src/irc/outputfilter.cpp b/src/irc/outputfilter.cpp
index fc43d69..fd9cb8b 100644
--- a/src/irc/outputfilter.cpp
+++ b/src/irc/outputfilter.cpp
@@ -1866,25 +1866,30 @@ namespace Konversation
             // Only continue if there was no error
             if(token.length())
             {
-                unsigned int modeCount = nickList.count();
-                QString modes;
-                modes.fill(mode, modeCount);
+                QString modeToken;
+                QString nickToken;
+
+                modeToken = QString(" ") + QChar(giveTake);

-                token += QString(" ") + QChar(giveTake) + modes;
                 tmpToken = token;

-                for(unsigned int index = 0; index < modeCount; index++)
+                for(int index = 0; index < nickList.count(); index++)
                 {
                     if(index != 0 && (index % 3) == 0)
                     {
+                        token += modeToken + nickToken;
                         result.toServerList.append(token);
                         token = tmpToken;
+                        nickToken = QString();
+                        modeToken = QString(" ") + QChar(giveTake);
                     }
-                    token += ' ' + nickList[index];
+                    nickToken += ' ' + nickList[index];
+                    modeToken += mode;
                 }

-                if(token != tmpToken)
+                if(!nickToken.isEmpty())
                 {
+                    token += modeToken + nickToken;
                     result.toServerList.append(token);
                 }
             }

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Konversation-devel mailing list