-void ClientUserInputHandler::handleQuery(const BufferInfo &bufferInfo, const QString &text) {
- if(text.isEmpty()) {
- Client::messageModel()->insertErrorMessage(bufferInfo, tr("/QUERY expects at least a nick"));
- return;
- }
- switchBuffer(bufferInfo.networkId(), text.section(' ', 0, 0));
- // send to core
- defaultHandler("QUERY", bufferInfo, text);
+
+void ClientUserInputHandler::handleQuery(const BufferInfo &bufferInfo, const QString &text)
+{
+ if (text.isEmpty()) {
+ Client::messageModel()->insertErrorMessage(bufferInfo, tr("/QUERY expects at least a nick"));
+ return;
+ }
+ switchBuffer(bufferInfo.networkId(), text.section(' ', 0, 0));
+ // send to core
+ defaultHandler("QUERY", bufferInfo, text);
+}
+
+
+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());