X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fuserinputhandler.cpp;h=7dec1dc263bddb7d527434ba8428a347b96c2d4b;hb=ecba17040e15e5855f4e8d23320719d36fb3cc76;hp=deddc925f10acfefb189951919ff08652e6f8684;hpb=82dd90f4684db4240311edc13bd3707772e0dbe8;p=quassel.git diff --git a/src/core/userinputhandler.cpp b/src/core/userinputhandler.cpp index deddc925..7dec1dc2 100644 --- a/src/core/userinputhandler.cpp +++ b/src/core/userinputhandler.cpp @@ -37,7 +37,12 @@ void UserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const QStri return; QString cmd; QString msg = msg_; - if(!msg.startsWith('/')) { + // leading slashes indicate there's a command to call unless there is anothere one in the first section (like a path /proc/cpuinfo) + int secondSlashPos = msg.indexOf('/', 1); + int firstSpacePos = msg.indexOf(' '); + if(!msg.startsWith('/') || (secondSlashPos != -1 && (secondSlashPos < firstSpacePos || firstSpacePos == -1))) { + if(msg.startsWith("//")) + msg.remove(0, 1); // //asdf is transformed to /asdf cmd = QString("SAY"); } else { cmd = msg.section(' ', 0, 0).remove(0, 1).toUpper();