mirror of https://github.com/SeanOMik/znc-push.git
Add correct forms for using ExpandString in highlight checks
This adds the feature intended for revision fa46469
, but using the format
found in the core ZNC perform module. This patch is verified to compile
against ZNC 1.0.
This commit is contained in:
parent
d52af3483e
commit
e41034374d
26
push.cpp
26
push.cpp
|
@ -538,7 +538,17 @@ class CPushMod : public CModule
|
||||||
value = " " + value.LeftChomp_n(1) + " ";
|
value = " " + value.LeftChomp_n(1) + " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
value = "*" + value + "*";
|
// Expand substrings like %nick%
|
||||||
|
if (m_pNetwork)
|
||||||
|
{
|
||||||
|
value = m_pNetwork->ExpandString(value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value = GetUser()->ExpandString(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
value = "*" + value.AsLower() + "*";
|
||||||
|
|
||||||
if (msg.WildCmp(value))
|
if (msg.WildCmp(value))
|
||||||
{
|
{
|
||||||
|
@ -614,7 +624,19 @@ class CPushMod : public CModule
|
||||||
|
|
||||||
for (VCString::iterator i = blacklist.begin(); i != blacklist.end(); i++)
|
for (VCString::iterator i = blacklist.begin(); i != blacklist.end(); i++)
|
||||||
{
|
{
|
||||||
if (name.WildCmp(i->AsLower()))
|
CString value;
|
||||||
|
|
||||||
|
// Expand substrings like %nick%
|
||||||
|
if (m_pNetwork)
|
||||||
|
{
|
||||||
|
value = m_pNetwork->ExpandString(*i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
value = GetUser()->ExpandString(*i);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name.WildCmp(value.AsLower()))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue