/***************************************************************************
- * Copyright (C) 2005-2013 by the Quassel Project *
+ * Copyright (C) 2005-2016 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
case 253:
case 254:
case 255:
+ case 256:
+ case 257:
+ case 258:
+ case 259:
case 265:
case 266:
case 372:
break;
// Server error messages without param, just display them
+ case 263:
case 409:
case 411:
case 412:
case 376:
break;
- // CAP stuff
- case 900:
- case 903:
- case 904:
- case 905:
- case 906:
- case 907:
+ // SASL authentication stuff
+ // See: http://ircv3.net/specs/extensions/sasl-3.1.html
+ case 900: // RPL_LOGGEDIN
+ case 901: // RPL_LOGGEDOUT
{
- displayMsg(e, Message::Info, "CAP: " + e->params().join(""));
+ // :server 900 <nick> <nick>!<ident>@<host> <account> :You are now logged in as <user>
+ // :server 901 <nick> <nick>!<ident>@<host> :You are now logged out
+ if (!checkParamCount(e, 3))
+ return;
+ displayMsg(e, Message::Server, "SASL: " + e->params().at(2));
+ break;
+ }
+ // Ignore SASL success, partially redundant with RPL_LOGGEDIN and RPL_LOGGEDOUT
+ case 903: // RPL_SASLSUCCESS :server 903 <nick> :SASL authentication successful
+ break;
+ case 902: // ERR_NICKLOCKED :server 902 <nick> :You must use a nick assigned to you
+ case 904: // ERR_SASLFAIL :server 904 <nick> :SASL authentication failed
+ case 905: // ERR_SASLTOOLONG :server 905 <nick> :SASL message too long
+ case 906: // ERR_SASLABORTED :server 906 <nick> :SASL authentication aborted
+ case 907: // ERR_SASLALREADY :server 907 <nick> :You have already authenticated using SASL
+ case 908: // RPL_SASLMECHS :server 908 <nick> <mechanisms> :are available SASL mechanisms
+ {
+ displayMsg(e, Message::Server, "SASL: " + e->params().join(""));
break;
}
int idleSecs = e->params()[1].toInt();
if (e->params().count() > 3) { // if we have more then 3 params we have the above mentioned "real life" situation
- QDateTime loginTime = QDateTime::fromTime_t(e->params()[2].toInt());
+ QDateTime loginTime = QDateTime::fromTime_t(e->params()[2].toInt()).toUTC();
displayMsg(e, Message::Server, tr("[Whois] %1 is logged in since %2")
- .arg(e->params()[0], QLocale().toString(loginTime, QLocale().dateTimeFormat())));
+ .arg(e->params()[0], loginTime.toString("yyyy-MM-dd hh:mm:ss UTC")));
}
- QDateTime idlingSince = e->timestamp().toLocalTime().addSecs(-idleSecs);
+ QDateTime idlingSince = e->timestamp().toLocalTime().addSecs(-idleSecs).toUTC();
displayMsg(e, Message::Server, tr("[Whois] %1 is idling for %2 (since %3)")
.arg(e->params()[0], secondsToString(idleSecs),
- QLocale().toString(idlingSince, QLocale().dateTimeFormat())));
+ idlingSince.toString("yyyy-MM-dd hh:mm:ss UTC")));
}
qWarning() << Q_FUNC_INFO << "received invalid timestamp:" << e->params()[1];
return;
}
- QDateTime time = QDateTime::fromTime_t(unixtime);
+ QDateTime time = QDateTime::fromTime_t(unixtime).toUTC();
displayMsg(e, Message::Topic, tr("Channel %1 created on %2")
- .arg(channel, QLocale().toString(time, QLocale().dateTimeFormat())),
+ .arg(channel, time.toString("yyyy-MM-dd hh:mm:ss UTC")),
QString(), channel);
}
return;
QString channel = e->params().first();
- QDateTime topicSetTime = QDateTime::fromTime_t(e->params()[2].toInt());
+ QDateTime topicSetTime = QDateTime::fromTime_t(e->params()[2].toInt()).toUTC();
displayMsg(e, Message::Topic, tr("Topic set by %1 on %2")
.arg(e->params()[1],
- QLocale().toString(topicSetTime, QLocale().dateTimeFormat())), QString(), channel);
+ topicSetTime.toString("yyyy-MM-dd hh:mm:ss UTC")), QString(), channel);
}
}
+/* RPL_WHOSPCRPL: "<yournick> <num> #<channel> ~<ident> <host> <servname> <nick>
+ ("H"/ "G") <account> :<realname>"
+Could be anything else, though. User-specified fields.
+See http://faerion.sourceforge.net/doc/irc/whox.var */
+void EventStringifier::processIrcEvent354(IrcEvent *e)
+{
+ displayMsg(e, Message::Server, tr("[WhoX] %1").arg(e->params().join(" ")));
+}
+
+
/* RPL_ENDOFWHOWAS - "<nick> :End of WHOWAS" */
void EventStringifier::processIrcEvent369(IrcEvent *e)
{
if (e->ctcpType() == CtcpEvent::Query)
defaultHandler(e->ctcpCmd(), e);
else {
- displayMsg(e, Message::Server, tr("Received CTCP-PING answer from %1 with %2 seconds round trip time")
- .arg(nickFromMask(e->prefix())).arg(QDateTime::fromTime_t(e->param().toInt()).secsTo(e->timestamp())));
+ displayMsg(e, Message::Server, tr("Received CTCP-PING answer from %1 with %2 milliseconds round trip time")
+ .arg(nickFromMask(e->prefix())).arg(QDateTime::fromMSecsSinceEpoch(e->param().toULongLong()).msecsTo(e->timestamp())));
}
}