X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fclient%2Fclientuserinputhandler.cpp;h=3ecf3c420d43e52577b05618036366d722771d18;hp=049b9d3d5de057a099a41d79260d8546e960c464;hb=b619ad78665f63b798389d0f7a33a22da7d93718;hpb=6d32c3e6a04a358789c469948d044715d6fb5aed diff --git a/src/client/clientuserinputhandler.cpp b/src/client/clientuserinputhandler.cpp index 049b9d3d..3ecf3c42 100644 --- a/src/client/clientuserinputhandler.cpp +++ b/src/client/clientuserinputhandler.cpp @@ -20,10 +20,12 @@ #include +#include "buffermodel.h" #include "client.h" #include "clientaliasmanager.h" #include "clientuserinputhandler.h" #include "clientsettings.h" +#include "execwrapper.h" #include "ircuser.h" #include "network.h" @@ -54,8 +56,29 @@ void ClientUserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const } } - AliasManager::CommandList clist = _aliasManager.processInput(bufferInfo, msg); + AliasManager::CommandList clist = Client::aliasManager()->processInput(bufferInfo, msg); - for(int i = 0; i < clist.count(); i++) - emit sendInput(clist.at(i).first, clist.at(i).second); + 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, 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); + } + } +} + +void ClientUserInputHandler::handleExec(const BufferInfo &bufferInfo, const QString &execString) { + ExecWrapper *exec = new ExecWrapper(this); // gets suicidal when it's done + exec->start(bufferInfo, execString); }