X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fctcpparser.cpp;h=37b0af3e910e69522ddd0dde4cbbb11808cf827e;hp=7517db6f4729756b13e7ac48639099b52103c044;hb=b5e38970ffd55e2dd9f706ce75af9a8d7730b1b8;hpb=04315f46a16fc3627218377071e008b6b9744992 diff --git a/src/core/ctcpparser.cpp b/src/core/ctcpparser.cpp index 7517db6f..37b0af3e 100644 --- a/src/core/ctcpparser.cpp +++ b/src/core/ctcpparser.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 by the Quassel Project * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -24,6 +24,7 @@ #include "coresession.h" #include "ctcpevent.h" #include "messageevent.h" +#include "coreuserinputhandler.h" const QByteArray XDELIM = "\001"; @@ -311,9 +312,13 @@ QByteArray CtcpParser::pack(const QByteArray &ctcpTag, const QByteArray &message void CtcpParser::query(CoreNetwork *net, const QString &bufname, const QString &ctcpTag, const QString &message) { - QList params; - params << net->serverEncode(bufname) << lowLevelQuote(pack(net->serverEncode(ctcpTag), net->userEncode(bufname, message))); - net->putCmd("PRIVMSG", params); + QString cmd("PRIVMSG"); + + std::function(QString &)> cmdGenerator = [&] (QString &splitMsg) -> QList { + return QList() << net->serverEncode(bufname) << lowLevelQuote(pack(net->serverEncode(ctcpTag), net->userEncode(bufname, splitMsg))); + }; + + net->putCmd(cmd, net->splitMessage(cmd, message, cmdGenerator)); }