Fix negative matching/filtering

Previously, the highlight function returned true immediately upon finding any match, without checking whether any negative matches should be preventing the match.
This commit is contained in:
Naine 2016-02-17 13:01:01 +11:00
parent 717a2b1741
commit aebf9460d9
1 changed files with 12 additions and 2 deletions

View File

@ -880,6 +880,9 @@ class CPushMod : public CModule
char prefix = value[0]; char prefix = value[0];
bool push = true; bool push = true;
bool matched = false;
bool negated = false;
if (prefix == '-') if (prefix == '-')
{ {
push = false; push = false;
@ -904,11 +907,18 @@ class CPushMod : public CModule
if (msg.WildCmp(value)) if (msg.WildCmp(value))
{ {
return push; if (push)
{
matched = true;
}
else
{
negated = true;
}
} }
} }
return false; return (matched && !negated);
} }
/** /**