mirror of https://github.com/SeanOMik/znc-push.git
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.
This commit is contained in:
parent
cf08b9e0f4
commit
e5b8fc0964
14
push.cpp
14
push.cpp
|
@ -869,9 +869,6 @@ class CPushMod : public CModule
|
||||||
options["highlight"].Split(" ", values, false);
|
options["highlight"].Split(" ", values, false);
|
||||||
values.push_back("%nick%");
|
values.push_back("%nick%");
|
||||||
|
|
||||||
bool matched = false;
|
|
||||||
bool negated = false;
|
|
||||||
|
|
||||||
for (VCString::iterator i = values.begin(); i != values.end(); i++)
|
for (VCString::iterator i = values.begin(); i != values.end(); i++)
|
||||||
{
|
{
|
||||||
CString value = i->AsLower();
|
CString value = i->AsLower();
|
||||||
|
@ -902,18 +899,11 @@ class CPushMod : public CModule
|
||||||
|
|
||||||
if (msg.WildCmp(value))
|
if (msg.WildCmp(value))
|
||||||
{
|
{
|
||||||
if (negate_match)
|
return !negate_match;
|
||||||
{
|
|
||||||
negated = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
matched = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (matched && !negated);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue