From f8e388d65b8a1745c54035f1e871f195fdaca6f6 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Mon, 14 May 2007 22:19:47 +0000 Subject: [PATCH] fixed small bug in handleServerMsg() --- core/server.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/server.cpp b/core/server.cpp index d9ebdc93..494cb970 100644 --- a/core/server.cpp +++ b/core/server.cpp @@ -172,19 +172,21 @@ void Server::handleServerMsg(QString msg) { // next string without a whitespace is the command cmd = msg.section(' ', 0, 0).toUpper(); - msg = msg.section(' ', 1); + msg = msg.mid(cmd.length()); // get the parameters - QString left, trailing; - left = msg.section(" :", 0, 0); - trailing = msg.section(" :", -1, -1); - if(!left.isEmpty()) { - params << left.split(' ', QString::SkipEmptyParts); + QString trailing = ""; + if(msg.contains(" :")) { + trailing = msg.section(" :", 1); + msg = msg.section(" :", 0, 0); + } + if(!msg.isEmpty()) { + params << msg.split(' ', QString::SkipEmptyParts); } if(!trailing.isEmpty()) { params << trailing; } - + // numeric replies have the target as first param (RFC 2812 - 2.4). this is usually our own nick. Remove this! uint num = cmd.toUInt(); if(num > 0) { -- 2.20.1