CVS commit by johnflux: Fixed a bug so that we now allow nicks to have both op and voice at the same time. M +1 -1 inputfilter.cpp 1.129 M +29 -43 server.cpp 1.272 M +2 -2 server.h 1.132 --- kdeextragear-2/konversation/konversation/inputfilter.cpp #1.128:1.129 @@ -868,5 +868,5 @@ void InputFilter::parseServerCommand(con // remove possible mode characters from nickname and store the resulting mode - server->mangleNicknameWithModes(nickname,admin,owner,op,halfop,voice,NULL); + server->mangleNicknameWithModes(nickname,admin,owner,op,halfop,voice); // TODO: make these an enumeration in KApplication or somewhere, we can use them from channel.cpp as well --- kdeextragear-2/konversation/konversation/server.cpp #1.271:1.272 @@ -473,6 +473,6 @@ void Server::setPrefixes(const QString & // return a nickname without possible mode character at the beginning -bool Server::mangleNicknameWithModes(QString& nickname,bool& isAdmin,bool& isOwner, - bool& isOp,bool& isHalfop,bool& hasVoice,char* realMode ) +void Server::mangleNicknameWithModes(QString& nickname,bool& isAdmin,bool& isOwner, + bool& isOp,bool& isHalfop,bool& hasVoice) { isAdmin=false; @@ -481,26 +481,15 @@ bool Server::mangleNicknameWithModes(QSt isHalfop=false; hasVoice=false; - - if(realMode) - { - *realMode=' '; - } - // try to find a prefix - int modeIndex=serverNickPrefixes.find(nickname[0]); - if(modeIndex==-1) - { - // nothing to do, if it was not found. - // remember that we've set up RFC1459 compatible serverNickPrefixes - return false; - } - if(realMode) - { - *realMode=nickname[0].latin1(); - } - // cut off the prefix + int modeIndex; + Q_ASSERT(!nickname.isEmpty()); if(nickname.isEmpty()) return; + while( (modeIndex=serverNickPrefixes.find(nickname[0])) != -1) { + Q_ASSERT(!nickname.isEmpty()); if(nickname.isEmpty()) return; nickname=nickname.mid(1); + // cut off the prefix + bool recognisedMode=false; // determine, whether status is like op or like voice - while(static_cast(modeIndex)