]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
m_censor can now block lines as well, by specifying an empty replace string (QA,...
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 18 May 2007 03:39:18 +0000 (03:39 +0000)
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 18 May 2007 03:39:18 +0000 (03:39 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7041 e03df62e-2008-0410-955e-edbf42e46eb7

conf/inspircd.censor.example
src/modules/m_censor.cpp

index 89730669f231ae75b26a3f66666c86482c50ee71..05d9ce6fa8fc3bd58185ea2ec44e3cd0152b33c0 100644 (file)
@@ -6,6 +6,9 @@
 #
 # <badword     text="simple word"
 #              replace="text to replace with">
+#
+# You can specify <badword text="simple word" replace="">
+# to block lines containing the word
 
 <badword text="shit" replace="poo">
 <badword text="fuck" replace="(censored)">
index 3b7545b58e4c2ab7f41fdcf8e5e81fc555d2d0fa..c378080a542eec6d4eb03bc4de978fe58703e8ce 100644 (file)
@@ -150,6 +150,12 @@ class ModuleCensor : public Module
                { 
                        if (text2.find(index->first) != irc::string::npos)
                        {
+                               if (index->second.empty())
+                               {
+                                       user->WriteServ("936 %s %s %s :Your message contained a censored word, and was blocked", user->nick, ((chanrec*)dest)->name, index->first.c_str());
+                                       return 1;
+                               }
+                               
                                this->ReplaceLine(text2,index->first,index->second);
                        }
                }