- // check if we addressed a user and update its timestamp in that case
- if(bufferInfo.type() == BufferInfo::ChannelBuffer) {
- if(!msg.startsWith('/')) {
- if(_nickRx.indexIn(msg) == 0) {
- const Network *net = Client::network(bufferInfo.networkId());
- IrcUser *user = net ? net->ircUser(_nickRx.cap(1)) : 0;
- if(user)
- user->setLastSpokenTo(bufferInfo.bufferId(), QDateTime::currentDateTime().toUTC());
+
+ if(!msg.startsWith('/')) {
+ if(_nickRx.indexIn(msg) == 0) {
+ const Network *net = Client::network(bufferInfo.networkId());
+ IrcUser *user = net ? net->ircUser(_nickRx.cap(1)) : 0;
+ if(user)
+ user->setLastSpokenTo(bufferInfo.bufferId(), QDateTime::currentDateTime().toUTC());
+ }
+ }
+
+ AliasManager::CommandList clist = Client::aliasManager()->processInput(bufferInfo, msg);
+
+ 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") {
+ if(args.section(' ', 0, 0).isEmpty()) {
+ continue;
+ }
+ 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);
+ }