From: Manuel Nickschas Date: Mon, 19 Mar 2012 21:56:31 +0000 (+0100) Subject: Fix output for a bunch of numeric server replies X-Git-Tag: 0.8.0~1 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=cd16b79d7152cdd84f9d6df2d37f43514f02b596;ds=sidebyside Fix output for a bunch of numeric server replies First of all, takeFirst() does not work on a const ref *cough*. And second, we should not reorder the param in the message like we did before purely for prettyness; some servers seem to send non-standard strings that then look awkward. Instead, let's just add a colon after the first param. --- diff --git a/src/core/eventstringifier.cpp b/src/core/eventstringifier.cpp index 71665896..688886e1 100644 --- a/src/core/eventstringifier.cpp +++ b/src/core/eventstringifier.cpp @@ -92,13 +92,14 @@ void EventStringifier::processIrcEventNumeric(IrcEventNumeric *e) { displayMsg(e, Message::Error, e->params().join(" "), e->prefix()); break; - // Server error messages, display them in red. First param will be appended. + // Server error messages, display them in red. Colon between first param and rest. case 401: { if(!checkParamCount(e, 1)) return; - QString target = e->params().takeFirst(); - displayMsg(e, Message::Error, e->params().join(" ") + " " + target, e->prefix(), target, Message::Redirected); + QStringList params = e->params(); + QString target = params.takeFirst(); + displayMsg(e, Message::Error, target + ": " + params.join(" "), e->prefix(), target, Message::Redirected); break; } @@ -106,8 +107,9 @@ void EventStringifier::processIrcEventNumeric(IrcEventNumeric *e) { if(!checkParamCount(e, 1)) return; - QString channelName = e->params().takeFirst(); - displayMsg(e, Message::Error, e->params().join(" ") + " " + channelName, e->prefix()); + QStringList params = e->params(); + QString channelName = params.takeFirst(); + displayMsg(e, Message::Error, channelName + ": " + params.join(" "), e->prefix()); break; } @@ -119,8 +121,9 @@ void EventStringifier::processIrcEventNumeric(IrcEventNumeric *e) { if(!checkParamCount(e, 1)) return; - QString p = e->params().takeFirst(); - displayMsg(e, Message::Error, p + ": " + e->params().join(" ")); + QStringList params = e->params(); + QString p = params.takeFirst(); + displayMsg(e, Message::Error, p + ": " + params.join(" ")); break; }