summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-01 23:44:16 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-09-01 23:44:16 +0000
commit91ec6450b2d4d44cf3d336eb4d359aec7f7024fd (patch)
tree33d73ba984935bae4927aea91afaaf474b02d3dd
parent414f891fa6680dcfe10da64f9d1dfe1e9816d3fd (diff)
Make m_chanfilter grok globbing, meaning +g test?string?lol is now possible to block a word sequence. CAVEAT: you now need to block *word* unless you're blocking a whole sentance at once. Tech note: removes a string copy, which is a Good Thing.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10375 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_chanfilter.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp
index 30f602a5d..50df5b1cc 100644
--- a/src/modules/m_chanfilter.cpp
+++ b/src/modules/m_chanfilter.cpp
@@ -89,9 +89,6 @@ class ModuleChanFilter : public Module
if (!IS_LOCAL(user) || (CHANOPS_EXEMPT(ServerInstance, 'g') && chan->GetStatus(user) == STATUS_OP))
return 0;
- // Create a copy of the string in irc::string
- irc::string line = text.c_str();
-
modelist* list;
chan->GetExt(cf->GetInfoKey(), list);
@@ -99,7 +96,7 @@ class ModuleChanFilter : public Module
{
for (modelist::iterator i = list->begin(); i != list->end(); i++)
{
- if (line.find(i->mask.c_str()) != std::string::npos)
+ if (InspIRCd::Match(text, i->mask))
{
user->WriteNumeric(936, "%s %s %s :Your message contained a censored word, and was blocked",user->nick.c_str(), chan->name.c_str(), i->mask.c_str());
return 1;