diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-01-21 18:44:08 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-01-21 18:44:08 +0100 |
commit | e244cb2c63b1ac1d85bdbb4691f7b1bd940ae804 (patch) | |
tree | 5a69b0efe6c0b7ab88925d3d066271ec40845e23 /src/modules/m_svshold.cpp | |
parent | fead8af2b767cb5591536a3c98babf6b35194a66 (diff) | |
parent | 7dd831383f7506e49f568d0684ee1ecb1f5dc90f (diff) |
Merge insp20
Diffstat (limited to 'src/modules/m_svshold.cpp')
-rw-r--r-- | src/modules/m_svshold.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index b1b454e63..c821f63bb 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -23,6 +23,11 @@ #include "inspircd.h" #include "xline.h" +namespace +{ + bool silent; +} + /** Holds a SVSHold item */ class SVSHold : public XLine @@ -48,6 +53,15 @@ public: return InspIRCd::Match(s, nickname); } + void DisplayExpiry() + { + if (!silent) + { + ServerInstance->SNO->WriteToSnoMask('x', "Removing expired SVSHOLD %s (set by %s %ld seconds ago)", + nickname.c_str(), source.c_str(), (long)(ServerInstance->Time() - set_time)); + } + } + const std::string& Displayable() { return nickname; @@ -99,7 +113,8 @@ class CommandSvshold : public Command { if (ServerInstance->XLines->DelLine(parameters[0].c_str(), "SVSHOLD", user)) { - ServerInstance->SNO->WriteToSnoMask('x',"%s removed SVSHOLD on %s",user->nick.c_str(),parameters[0].c_str()); + if (!silent) + ServerInstance->SNO->WriteToSnoMask('x',"%s removed SVSHOLD on %s",user->nick.c_str(),parameters[0].c_str()); } else { @@ -116,6 +131,9 @@ class CommandSvshold : public Command if (ServerInstance->XLines->AddLine(r, user)) { + if (silent) + return CMD_SUCCESS; + if (!duration) { ServerInstance->SNO->WriteGlobalSno('x', "%s added permanent SVSHOLD for %s: %s", user->nick.c_str(), parameters[0].c_str(), parameters[2].c_str()); @@ -159,6 +177,12 @@ class ModuleSVSHold : public Module ServerInstance->XLines->RegisterFactory(&s); } + void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE + { + ConfigTag* tag = ServerInstance->Config->ConfValue("svshold"); + silent = tag->getBool("silent"); + } + ModResult OnStats(char symbol, User* user, string_list &out) CXX11_OVERRIDE { if(symbol != 'S') |