From 9e637b2c82e4c6222e33f07ce9944794a95b9b1a Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Wed, 20 Feb 2013 20:31:54 +0100 Subject: [PATCH 1/1] Trim the last parameter except for PRIVMSG and NOTICE Just to be sure that we won't encounter any more side-effects with ircds sending random trailing whitespace, let's trim the last parameter except for PRIVMSG and NOTICE. --- src/core/ircparser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/ircparser.cpp b/src/core/ircparser.cpp index f3db4fce..0d473981 100644 --- a/src/core/ircparser.cpp +++ b/src/core/ircparser.cpp @@ -308,6 +308,11 @@ void IrcParser::processNetworkIncoming(NetworkDataEvent *e) for (int i = decParams.count(); i < params.count(); i++) decParams << net->serverDecode(params.at(i)); + // We want to trim the last param just in case, except for PRIVMSG and NOTICE + // ... but those happen to be the only ones not using defaultHandling anyway + if (!decParams.isEmpty() && decParams.last().endsWith(' ')) + decParams.append(decParams.takeLast().trimmed()); + IrcEvent *event; if (type == EventManager::IrcEventNumeric) event = new IrcEventNumeric(num, net, prefix, target); -- 2.20.1