From 1d0bb9b26b7ad58ab0bf979ac046f4511b3bf12b Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 5 May 2013 01:55:04 -0400 Subject: Rework the config file reader to be much more flexible and move many configuration directives to the actual modules they are used in. --- modules/commands/cs_akick.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'modules/commands/cs_akick.cpp') diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index b2b1c7579..bb1e6ecd6 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -23,8 +23,9 @@ class CommandCSAKick : public Command NickCore *nc = NULL; const AutoKick *akick; - if (reason.length() > Config->CSReasonMax) - reason = reason.substr(0, Config->CSReasonMax); + unsigned reasonmax = Config->GetModule("chanserv")->Get("reasonmax", "200"); + if (reason.length() > reasonmax) + reason = reason.substr(0, reasonmax); if (IRCD->IsExtbanValid(mask)) ; /* If this is an extban don't try to complete the mask */ @@ -148,9 +149,9 @@ class CommandCSAKick : public Command } } - if (ci->GetAkickCount() >= Config->CSAutokickMax) + if (ci->GetAkickCount() >= Config->GetModule(this->owner)->Get("autokickmax")) { - source.Reply(_("Sorry, you can only have %d autokick masks on a channel."), Config->CSAutokickMax); + source.Reply(_("Sorry, you can only have %d autokick masks on a channel."), Config->GetModule(this->owner)->Get("autokickmax")); return; } @@ -513,7 +514,6 @@ class CSAKick : public Module CSAKick(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), commandcsakick(this) { - Implementation i[] = { I_OnCheckKick }; ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); } @@ -544,7 +544,11 @@ class CSAKick : public Module autokick->last_used = Anope::CurTime; if (!autokick->nc && autokick->mask.find('#') == Anope::string::npos) mask = autokick->mask; - reason = autokick->reason.empty() ? Config->CSAutokickReason : autokick->reason; + reason = autokick->reason; + if (reason.empty()) + reason = Config->GetModule(this)->Get("autokickreason"); + if (reason.empty()) + reason = "User has been banned from the channel"; return EVENT_STOP; } } -- cgit