diff options
author | Robby- <robby@chat.be> | 2015-02-01 16:56:29 +0100 |
---|---|---|
committer | Adam <Adam@anope.org> | 2015-03-22 13:44:08 -0400 |
commit | 5df4ac9a98b11518af41a449bb6b89c3bf6290d9 (patch) | |
tree | 99b3f9795f859f52faf94baf9e63062eb90ec171 /modules/commands/cs_kick.cpp | |
parent | 4c54a3939f9e36f47cd912275f4dbfdb4e64f8d9 (diff) |
Make the signed kick/ban message format configurable.
Diffstat (limited to 'modules/commands/cs_kick.cpp')
-rw-r--r-- | modules/commands/cs_kick.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/commands/cs_kick.cpp b/modules/commands/cs_kick.cpp index a3505d254..5b28b5f18 100644 --- a/modules/commands/cs_kick.cpp +++ b/modules/commands/cs_kick.cpp @@ -47,6 +47,9 @@ class CommandCSKick : public Command if (reason.length() > reasonmax) reason = reason.substr(0, reasonmax); + Anope::string signkickformat = Config->GetModule("chanserv")->Get<Anope::string>("signkickformat", "%m (%n)"); + signkickformat = signkickformat.replace_all_cs("%n", source.GetNick()); + AccessGroup u_access = source.AccessFor(ci); if (!u_access.HasPriv("KICK") && !source.HasPriv("chanserv/kick")) @@ -66,7 +69,10 @@ class CommandCSKick : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, source, this, ci) << "for " << u2->nick; if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !u_access.HasPriv("SIGNKICK"))) - c->Kick(ci->WhoSends(), u2, "%s (%s)", reason.c_str(), source.GetNick().c_str()); + { + signkickformat = signkickformat.replace_all_cs("%m", reason); + c->Kick(ci->WhoSends(), u2, "%s", signkickformat.c_str()); + } else c->Kick(ci->WhoSends(), u2, "%s", reason.c_str()); } @@ -96,7 +102,11 @@ class CommandCSKick : public Command ++kicked; if (ci->HasExt("SIGNKICK") || (ci->HasExt("SIGNKICK_LEVEL") && !u_access.HasPriv("SIGNKICK"))) - c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s) (%s)", reason.c_str(), mask.c_str(), source.GetNick().c_str()); + { + reason += " (Matches " + mask + ")"; + signkickformat = signkickformat.replace_all_cs("%m", reason); + c->Kick(ci->WhoSends(), uc->user, "%s", signkickformat.c_str()); + } else c->Kick(ci->WhoSends(), uc->user, "%s (Matches %s)", reason.c_str(), mask.c_str()); } |