projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make compile on MSVC again... that thing doesn't know #warning, apparently -_-
[quassel.git]
/
src
/
core
/
ctcphandler.cpp
diff --git
a/src/core/ctcphandler.cpp
b/src/core/ctcphandler.cpp
index
e6b5344
..
a864fe6
100644
(file)
--- a/
src/core/ctcphandler.cpp
+++ b/
src/core/ctcphandler.cpp
@@
-94,7
+94,7
@@
void CtcpHandler::parse(Message::Type messageType, const QString &prefix, const
? CtcpReply
: CtcpQuery;
? CtcpReply
: CtcpQuery;
-
quint8
flags = (messageType == Message::Notice && !network()->isChannelName(target))
+
Message::Flags
flags = (messageType == Message::Notice && !network()->isChannelName(target))
? Message::Redirected
: Message::None;
? Message::Redirected
: Message::None;
@@
-107,15
+107,26
@@
void CtcpHandler::parse(Message::Type messageType, const QString &prefix, const
displayMsg(messageType, target, userDecode(target, dequotedMessage.left(xdelimPos)), prefix, flags);
xdelimEndPos = dequotedMessage.indexOf(XDELIM, xdelimPos + 1);
displayMsg(messageType, target, userDecode(target, dequotedMessage.left(xdelimPos)), prefix, flags);
xdelimEndPos = dequotedMessage.indexOf(XDELIM, xdelimPos + 1);
-
+ if(xdelimEndPos == -1) {
+ // no matching end delimiter found... treat rest of the message as ctcp
+ xdelimEndPos = dequotedMessage.count();
+ }
ctcp = xdelimDequote(dequotedMessage.mid(xdelimPos + 1, xdelimEndPos - xdelimPos - 1));
dequotedMessage = dequotedMessage.mid(xdelimEndPos + 1);
ctcp = xdelimDequote(dequotedMessage.mid(xdelimPos + 1, xdelimEndPos - xdelimPos - 1));
dequotedMessage = dequotedMessage.mid(xdelimEndPos + 1);
-
+
//dispatch the ctcp command
//dispatch the ctcp command
- spacePos = ctcp.indexOf(' ');
QString ctcpcmd = userDecode(target, ctcp.left(spacePos));
QString ctcpparam = userDecode(target, ctcp.mid(spacePos + 1));
QString ctcpcmd = userDecode(target, ctcp.left(spacePos));
QString ctcpparam = userDecode(target, ctcp.mid(spacePos + 1));
+ spacePos = ctcp.indexOf(' ');
+ if(spacePos != -1) {
+ ctcpcmd = userDecode(target, ctcp.left(spacePos));
+ ctcpparam = userDecode(target, ctcp.mid(spacePos + 1));
+ } else {
+ ctcpcmd = userDecode(target, ctcp);
+ ctcpparam = QString();
+ }
+
handle(ctcpcmd, Q_ARG(CtcpType, ctcptype), Q_ARG(QString, prefix), Q_ARG(QString, target), Q_ARG(QString, ctcpparam));
}
handle(ctcpcmd, Q_ARG(CtcpType, ctcptype), Q_ARG(QString, prefix), Q_ARG(QString, target), Q_ARG(QString, ctcpparam));
}
@@
-164,9
+175,8
@@
void CtcpHandler::handlePing(CtcpType ctcptype, const QString &prefix, const QSt
void CtcpHandler::handleVersion(CtcpType ctcptype, const QString &prefix, const QString &target, const QString ¶m) {
Q_UNUSED(target)
if(ctcptype == CtcpQuery) {
void CtcpHandler::handleVersion(CtcpType ctcptype, const QString &prefix, const QString &target, const QString ¶m) {
Q_UNUSED(target)
if(ctcptype == CtcpQuery) {
- // FIXME use real Info about quassel :)
- reply(nickFromMask(prefix), "VERSION", QString("Quassel IRC (v%1 build >= %2) -- http://www.quassel-irc.org")
- .arg(Global::quasselVersion).arg(Global::quasselBuild));
+ reply(nickFromMask(prefix), "VERSION", QString("Quassel IRC %1 (built on %2) -- http://www.quassel-irc.org")
+ .arg(Global::quasselVersion).arg(Global::quasselBuildDate));
emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Received CTCP VERSION request by %1").arg(prefix));
} else {
// display Version answer
emit displayMsg(Message::Server, BufferInfo::StatusBuffer, "", tr("Received CTCP VERSION request by %1").arg(prefix));
} else {
// display Version answer