aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-10-03 22:04:44 +0100
committerGravatar Sadie Powell2023-10-03 22:04:44 +0100
commite86a159293ebcfbb4516cf94d6eb3dd61a788f2a (patch)
tree6854932063f987159cf3a99763c777e0bfe3e74d /src
parentMerge branch 'insp3' into master. (diff)
Allow disabling LIST completely for unregistered users.
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_securelist.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp
index ad3098eb1..b183a7eb4 100644
--- a/src/modules/m_securelist.cpp
+++ b/src/modules/m_securelist.cpp
@@ -98,7 +98,7 @@ public:
fakechantopic = tag->getString("fakechantopic", "Fake channel for confusing spambots", 1, ServerInstance->Config->Limits.MaxTopic - 1);
hidesmallchans = tag->getNum<size_t>("hidesmallchans", 0);
showmsg = tag->getBool("showmsg", true);
- waittime = tag->getDuration("waittime", 60, 1, 60*60*24);
+ waittime = tag->getDuration("waittime", 60, !exemptregistered, 60*60*24);
allowlist.swap(newallows);
}
@@ -111,15 +111,22 @@ public:
// Allow if the wait time has passed.
time_t maxwaittime = user->signon + waittime;
- if (ServerInstance->Time() > maxwaittime)
+ if (waittime && ServerInstance->Time() > maxwaittime)
return MOD_RES_PASSTHRU;
// If <securehost:showmsg> is set then tell the user that they need to wait.
if (showmsg)
{
- user->WriteNotice(INSP_FORMAT("*** You cannot view the channel list right now. Please {}try again in {}.",
- exemptregistered ? "log in to an account or " : "",
- Duration::ToString(maxwaittime - ServerInstance->Time())));
+ if (waittime)
+ {
+ user->WriteNotice(INSP_FORMAT("*** You cannot view the channel list right now. Please {}try again in {}.",
+ exemptregistered ? "log in to an account or " : "",
+ Duration::ToString(maxwaittime - ServerInstance->Time())));
+ }
+ else
+ {
+ user->WriteNotice("*** You must be logged into an account to view the channel list.");
+ }
}
// The client might be waiting on a response to do something so send them an