diff options
| -rw-r--r-- | docs/conf/modules.conf.example | 6 | ||||
| -rw-r--r-- | src/modules/m_securelist.cpp | 17 |
2 files changed, 16 insertions, 7 deletions
diff --git a/docs/conf/modules.conf.example b/docs/conf/modules.conf.example index 402644dd0..1d98d182f 100644 --- a/docs/conf/modules.conf.example +++ b/docs/conf/modules.conf.example @@ -2221,8 +2221,10 @@ # Defaults to no. # # # # waittime - The time period that a user must be connected for before # -# they can use the /LIST command. # -# Defaults to 1 minute. # +# they can use the /LIST command. If exemptregistered is # +# enabled you can set this to 0 to disable unauthenticated # +# users from viewing the channel list. # +# Defaults to 1 minute. # # # #<securelist exemptregistered="yes" # fakechans="5" 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 |
