Skip to content

Commit

Permalink
modules/m_silence: Allow U-lined services to bypass silence masks
Browse files Browse the repository at this point in the history
Adds a config entry (silence->exemptuline) that specifies whether
users on U-lined servers can bypass silence masks.
  • Loading branch information
Renegade334 committed Feb 5, 2015
1 parent 1ea821e commit 6ec3d27
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion docs/conf/modules.conf.example
Expand Up @@ -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"

This comment has been minimized.

Copy link
@Googolplexed

Googolplexed Feb 13, 2015

Contributor

This probably didn't meant to have been changed

(Never mind, the split line threw me off)

#
# Whether messages from U-lined servers will bypass silence masks.
#exemptuline="yes">

#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
# SQLite3 module: Allows other SQL modules to access SQLite3 #
Expand Down
10 changes: 9 additions & 1 deletion src/modules/m_silence.cpp
Expand Up @@ -291,6 +291,7 @@ class CommandSilence : public Command
class ModuleSilence : public Module
{
unsigned int maxsilence;
bool ExemptULine;
CommandSilence cmdsilence;
CommandSVSSilence cmdsvssilence;
public:
Expand All @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 6ec3d27

Please sign in to comment.