X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fctcpparser.cpp;h=37b0af3e910e69522ddd0dde4cbbb11808cf827e;hp=ddaea7aa570f5e23273406a32338c21b97035549;hb=b5e38970ffd55e2dd9f706ce75af9a8d7730b1b8;hpb=9d54503555534a2c554f09a33df6afa33d6308ec diff --git a/src/core/ctcpparser.cpp b/src/core/ctcpparser.cpp index ddaea7aa..37b0af3e 100644 --- a/src/core/ctcpparser.cpp +++ b/src/core/ctcpparser.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2014 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)); }