X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientuserinputhandler.cpp;h=3ecf3c420d43e52577b05618036366d722771d18;hp=610a70210c7dff290d2bda57205c95fdb2401437;hb=b619ad78665f63b798389d0f7a33a22da7d93718;hpb=edc446b0c31b048efddaf1943cb85eb0db6a0faa diff --git a/src/client/clientuserinputhandler.cpp b/src/client/clientuserinputhandler.cpp index 610a7021..3ecf3c42 100644 --- a/src/client/clientuserinputhandler.cpp +++ b/src/client/clientuserinputhandler.cpp @@ -20,6 +20,7 @@ #include +#include "buffermodel.h" #include "client.h" #include "clientaliasmanager.h" #include "clientuserinputhandler.h" @@ -59,10 +60,21 @@ void ClientUserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const for(int i = 0; i < clist.count(); i++) { QString cmd = clist.at(i).second.section(' ', 0, 0).remove(0, 1).toUpper(); + QString args = clist.at(i).second.section(' ', 1); if(cmd == "EXEC") - handleExec(clist.at(i).first, clist.at(i).second.section(' ', 1)); - else + handleExec(clist.at(i).first, args); + else { + if(cmd == "JOIN" || cmd == "QUERY") { + BufferId newBufId = Client::networkModel()->bufferId(bufferInfo.networkId(), args.section(' ', 0, 0)); + if(!newBufId.isValid()) { + Client::bufferModel()->switchToBufferAfterCreation(bufferInfo.networkId(), args.section(' ', 0, 0)); + } + else { + Client::bufferModel()->switchToBuffer(newBufId); + } + } emit sendInput(clist.at(i).first, clist.at(i).second); + } } }