From ca0390418a6ca30eae315aa84db7811b692e76db Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Tue, 22 Jan 2008 11:45:38 +0000 Subject: [PATCH] Fixed the empty line bug when handling CTCP messages. While doing so, I found another bug which falls into sputs domain... --- src/core/ctcphandler.cpp | 11 +++++++++-- version.inc | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/ctcphandler.cpp b/src/core/ctcphandler.cpp index f902baab..e1f4dc84 100644 --- a/src/core/ctcphandler.cpp +++ b/src/core/ctcphandler.cpp @@ -48,7 +48,7 @@ QString CtcpHandler::dequote(QString message) { if(i+1 < message.size()) { for(ctcpquote = ctcpMDequoteHash.begin(); ctcpquote != ctcpMDequoteHash.end(); ++ctcpquote) { if(message.mid(i,2) == ctcpquote.key()) { - dequotedMessage += ctcpquote.value(); + messagepart = ctcpquote.value(); i++; break; } @@ -90,7 +90,8 @@ QStringList CtcpHandler::parse(CtcpType ctcptype, QString prefix, QString target // extract tagged / extended data while(dequotedMessage.contains(XDELIM)) { - messages << dequotedMessage.section(XDELIM,0,0); + if(dequotedMessage.indexOf(XDELIM) > 0) + messages << dequotedMessage.section(XDELIM,0,0); ctcp = XdelimDequote(dequotedMessage.section(XDELIM,1,1)); dequotedMessage = dequotedMessage.section(XDELIM,2,2); @@ -126,10 +127,12 @@ void CtcpHandler::reply(QString bufname, QString ctcpTag, QString message) { // CTCP HANDLER //******************************/ void CtcpHandler::handleAction(CtcpType ctcptype, QString prefix, QString target, QString param) { + Q_UNUSED(ctcptype) emit displayMsg(Message::Action, target, param, prefix); } void CtcpHandler::handlePing(CtcpType ctcptype, QString prefix, QString target, QString param) { + Q_UNUSED(target) if(ctcptype == CtcpQuery) { reply(nickFromMask(prefix), "PING", param); emit displayMsg(Message::Server, "", tr("Received CTCP PING request from %1").arg(prefix)); @@ -139,6 +142,7 @@ void CtcpHandler::handlePing(CtcpType ctcptype, QString prefix, QString target, } void CtcpHandler::handleVersion(CtcpType ctcptype, QString prefix, QString target, QString param) { + Q_UNUSED(target) if(ctcptype == CtcpQuery) { // FIXME use real Info about quassel :) reply(nickFromMask(prefix), "VERSION", QString("Quassel IRC (Pre-Release) - http://www.quassel-irc.org")); @@ -149,6 +153,9 @@ void CtcpHandler::handleVersion(CtcpType ctcptype, QString prefix, QString targe } void CtcpHandler::defaultHandler(QString cmd, CtcpType ctcptype, QString prefix, QString target, QString param) { + Q_UNUSED(ctcptype); + Q_UNUSED(target); + Q_UNUSED(param); emit displayMsg(Message::Error, "", tr("Received unknown CTCP %1 by %2").arg(cmd).arg(prefix)); } diff --git a/version.inc b/version.inc index 70f85d4a..7f383088 100644 --- a/version.inc +++ b/version.inc @@ -5,7 +5,7 @@ quasselVersion = "0.2.0-pre"; quasselDate = "2008-01-21"; - quasselBuild = 370; + quasselBuild = 372; //! Minimum client build number the core needs clientBuildNeeded = 358; -- 2.20.1