X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcommon%2Fhighlightrulemanager.cpp;h=3fe3691c8a72da423f7d53dcd7b9da3559c36e53;hb=d261638f2e30aa47a08f1c3f43372da0c0e8d13f;hp=21b89329ebedcb03e0f04de07a89cb9418af9172;hpb=63fc3ba0333a0555f6f04d49a45aa321b07d10ac;p=quassel.git diff --git a/src/common/highlightrulemanager.cpp b/src/common/highlightrulemanager.cpp index 21b89329..3fe3691c 100644 --- a/src/common/highlightrulemanager.cpp +++ b/src/common/highlightrulemanager.cpp @@ -145,7 +145,8 @@ bool HighlightRuleManager::match(const QString &msgContents, if (!rule.isEnabled) continue; - if (!rule.chanName.isEmpty() && !scopeMatch(rule.chanName, bufferName)) { + if (!rule.chanName.isEmpty() + && !scopeMatch(bufferName, rule.chanName, rule.isRegEx, rule.isCaseSensitive)) { // A channel name rule is specified and does NOT match the current buffer name, skip // this rule continue; @@ -163,12 +164,8 @@ bool HighlightRuleManager::match(const QString &msgContents, if (rule.sender.isEmpty()) { senderMatch = true; } else { - if (rule.isRegEx) { - rx = QRegExp(rule.sender, rule.isCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive); - } else { - rx = QRegExp(rule.sender, Qt::CaseInsensitive, QRegExp::Wildcard); - } - senderMatch = rx.exactMatch(msgSender); + // A sender name rule is specified, match according to scope rules. + senderMatch = scopeMatch(msgSender, rule.sender, rule.isRegEx, rule.isCaseSensitive); } if (nameMatch && senderMatch) {