+ IrcUser *ircuser = network()->ircUser(serverDecode(params[0]));
+ if(ircuser) {
+ ircuser->setIrcOperator(params.last());
+ }
+ emit displayMsg(Message::Server, "", tr("[Whois] %1").arg(serverDecode(params).join(" ")));
+}
+
+/* RPL_WHOWASUSER - "<nick> <user> <host> * :<real name>" */
+void IrcServerHandler::handle314(QString prefix, QList<QByteArray> params) {
+ Q_UNUSED(prefix)
+ emit displayMsg(Message::Server, "", tr("[Whowas] %1").arg(serverDecode(params).join(" ")));
+}
+
+/* RPL_ENDOFWHO: "<name> :End of WHO list" */
+void IrcServerHandler::handle315(QString prefix, QList<QByteArray> params) {
+ Q_UNUSED(prefix)
+ emit displayMsg(Message::Server, "", tr("[Who] %1").arg(serverDecode(params).join(" ")));
+}
+
+/* RPL_WHOISIDLE - "<nick> <integer> :seconds idle"
+ (real life: "<nick> <integer> <integer> :seconds idle, signon time) */
+ //TODO: parse real life message
+void IrcServerHandler::handle317(QString prefix, QList<QByteArray> params) {
+ Q_UNUSED(prefix)
+ IrcUser *ircuser = network()->ircUser(serverDecode(params[0]));
+ if(ircuser) {
+ QDateTime now = QDateTime::currentDateTime();
+ int idleSecs = serverDecode(params[1]).toInt();
+ idleSecs *= -1;
+ ircuser->setIdleTime(now.addSecs(idleSecs));
+ emit displayMsg(Message::Server, "", tr("[Whois] %1 is idling for %2 seconds").arg(ircuser->nick()).arg(ircuser->idleTime().secsTo(now)));
+ } else {
+ emit displayMsg(Message::Server, "", tr("[Whois] idle message: %1").arg(serverDecode(params).join(" ")));
+ }
+}
+
+/* RPL_ENDOFWHOIS - "<nick> :End of WHOIS list" */
+void IrcServerHandler::handle318(QString prefix, QList<QByteArray> params) {
+ Q_UNUSED(prefix)
+ _whois = false;
+ emit displayMsg(Message::Server, "", tr("[Whois] %1").arg(serverDecode(params).join(" ")));
+}
+
+/* RPL_WHOISCHANNELS - "<nick> :*( ( "@" / "+" ) <channel> " " )" */
+void IrcServerHandler::handle319(QString prefix, QList<QByteArray> params) {
+ Q_UNUSED(prefix)
+ emit displayMsg(Message::Server, "", tr("[Whois] %1").arg(serverDecode(params).join(" ")));
+}
+
+/* RPL_NOTOPIC */
+void IrcServerHandler::handle331(QString prefix, QList<QByteArray> params) {
+ Q_UNUSED(prefix);
+ QString channel = serverDecode(params[0]);
+ network()->ircChannel(channel)->setTopic(QString());
+ emit displayMsg(Message::Server, channel, tr("No topic is set for %1.").arg(channel));
+}
+
+/* RPL_TOPIC */
+void IrcServerHandler::handle332(QString prefix, QList<QByteArray> params) {
+ Q_UNUSED(prefix);
+ QString channel = serverDecode(params[0]);
+ QString topic = bufferDecode(channel, params[1]);
+ network()->ircChannel(channel)->setTopic(topic);
+ emit displayMsg(Message::Server, channel, tr("Topic for %1 is \"%2\"").arg(channel, topic));