summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2020-04-17 12:46:10 +0100
committerSadie Powell <sadie@witchery.services>2020-04-17 13:09:28 +0100
commit6d339de5fc981fb2cb56e384b2b7f0e977679316 (patch)
treebb0508e8057d87fe5122d7875aaffcb5b839592d
parentdbb786e2b62424dadb2b982e74b39d5e6b2fd31d (diff)
Allow hiding the message which warns about LIST being blocked.
-rw-r--r--src/modules/m_securelist.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp
index b8ed384f3..c814d37dd 100644
--- a/src/modules/m_securelist.cpp
+++ b/src/modules/m_securelist.cpp
@@ -34,6 +34,7 @@ class ModuleSecureList : public Module
private:
AllowList allowlist;
bool exemptregistered;
+ bool showmsg;
unsigned int WaitTime;
public:
@@ -57,6 +58,7 @@ class ModuleSecureList : public Module
ConfigTag* tag = ServerInstance->Config->ConfValue("securelist");
exemptregistered = tag->getBool("exemptregistered");
+ showmsg = tag->getBool("showmsg", true);
WaitTime = tag->getDuration("waittime", 60, 1);
allowlist.swap(newallows);
}
@@ -79,9 +81,12 @@ class ModuleSecureList : public Module
if (exemptregistered && ext && ext->get(user))
return MOD_RES_PASSTHRU;
- user->WriteNotice(InspIRCd::Format("*** You cannot view the channel list right now. Please %stry again in %s.",
- (exemptregistered ? "login to an account or " : ""),
- InspIRCd::DurationString(waitallowed - ServerInstance->Time()).c_str()));
+ if (showmsg)
+ {
+ user->WriteNotice(InspIRCd::Format("*** You cannot view the channel list right now. Please %stry again in %s.",
+ (exemptregistered ? "login to an account or " : ""),
+ InspIRCd::DurationString(waitallowed - ServerInstance->Time()).c_str()));
+ }
// The client might be waiting on a response to do something so send them an
// empty list response to satisfy that.
@@ -94,7 +99,8 @@ class ModuleSecureList : public Module
void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
{
- tokens["SECURELIST"];
+ if (showmsg)
+ tokens["SECURELIST"] = ConvToStr(WaitTime);
}
};