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:
John Reese 2013-01-02 15:02:00 -08:00
parent d52af3483e
commit e41034374d
1 changed files with 24 additions and 2 deletions

View File

@ -538,7 +538,17 @@ class CPushMod : public CModule
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))
{
@ -614,7 +624,19 @@ class CPushMod : public CModule
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;
}