From: Marcus Eggenberger Date: Mon, 14 May 2007 22:19:47 +0000 (+0000) Subject: fixed small bug in handleServerMsg() X-Git-Tag: 0.1.0~242 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=f8e388d65b8a1745c54035f1e871f195fdaca6f6;ds=sidebyside fixed small bug in handleServerMsg() --- 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) {