/***************************************************************************
- * Copyright (C) 2005-2010 by the Quassel Project *
+ * Copyright (C) 2005-2012 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
QByteArray XQUOTE = QByteArray("\134");
_ctcpXDelimDequoteHash[XQUOTE + XQUOTE] = XQUOTE;
_ctcpXDelimDequoteHash[XQUOTE + QByteArray("a")] = XDELIM;
+
+ connect(this, SIGNAL(newEvent(Event *)), _coreSession->eventManager(), SLOT(postEvent(Event *)));
}
void CtcpParser::displayMsg(NetworkEvent *event, Message::Type msgType, const QString &msg, const QString &sender,
MessageEvent *msgEvent = new MessageEvent(msgType, event->network(), msg, sender, target, msgFlags);
msgEvent->setTimestamp(event->timestamp());
- coreSession()->eventManager()->sendEvent(msgEvent);
+ emit newEvent(msgEvent);
}
QByteArray CtcpParser::lowLevelQuote(const QByteArray &message) {
ctcpcmd = ctcpcmd.toUpper();
- if(!coreSession()->ignoreListManager()->ctcpMatch(e->prefix(), e->network()->networkName(), ctcpcmd)) {
+ // we don't want to block /me messages by the CTCP ignore list
+ if(ctcpcmd == QLatin1String("ACTION") || !coreSession()->ignoreListManager()->ctcpMatch(e->prefix(), e->network()->networkName(), ctcpcmd)) {
if(uuid.isNull())
uuid = QUuid::createUuid();
ctcptype, "INVALID", QString(), e->timestamp(), uuid);
ctcpEvents << flushEvent;
foreach(CtcpEvent *event, ctcpEvents) {
- coreSession()->eventManager()->sendEvent(event);
+ emit newEvent(event);
}
}
answerSize += replies.at(i).size();
}
- QByteArray quotedReply(answerSize, 0);
- int nextPos = 0;
- QByteArray &reply = quotedReply;
+ QByteArray quotedReply;
+ quotedReply.reserve(answerSize);
for(int i = 0; i < replies.count(); i++) {
- reply = replies.at(i);
- quotedReply.replace(nextPos, reply.size(), reply);
- nextPos += reply.size();
+ quotedReply.append(replies.at(i));
}
params << net->serverEncode(bufname) << quotedReply;