]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Merge pull request #984 from Renegade334/modules-exempt-uline
authorAttila Molnar <attilamolnar@hush.com>
Thu, 5 Feb 2015 23:16:46 +0000 (00:16 +0100)
committerAttila Molnar <attilamolnar@hush.com>
Thu, 5 Feb 2015 23:16:46 +0000 (00:16 +0100)
Allow U-lined services to bypass m_silence (configurable)

docs/conf/modules.conf.example
src/modules/m_silence.cpp

index 1071f5039dc97cdc09135336ffb0f8f4bedbe402..881c5f07730a090a477ed6bae7f7b3881da847ee 100644 (file)
 #<module name="m_silence.so">
 #
 # Set the maximum number of entries allowed on a user's silence list.
-#<silence maxentries="32">
+#<silence maxentries="32"
+#
+# Whether messages from U-lined servers will bypass silence masks.
+#exemptuline="yes">
 
 #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
 # SQLite3 module: Allows other SQL modules to access SQLite3          #
index 91822b4e4bf054e078075caf834a8a214bc3e176..502f947f45b0f4f442af00ef30e574ddc8934c5b 100644 (file)
@@ -291,6 +291,7 @@ class CommandSilence : public Command
 class ModuleSilence : public Module
 {
        unsigned int maxsilence;
+       bool ExemptULine;
        CommandSilence cmdsilence;
        CommandSVSSilence cmdsvssilence;
  public:
@@ -302,9 +303,13 @@ class ModuleSilence : public Module
 
        void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
-               maxsilence = ServerInstance->Config->ConfValue("silence")->getInt("maxentries", 32);
+               ConfigTag* tag = ServerInstance->Config->ConfValue("silence");
+
+               maxsilence = tag->getInt("maxentries", 32);
                if (!maxsilence)
                        maxsilence = 32;
+
+               ExemptULine = tag->getBool("exemptuline", true);
        }
 
        void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
@@ -351,6 +356,9 @@ class ModuleSilence : public Module
 
        ModResult MatchPattern(User* dest, User* source, int pattern)
        {
+               if (ExemptULine && source->server->IsULine())
+                       return MOD_RES_PASSTHRU;
+
                silencelist* sl = cmdsilence.ext.get(dest);
                if (sl)
                {