summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2009-02-09 12:38:04 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2009-02-09 12:38:04 +0000
commitdcfae7ba4402d2922dee4763fe38ae2e64a3b2bc (patch)
tree808afffb2299bf4d5c5fe5403cba2dc87ad055e1
parentcb1464555eb711c0fd74e31aadaa9558d9b61b5d (diff)
Merge fantasy:allowbots patch from Taros, closing off bug #709, thanks!
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11069 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--conf/modules.conf.example5
-rw-r--r--src/modules/m_alias.cpp12
2 files changed, 16 insertions, 1 deletions
diff --git a/conf/modules.conf.example b/conf/modules.conf.example
index 4263d7780..32b213401 100644
--- a/conf/modules.conf.example
+++ b/conf/modules.conf.example
@@ -73,11 +73,14 @@
#
# Fantasy settings:
#
-#<fantasy prefix="!">
+#<fantasy prefix="!" allowbots="no">
#
# prefix:
# Set the prefix for in-channel aliases (fantasy commands) to the
# specified character. If not set, the default is "!".
+# allowbots:
+# If this is set to no, +B clients will not be able to use fantasy
+# commands. If not set, the default is no.
#
#-#-#-#-#-#-#-#-#-#-#- ALIAS DEFINITIONS -#-#-#-#-#-#-#-#-#-#-#-#-#-#
# #
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 160e3cea3..4ba05729b 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -60,9 +60,14 @@ class ModuleAlias : public Module
*/
std::multimap<std::string, Alias> Aliases;
+ /* whether or not +B users are allowed to use fantasy commands */
+ bool AllowBots;
+
virtual void ReadAliases()
{
ConfigReader MyConf(ServerInstance);
+
+ AllowBots = MyConf.ReadFlag("fantasy", "allowbots", "no", 0);
std::string fpre = MyConf.ReadValue("fantasy","prefix",0);
fprefix = fpre.empty() ? '!' : fpre[0];
@@ -187,6 +192,13 @@ class ModuleAlias : public Module
return 0;
}
+ /* Stop here if the user is +B and allowbot is set to no. */
+ if (!AllowBots && user->IsModeSet('B'))
+ {
+ ServerInstance->Logs->Log("FANTASY", DEBUG, "fantasy: user is +B and allowbot is set to no");
+ return 0;
+ }
+
Channel *c = (Channel *)dest;
std::string fcommand;