diff options
author | Adam <Adam@anope.org> | 2010-08-17 19:27:37 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-08-17 19:27:37 -0400 |
commit | e65d8b2f3dfdb40858259b3bb48ef6998c31e62f (patch) | |
tree | fd845bdef5664d025ab19c262ae2c5e9d23d7bb2 /modules/core/os_chankill.cpp | |
parent | 2575008baa5c9d0ca789680da1a3b81dc74786f7 (diff) |
Rewrote the config reader to better handle invalid configs.
This prevents Anope from exploding when /os reload has errors.
Diffstat (limited to 'modules/core/os_chankill.cpp')
-rw-r--r-- | modules/core/os_chankill.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/modules/core/os_chankill.cpp b/modules/core/os_chankill.cpp index 4f8b7f34c..04ce6603c 100644 --- a/modules/core/os_chankill.cpp +++ b/modules/core/os_chankill.cpp @@ -35,12 +35,12 @@ class CommandOSChanKill : public Command last_param = 2; } - expires = !expiry.empty() ? dotime(expiry) : Config.ChankillExpiry; + expires = !expiry.empty() ? dotime(expiry) : Config->ChankillExpiry; if (!expiry.empty() && isdigit(expiry[expiry.length() - 1])) expires *= 86400; if (expires && expires < 60) { - notice_lang(Config.s_OperServ, u, BAD_EXPIRY_TIME); + notice_lang(Config->s_OperServ, u, BAD_EXPIRY_TIME); return MOD_CONT; } else if (expires > 0) @@ -58,7 +58,7 @@ class CommandOSChanKill : public Command if (!reason.empty()) { Anope::string realreason; - if (Config.AddAkiller) + if (Config->AddAkiller) realreason = "[" + u->nick + "] " + reason; else realreason = reason; @@ -75,29 +75,29 @@ class CommandOSChanKill : public Command SGLine->Add(OperServ, u, "*@" + uc->user->host, expires, realreason); SGLine->Check(uc->user); } - if (Config.WallOSAkill) + if (Config->WallOSAkill) ircdproto->SendGlobops(OperServ, "%s used CHANKILL on %s (%s)", u->nick.c_str(), channel.c_str(), realreason.c_str()); } else - notice_lang(Config.s_OperServ, u, CHAN_X_NOT_IN_USE, channel.c_str()); + notice_lang(Config->s_OperServ, u, CHAN_X_NOT_IN_USE, channel.c_str()); } return MOD_CONT; } bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config.s_OperServ, u, OPER_HELP_CHANKILL); + notice_help(Config->s_OperServ, u, OPER_HELP_CHANKILL); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config.s_OperServ, u, "CHANKILL", OPER_CHANKILL_SYNTAX); + syntax_error(Config->s_OperServ, u, "CHANKILL", OPER_CHANKILL_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config.s_OperServ, u, OPER_HELP_CMD_CHANKILL); + notice_lang(Config->s_OperServ, u, OPER_HELP_CMD_CHANKILL); } }; |