void EventStringifier::processIrcEventPong(IrcEvent *e)
{
- QString timestamp = e->params().at(1);
- QTime sendTime = QTime::fromString(timestamp, "hh:mm:ss.zzz");
- if (!sendTime.isValid())
- displayMsg(e, Message::Server, "PONG " + e->params().join(" "), e->prefix());
+ // CoreSessionEventProcessor will flag automated PONG replies as EventManager::Silent. There's
+ // no need to handle that specially here.
+
+ // Format the PONG reply for display
+ displayMsg(e, Message::Server, "PONG " + e->params().join(" "), e->prefix());
}
QDateTime now = QDateTime::currentDateTime();
now.setTimeSpec(Qt::UTC);
// Don't print "user is away" messages more often than this
- const int silenceTime = 60;
- if (ircuser->lastAwayMessageTime().addSecs(silenceTime) >= now)
+ // 1 hour = 60 min * 60 sec
+ const int silenceTime = 60 * 60;
+ // Check if away state has NOT changed and silence time hasn't yet elapsed
+ if (!ircuser->hasAwayChanged()
+ && ircuser->lastAwayMessageTime().addSecs(silenceTime) >= now) {
+ // Away message hasn't changed and we're still within the period of silence; don't
+ // repeat the message
send = false;
+ }
ircuser->setLastAwayMessageTime(now);
+ // Mark any changes in away as acknowledged
+ ircuser->acknowledgeAwayChanged();
}
}
if (send)
switch (e->params().count()) {
case 3:
topic = e->params()[2];
- [[clang::fallthrough]];
+ // fallthrough
case 2:
userCount = e->params()[1].toUInt();
- [[clang::fallthrough]];
+ /* fallthrough */
case 1:
channelName = e->params()[0];
- [[clang::fallthrough]];
+ // blubb
default:
break;
}