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/cs_forbid.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/cs_forbid.cpp')
-rw-r--r-- | modules/core/cs_forbid.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/modules/core/cs_forbid.cpp b/modules/core/cs_forbid.cpp index 004b523cc..09fddd091 100644 --- a/modules/core/cs_forbid.cpp +++ b/modules/core/cs_forbid.cpp @@ -29,21 +29,21 @@ class CommandCSForbid : public Command Channel *c; - if (Config.ForceForbidReason && reason.empty()) + if (Config->ForceForbidReason && reason.empty()) { - syntax_error(Config.s_ChanServ, u, "FORBID", CHAN_FORBID_SYNTAX_REASON); + syntax_error(Config->s_ChanServ, u, "FORBID", CHAN_FORBID_SYNTAX_REASON); return MOD_CONT; } if (chan[0] != '#') { - notice_lang(Config.s_ChanServ, u, CHAN_SYMBOL_REQUIRED); + notice_lang(Config->s_ChanServ, u, CHAN_SYMBOL_REQUIRED); return MOD_CONT; } if (readonly) { - notice_lang(Config.s_ChanServ, u, READ_ONLY_MODE); + notice_lang(Config->s_ChanServ, u, READ_ONLY_MODE); return MOD_CONT; } @@ -53,8 +53,8 @@ class CommandCSForbid : public Command ci = new ChannelInfo(chan); if (!ci) { - Alog() << Config.s_ChanServ << ": Valid FORBID for " << ci->name << " by " << u->nick << " failed"; - notice_lang(Config.s_ChanServ, u, CHAN_FORBID_FAILED, chan.c_str()); + Alog() << Config->s_ChanServ << ": Valid FORBID for " << ci->name << " by " << u->nick << " failed"; + notice_lang(Config->s_ChanServ, u, CHAN_FORBID_FAILED, chan.c_str()); return MOD_CONT; } @@ -80,7 +80,7 @@ class CommandCSForbid : public Command } } - if (Config.WallForbid) + if (Config->WallForbid) ircdproto->SendGlobops(ChanServ, "\2%s\2 used FORBID on channel \2%s\2", u->nick.c_str(), ci->name.c_str()); if (ircd->chansqline) @@ -89,8 +89,8 @@ class CommandCSForbid : public Command ircdproto->SendSQLine(&x); } - Alog() << Config.s_ChanServ << ": " << u->nick << " set FORBID for channel " << ci->name; - notice_lang(Config.s_ChanServ, u, CHAN_FORBID_SUCCEEDED, chan.c_str()); + Alog() << Config->s_ChanServ << ": " << u->nick << " set FORBID for channel " << ci->name; + notice_lang(Config->s_ChanServ, u, CHAN_FORBID_SUCCEEDED, chan.c_str()); FOREACH_MOD(I_OnChanForbidden, OnChanForbidden(ci)); @@ -99,18 +99,18 @@ class CommandCSForbid : public Command bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config.s_ChanServ, u, CHAN_SERVADMIN_HELP_FORBID); + notice_help(Config->s_ChanServ, u, CHAN_SERVADMIN_HELP_FORBID); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config.s_ChanServ, u, "FORBID", CHAN_FORBID_SYNTAX); + syntax_error(Config->s_ChanServ, u, "FORBID", CHAN_FORBID_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config.s_ChanServ, u, CHAN_HELP_CMD_FORBID); + notice_lang(Config->s_ChanServ, u, CHAN_HELP_CMD_FORBID); } }; |