X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Feventstringifier.cpp;h=b8c67b9e898529efeec49f156443add9ed78f9a3;hp=f43e547a11c44d6255960f47ebd0aecaa0c00d32;hb=f12d6496251729f7d21f4fbcb0814dec7fba4b75;hpb=41a136e99bffde8e203fb1abff7c9affbbb16a8b diff --git a/src/core/eventstringifier.cpp b/src/core/eventstringifier.cpp index f43e547a..b8c67b9e 100644 --- a/src/core/eventstringifier.cpp +++ b/src/core/eventstringifier.cpp @@ -453,10 +453,18 @@ void EventStringifier::processIrcEvent301(IrcEvent *e) 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)