#include "util.h"
#include "message.h"
-CtcpHandler::CtcpHandler(Server *parent)
+CtcpHandler::CtcpHandler(NetworkConnection *parent)
: BasicHandler(parent) {
QString MQUOTE = QString('\020');
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;
}
// 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);
// 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));
}
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"));
}
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));
}