client: Avoid warning for unused argument
[quassel.git] / src / client / clientuserinputhandler.cpp
index 793f756..0ac69be 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   Copyright (C) 2005-2016 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
 
 #include "clientuserinputhandler.h"
 
+#include "bufferinfo.h"
 #include "buffermodel.h"
 #include "client.h"
 #include "clientaliasmanager.h"
+#include "clientbufferviewconfig.h"
+#include "clientbufferviewmanager.h"
+#include "clientignorelistmanager.h"
 #include "clientsettings.h"
 #include "execwrapper.h"
+#include "ignorelistmanager.h"
 #include "ircuser.h"
+#include "messagemodel.h"
 #include "network.h"
 #include "types.h"
-#include "bufferinfo.h"
-#include "clientbufferviewconfig.h"
-#include "clientbufferviewmanager.h"
-#include "messagemodel.h"
 
 #include <QDateTime>
 
@@ -116,6 +118,35 @@ void ClientUserInputHandler::handleQuery(const BufferInfo &bufferInfo, const QSt
 }
 
 
+void ClientUserInputHandler::handleIgnore(const BufferInfo &bufferInfo, const QString &text)
+{
+    if (text.isEmpty()) {
+        emit Client::instance()->displayIgnoreList("");
+        return;
+    }
+    // If rule contains no ! or @, we assume it is just a nickname, and turn it into an ignore rule for that nick
+    QString rule = (text.contains('!') || text.contains('@')) ? text : text + "!*@*";
+
+    Client::ignoreListManager()->requestAddIgnoreListItem(
+            IgnoreListManager::IgnoreType::SenderIgnore,
+            rule,
+            false,
+            // Use a dynamic ignore rule, for reversibility
+            IgnoreListManager::StrictnessType::SoftStrictness,
+            // Use current network as scope
+            IgnoreListManager::ScopeType::NetworkScope,
+            Client::network(bufferInfo.networkId())->networkName(),
+            true
+    );
+}
+
+void ClientUserInputHandler::handleList(const BufferInfo &bufferInfo, const QString &text)
+{
+    Q_UNUSED(text)
+    Client::instance()->displayChannelList(bufferInfo.networkId());
+}
+
+
 void ClientUserInputHandler::switchBuffer(const NetworkId &networkId, const QString &bufferName)
 {
     BufferId newBufId = Client::networkModel()->bufferId(networkId, bufferName);