summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf/inspircd.censor.example3
-rw-r--r--src/modules/m_censor.cpp6
2 files changed, 9 insertions, 0 deletions
diff --git a/conf/inspircd.censor.example b/conf/inspircd.censor.example
index 89730669f..05d9ce6fa 100644
--- a/conf/inspircd.censor.example
+++ b/conf/inspircd.censor.example
@@ -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)">
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index 3b7545b58..c378080a5 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -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);
}
}