X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fignorelistmanager.cpp;h=b01273eda3af01b6572d5a5258ad7990f00d86bf;hp=8919b670fc98d406beeca536875b86df941d8683;hb=aec9c711900a443bfa7860fa86c6e9c86b81a3e7;hpb=68878dc8366f2f4a0afe132847aad9a51a80cdbf diff --git a/src/common/ignorelistmanager.cpp b/src/common/ignorelistmanager.cpp index 8919b670..b01273ed 100644 --- a/src/common/ignorelistmanager.cpp +++ b/src/common/ignorelistmanager.cpp @@ -136,8 +136,8 @@ IgnoreListManager::StrictnessType IgnoreListManager::_match(const QString &msgCo if (!item.isActive || item.type == CtcpIgnore) continue; if (item.scope == GlobalScope - || (item.scope == NetworkScope && scopeMatch(item.scopeRule, network)) - || (item.scope == ChannelScope && scopeMatch(item.scopeRule, bufferName))) { + || (item.scope == NetworkScope && scopeMatch(network, item.scopeRule)) + || (item.scope == ChannelScope && scopeMatch(bufferName, item.scopeRule))) { QString str; if (item.type == MessageIgnore) str = msgContents; @@ -160,20 +160,6 @@ IgnoreListManager::StrictnessType IgnoreListManager::_match(const QString &msgCo } -bool IgnoreListManager::scopeMatch(const QString &scopeRule, const QString &string) const -{ - foreach(QString rule, scopeRule.split(";")) { - QRegExp ruleRx = QRegExp(rule.trimmed()); - ruleRx.setCaseSensitivity(Qt::CaseInsensitive); - ruleRx.setPatternSyntax(QRegExp::Wildcard); - if (ruleRx.exactMatch(string)) { - return true; - } - } - return false; -} - - void IgnoreListManager::removeIgnoreListItem(const QString &ignoreRule) { removeAt(indexOf(ignoreRule)); @@ -196,7 +182,7 @@ bool IgnoreListManager::ctcpMatch(const QString sender, const QString &network, foreach(IgnoreListItem item, _ignoreList) { if (!item.isActive) continue; - if (item.scope == GlobalScope || (item.scope == NetworkScope && scopeMatch(item.scopeRule, network))) { + if (item.scope == GlobalScope || (item.scope == NetworkScope && scopeMatch(network, item.scopeRule))) { QString sender_; QStringList types = item.ignoreRule.split(QRegExp("\\s+"), QString::SkipEmptyParts);