aboutsummaryrefslogtreecommitdiff
path: root/src/usermanager.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-03-26 22:39:42 +0100
committerGravatar Sadie Powell2023-04-18 14:21:11 +0100
commitf8614ea98581fb303abc36c792be6ba60b3c8b42 (patch)
tree4c2840b444072bb6dd11debdc50077d0e854fc3d /src/usermanager.cpp
parentMarginally improve the performance of JSON logging. (diff)
Allow customising the message shown when hiding an X-line ban.
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r--src/usermanager.cpp14
1 files changed, 11 insertions, 3 deletions
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