mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 02:59:01 -04:00
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.
This commit is contained in:
parent
1ea821e8c1
commit
6ec3d27b2a
@ -1841,7 +1841,10 @@
|
||||
#<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 #
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user