X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fnetworkmodelcontroller.cpp;h=588071c1d5009f52468afb482b49add94c811c77;hp=cb882f81b1dd3df5c0ce8f5f02d1c19deafc642f;hb=c5569840d50b68a518d474917be804efc543c088;hpb=f19fea582ace1d8f3dfe29c1096c48758079e56e diff --git a/src/uisupport/networkmodelcontroller.cpp b/src/uisupport/networkmodelcontroller.cpp index cb882f81..588071c1 100644 --- a/src/uisupport/networkmodelcontroller.cpp +++ b/src/uisupport/networkmodelcontroller.cpp @@ -366,9 +366,6 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action) if(!bufferInfo.isValid()) continue; - // the validity of that cast is checked on contextmenu creation, take care - IrcUser *ircUser = qobject_cast(index.data(NetworkModel::IrcUserRole).value()); - switch(type) { case NickWhois: Client::userInput(bufferInfo, QString("/WHOIS %1 %1").arg(nick)); @@ -414,36 +411,51 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action) Client::userInput(bufferInfo, QString("/QUERY %1").arg(nick)); break; case NickIgnoreUser: + { + IrcUser *ircUser = qobject_cast(index.data(NetworkModel::IrcUserRole).value()); + if(!ircUser) + break; Client::ignoreListManager()->requestAddIgnoreListItem(IgnoreListManager::SenderIgnore, - action->text(), + action->property("ignoreRule").toString(), false, IgnoreListManager::SoftStrictness, IgnoreListManager::NetworkScope, ircUser->network()->networkName(), true); break; + } case NickIgnoreHost: + { + IrcUser *ircUser = qobject_cast(index.data(NetworkModel::IrcUserRole).value()); + if(!ircUser) + break; Client::ignoreListManager()->requestAddIgnoreListItem(IgnoreListManager::SenderIgnore, - action->text(), + action->property("ignoreRule").toString(), false, IgnoreListManager::SoftStrictness, IgnoreListManager::NetworkScope, ircUser->network()->networkName(), true); break; + } case NickIgnoreDomain: + { + IrcUser *ircUser = qobject_cast(index.data(NetworkModel::IrcUserRole).value()); + if(!ircUser) + break; Client::ignoreListManager()->requestAddIgnoreListItem(IgnoreListManager::SenderIgnore, - action->text(), + action->property("ignoreRule").toString(), false, IgnoreListManager::SoftStrictness, IgnoreListManager::NetworkScope, ircUser->network()->networkName(), true); break; + } case NickIgnoreCustom: // forward that to mainwin since we can access the settingspage only from there - emit showIgnoreList(ircUser->hostmask()); + emit showIgnoreList(action->property("ignoreRule").toString()); break; case NickIgnoreToggleEnabled0: case NickIgnoreToggleEnabled1: case NickIgnoreToggleEnabled2: case NickIgnoreToggleEnabled3: case NickIgnoreToggleEnabled4: - Client::ignoreListManager()->requestToggleIgnoreRule(action->text()); + Client::ignoreListManager()->requestToggleIgnoreRule(action->property("ignoreRule").toString()); break; default: qWarning() << "Unhandled nick action";