qa: Replace [[fallthrough]] by [[clang::fallthrough]]
[quassel.git] / src / core / coresessioneventprocessor.cpp
index ad59890..47b1673 100644 (file)
@@ -449,6 +449,21 @@ void CoreSessionEventProcessor::processIrcEventTopic(IrcEvent *e)
     }
 }
 
+/* ERROR - "ERROR :reason"
+Example:  ERROR :Closing Link: nickname[xxx.xxx.xxx.xxx] (Large base64 image paste.)
+See https://tools.ietf.org/html/rfc2812#section-3.7.4 */
+void CoreSessionEventProcessor::processIrcEventError(IrcEvent *e)
+{
+    if (!checkParamCount(e, 1))
+        return;
+
+    if (coreNetwork(e)->disconnectExpected()) {
+        // During QUIT, the server should send an error (often, but not always, "Closing Link"). As
+        // we're expecting it, don't show this to the user.
+        e->setFlag(EventManager::Silent);
+    }
+}
+
 
 #ifdef HAVE_QCA2
 void CoreSessionEventProcessor::processKeyEvent(KeyEvent *e)
@@ -703,10 +718,13 @@ void CoreSessionEventProcessor::processIrcEvent322(IrcEvent *e)
     switch (e->params().count()) {
     case 3:
         topic = e->params()[2];
+        [[clang::fallthrough]];
     case 2:
         userCount = e->params()[1].toUInt();
+        [[clang::fallthrough]];
     case 1:
         channelName = e->params()[0];
+        [[clang::fallthrough]];
     default:
         break;
     }