From f8614ea98581fb303abc36c792be6ba60b3c8b42 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 26 Mar 2023 22:39:42 +0100 Subject: Allow customising the message shown when hiding an X-line ban. --- src/usermanager.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/usermanager.cpp') diff --git a/src/usermanager.cpp b/src/usermanager.cpp index 1b64f61f9..c706d8d90 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -203,13 +203,21 @@ void UserManager::AddUser(int socket, ListenSocket* via, const irc::sockets::soc { /* user banned */ ServerInstance->Logs.Debug("BANCACHE", "BanCache: Positive hit for " + New->GetAddress()); + if (!ServerInstance->Config->XLineMessage.empty()) New->WriteNumeric(ERR_YOUREBANNEDCREEP, ServerInstance->Config->XLineMessage); - if (ServerInstance->Config->HideBans) - this->QuitUser(New, b->Type + "-lined", &b->Reason); - else + if (ServerInstance->Config->HideLines.empty()) this->QuitUser(New, b->Reason); + else + { + const std::string publicreason = Template::Replace(ServerInstance->Config->HideLines, + { + { "reason", b->Reason }, + { "type", b->Type }, + }); + this->QuitUser(New, publicreason, &b->Reason); + } return; } else -- cgit v1.3.1-10-gc9f91