From e41034374db789561c5d9d80d9a8132a74c8873d Mon Sep 17 00:00:00 2001 From: John Reese Date: Wed, 2 Jan 2013 15:02:00 -0800 Subject: [PATCH] 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. --- push.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/push.cpp b/push.cpp index ce28976..ee94276 100644 --- a/push.cpp +++ b/push.cpp @@ -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; }