From e5b8fc0964deb7aea9aa38ec3e934841d3ade7e7 Mon Sep 17 00:00:00 2001 From: Georgiy Tugai Date: Wed, 14 Dec 2016 01:53:30 +1030 Subject: [PATCH] Fix highlight match behaviour Documentation states that, in the 'highlight' field, both positive and negative matches terminate the search. This patch brings znc-push's behaviour in line with said documentation. --- push.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/push.cpp b/push.cpp index 0acd91c..1597731 100755 --- a/push.cpp +++ b/push.cpp @@ -869,9 +869,6 @@ class CPushMod : public CModule options["highlight"].Split(" ", values, false); values.push_back("%nick%"); - bool matched = false; - bool negated = false; - for (VCString::iterator i = values.begin(); i != values.end(); i++) { CString value = i->AsLower(); @@ -902,18 +899,11 @@ class CPushMod : public CModule if (msg.WildCmp(value)) { - if (negate_match) - { - negated = true; - } - else - { - matched = true; - } + return !negate_match; } } - return (matched && !negated); + return false; } /**