From 026199305d921c1ddbe706cd0da86ae058f48647 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Thu, 7 May 2009 20:01:09 +0200 Subject: [PATCH] Handle ircd reply 329 (channel creation time) The warning to implement this has been around for over a year now, just because nobody ever bothered to finally stab those few lines into the core :) --- src/core/ircserverhandler.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/core/ircserverhandler.cpp b/src/core/ircserverhandler.cpp index 92eaf68d..563e6f07 100644 --- a/src/core/ircserverhandler.cpp +++ b/src/core/ircserverhandler.cpp @@ -823,11 +823,18 @@ void IrcServerHandler::handle324(const QString &prefix, const QList /* RPL_??? - " " */ void IrcServerHandler::handle329(const QString &prefix, const QList ¶ms) { Q_UNUSED(prefix); - Q_UNUSED(params) -#ifdef __GNUC__ -# warning "Implement handle329 (Channel creation time)" -#endif - // FIXME implement this... + if(!checkParamCount("IrcServerHandler::handle329()", params, 2)) + return; + + QString channel = serverDecode(params[0]); + uint unixtime = params[1].toUInt(); + if(!unixtime) { + qWarning() << Q_FUNC_INFO << "received invalid timestamp:" << params[1]; + return; + } + QDateTime time = QDateTime::fromTime_t(unixtime); + + emit displayMsg(Message::Server, BufferInfo::ChannelBuffer, channel, tr("Channel %1 created on %2").arg(channel, time.toString())); } /* RPL_NOTOPIC */ -- 2.20.1