mirror of https://github.com/SeanOMik/znc-push.git
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:
parent
717a2b1741
commit
aebf9460d9
14
push.cpp
14
push.cpp
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue