summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-27 15:53:06 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-08-27 15:53:06 +0000
commit533bda9cfe75166e3f8db8b96b463666164bc6d6 (patch)
tree9c842d6c0dab01ead24b250ca4ab7f5978000bf8
parent67c12453047f009692da518774ed6e49ee0acb9a (diff)
Add <shun:notifyuser>, default on, which notifies the user that their command was blocked
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10317 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--conf/modules.conf.example4
-rw-r--r--src/modules/m_shun.cpp7
2 files changed, 10 insertions, 1 deletions
diff --git a/conf/modules.conf.example b/conf/modules.conf.example
index b77090f82..7d89163ba 100644
--- a/conf/modules.conf.example
+++ b/conf/modules.conf.example
@@ -1228,7 +1228,9 @@
# You may also configure which commands you wish a user to be able to
# perform. It should be noted that if a shunned user issues QUIT or PART
# then their message will be removed, as if they did not issue one.
-#<shun enabledcommands="PING PONG QUIT PART JOIN">
+#
+# You may also (optionally) let the user know that their command was blocked.
+#<shun enabledcommands="PING PONG QUIT PART JOIN" notifyuser="yes">
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# Spy module: Provides the ability to see the complete names list of
diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp
index 59588ab5e..739bfb36a 100644
--- a/src/modules/m_shun.cpp
+++ b/src/modules/m_shun.cpp
@@ -146,6 +146,7 @@ class ModuleShun : public Module
cmd_shun* mycommand;
ShunFactory *f;
std::map<std::string, bool> ShunEnabledCommands;
+ bool NotifyOfShun;
public:
ModuleShun(InspIRCd* Me) : Module(Me)
@@ -185,6 +186,7 @@ class ModuleShun : public Module
cmds = "PING PONG QUIT";
ShunEnabledCommands.clear();
+ NotifyOfShun = true;
std::stringstream dcmds(cmds);
std::string thiscmd;
@@ -193,6 +195,8 @@ class ModuleShun : public Module
{
ShunEnabledCommands[thiscmd] = true;
}
+
+ NotifyOfShun = MyConf.ReadFlag("shun", "notifyuser", "yes", 0);
}
virtual void OnUserConnect(User* user)
@@ -225,7 +229,10 @@ class ModuleShun : public Module
std::map<std::string, bool>::iterator i = ShunEnabledCommands.find(command);
if (i == ShunEnabledCommands.end())
+ {
+ user->WriteServ("NOTICE %s :*** Command %s not processed, as you have been blocked from issuing commands (SHUN)", user->nick.c_str(), command.c_str());
return 1;
+ }
if (command == "QUIT")
{