X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Feventstringifier.cpp;h=ed11d306f6ca381c69275816751e69550de1cfb0;hp=c7da8d78b5279beecdfdf69bfec90977d3ff14d2;hb=900cce213a6ed000b7131a05a0dec7d04b35b023;hpb=dcc541413235e39cc505061950d4aafa89367f98 diff --git a/src/core/eventstringifier.cpp b/src/core/eventstringifier.cpp index c7da8d78..ed11d306 100644 --- a/src/core/eventstringifier.cpp +++ b/src/core/eventstringifier.cpp @@ -28,7 +28,7 @@ EventStringifier::EventStringifier(CoreSession *parent) : BasicHandler("handleCt _coreSession(parent), _whois(false) { - connect(this, SIGNAL(newMessageEvent(Event *)), coreSession()->eventManager(), SLOT(postEvent(Event *))); + connect(this, &EventStringifier::newMessageEvent, coreSession()->eventManager(), &EventManager::postEvent); } @@ -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) @@ -610,13 +618,13 @@ void EventStringifier::processIrcEvent322(IrcEvent *e) 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; }