diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-09 13:33:57 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-09 13:33:57 +0000 |
commit | 4754d3371f209ce31ca417a8c557e29805d3cc49 (patch) | |
tree | 7183be150dc63ea0baa7d968c4936067b862358a /src/modules | |
parent | 1485bcaf19fde3a8961ffdc8ade2e699aae3788e (diff) |
Fixed matching
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1022 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_filter.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 569ed0637..054d77963 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -26,8 +26,6 @@ /* $ModDesc: An enhanced version of the unreal m_filter.so used by chatspike.net */ - - class ModuleFilter : public Module { Server *Srv; @@ -65,11 +63,11 @@ class ModuleFilter : public Module virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text) { - std::string text2 = text + " "; + std::string text2 = text+" "; for (int index = 0; index < MyConf->Enumerate("keyword"); index++) { std::string pattern = MyConf->ReadValue("keyword","pattern",index); - if (Srv->MatchText(text2,pattern)) + if ((Srv->MatchText(text2,pattern)) || (Srv->MatchText(text,pattern))) { std::string target = ""; std::string reason = MyConf->ReadValue("keyword","reason",index); @@ -114,11 +112,11 @@ class ModuleFilter : public Module virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text) { - std::string text2 = text + " "; + std::string text2 = text+" "; for (int index = 0; index < MyConf->Enumerate("keyword"); index++) { std::string pattern = MyConf->ReadValue("keyword","pattern",index); - if (Srv->MatchText(text2,pattern)) + if ((Srv->MatchText(text2,pattern)) || (Srv->MatchText(text,pattern))) { std::string target = ""; std::string reason = MyConf->ReadValue("keyword","reason",index); |