-void ClientUserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const QString &msg_) {
- QString msg = msg_;
-
- if(!_initialized) { // aliases not yet synced
- _inputBuffer.append(qMakePair(bufferInfo, msg));
- return;
- }
-
- // leading slashes indicate there's a command to call unless there is another 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
-
- // 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());
- }
- }
+void ClientUserInputHandler::handleUserInput(const BufferInfo &bufferInfo, const QString &msg) {
+
+ 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());