diff options
| author | 2023-03-26 22:39:42 +0100 | |
|---|---|---|
| committer | 2023-04-18 14:21:11 +0100 | |
| commit | f8614ea98581fb303abc36c792be6ba60b3c8b42 (patch) | |
| tree | 4c2840b444072bb6dd11debdc50077d0e854fc3d /src/xline.cpp | |
| parent | Marginally improve the performance of JSON logging. (diff) | |
Allow customising the message shown when hiding an X-line ban.
Diffstat (limited to 'src/xline.cpp')
| -rw-r--r-- | src/xline.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/xline.cpp b/src/xline.cpp index 6cc44447f..c4b3b9287 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -564,20 +564,26 @@ bool XLine::IsBurstable() void XLine::DefaultApply(User* u, const std::string& line, bool bancache) { - const std::string banReason = line + "-lined: " + reason; - if (!ServerInstance->Config->XLineMessage.empty()) u->WriteNumeric(ERR_YOUREBANNEDCREEP, ServerInstance->Config->XLineMessage); - if (ServerInstance->Config->HideBans) - ServerInstance->Users.QuitUser(u, line + "-lined", &banReason); + const std::string banreason = line + "-lined: " + reason; + if (ServerInstance->Config->HideLines.empty()) + ServerInstance->Users.QuitUser(u, banreason); else - ServerInstance->Users.QuitUser(u, banReason); + { + const std::string publicreason = Template::Replace(ServerInstance->Config->HideLines, + { + { "reason", banreason }, + { "type", line }, + }); + ServerInstance->Users.QuitUser(u, publicreason, &banreason); + } if (bancache) { ServerInstance->Logs.Debug("BANCACHE", "BanCache: Adding positive hit (" + line + ") for " + u->GetAddress()); - ServerInstance->BanCache.AddHit(u->GetAddress(), this->type, banReason, (this->duration > 0 ? (this->expiry - ServerInstance->Time()) : 0)); + ServerInstance->BanCache.AddHit(u->GetAddress(), this->type, banreason, (this->duration > 0 ? (this->expiry - ServerInstance->Time()) : 0)); } } |
