-void EventStringifier::processIrcEvent319(IrcEvent *e) {
- if(!checkParamCount(e, 2))
- return;
-
- QString nick = e->params().first();
- QStringList op;
- QStringList voice;
- QStringList user;
- foreach(QString channel, e->params().last().split(" ")) {
- if(channel.startsWith("@"))
- op.append(channel.remove(0,1));
- else if(channel.startsWith("+"))
- voice.append(channel.remove(0,1));
- else
- user.append(channel);
- }
- if(!user.isEmpty())
- displayMsg(e, Message::Server, tr("[Whois] %1 is a user on channels: %2").arg(nick, user.join(" ")));
- if(!voice.isEmpty())
- displayMsg(e, Message::Server, tr("[Whois] %1 has voice on channels: %2").arg(nick, voice.join(" ")));
- if(!op.isEmpty())
- displayMsg(e, Message::Server, tr("[Whois] %1 is an operator on channels: %2").arg(nick, op.join(" ")));
+void EventStringifier::processIrcEvent319(IrcEvent *e)
+{
+ if (!checkParamCount(e, 2))
+ return;
+
+ QString nick = e->params().first();
+ QStringList op;
+ QStringList voice;
+ QStringList user;
+ foreach(QString channel, e->params().last().split(" ")) {
+ if (channel.startsWith("@"))
+ op.append(channel.remove(0, 1));
+ else if (channel.startsWith("+"))
+ voice.append(channel.remove(0, 1));
+ else
+ user.append(channel);
+ }
+ if (!user.isEmpty())
+ displayMsg(e, Message::Server, tr("[Whois] %1 is a user on channels: %2").arg(nick, user.join(" ")));
+ if (!voice.isEmpty())
+ displayMsg(e, Message::Server, tr("[Whois] %1 has voice on channels: %2").arg(nick, voice.join(" ")));
+ if (!op.isEmpty())
+ displayMsg(e, Message::Server, tr("[Whois] %1 is an operator on channels: %2").arg(nick, op.join(" ")));
+}
+
+
+/* RPL_LIST - "<channel> <# visible> :<topic>" */
+void EventStringifier::processIrcEvent322(IrcEvent *e)
+{
+ QString channelName;
+ quint32 userCount = 0;
+ QString topic;
+
+ switch (e->params().count()) {
+ case 3:
+ topic = e->params()[2];
+ case 2:
+ userCount = e->params()[1].toUInt();
+ case 1:
+ channelName = e->params()[0];
+ default:
+ break;
+ }
+ displayMsg(e, Message::Server, tr("Channel %1 has %2 users. Topic is: \"%3\"")
+ .arg(channelName).arg(userCount).arg(topic));
+}
+
+
+/* RPL_LISTEND ":End of LIST" */
+void EventStringifier::processIrcEvent323(IrcEvent *e)
+{
+ displayMsg(e, Message::Server, tr("End of channel list"));
+}
+
+
+/* RPL_CHANNELMODEIS - "<channel> <mode> <mode params>" */
+void EventStringifier::processIrcEvent324(IrcEvent *e)
+{
+ processIrcEventMode(e);
+}
+
+
+/* RPL_??? - "<channel> <homepage> */
+void EventStringifier::processIrcEvent328(IrcEvent *e)
+{
+ if (!checkParamCount(e, 2))
+ return;
+
+ QString channel = e->params()[0];
+ displayMsg(e, Message::Topic, tr("Homepage for %1 is %2").arg(channel, e->params()[1]), QString(), channel);
+}
+
+
+/* RPL_??? - "<channel> <creation time (unix)>" */
+void EventStringifier::processIrcEvent329(IrcEvent *e)
+{
+ if (!checkParamCount(e, 2))
+ return;
+
+ QString channel = e->params()[0];
+ uint unixtime = e->params()[1].toUInt();
+ if (!unixtime) {
+ qWarning() << Q_FUNC_INFO << "received invalid timestamp:" << e->params()[1];
+ return;
+ }
+ QDateTime time = QDateTime::fromTime_t(unixtime).toUTC();
+ displayMsg(e, Message::Topic, tr("Channel %1 created on %2")
+ .arg(channel, time.toString("yyyy-MM-dd hh:mm:ss UTC")),
+ QString(), channel);