From 6ec3d27b2a32ca54d8f62d5cd4b1e8e170ac0783 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Thu, 5 Feb 2015 15:00:44 +0000 Subject: modules/m_silence: Allow U-lined services to bypass silence masks Adds a config entry (silence->exemptuline) that specifies whether users on U-lined servers can bypass silence masks. --- docs/conf/modules.conf.example | 5 ++++- src/modules/m_silence.cpp | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 1071f5039..881c5f077 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -1841,7 +1841,10 @@ # # # Set the maximum number of entries allowed on a user's silence list. -# +# #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-# # SQLite3 module: Allows other SQL modules to access SQLite3 # diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 91822b4e4..502f947f4 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -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& 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) { -- cgit v1.2.3