summaryrefslogtreecommitdiff
path: root/modules/core/cs_kick.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-08-17 19:27:37 -0400
committerAdam <Adam@anope.org>2010-08-17 19:27:37 -0400
commite65d8b2f3dfdb40858259b3bb48ef6998c31e62f (patch)
treefd845bdef5664d025ab19c262ae2c5e9d23d7bb2 /modules/core/cs_kick.cpp
parent2575008baa5c9d0ca789680da1a3b81dc74786f7 (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_kick.cpp')
-rw-r--r--modules/core/cs_kick.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/core/cs_kick.cpp b/modules/core/cs_kick.cpp
index 5654e4479..06f0004b8 100644
--- a/modules/core/cs_kick.cpp
+++ b/modules/core/cs_kick.cpp
@@ -38,17 +38,17 @@ class CommandCSKick : public Command
ci = c->ci;
if (!c)
- notice_lang(Config.s_ChanServ, u, CHAN_X_NOT_IN_USE, chan.c_str());
+ notice_lang(Config->s_ChanServ, u, CHAN_X_NOT_IN_USE, chan.c_str());
else if (is_same ? !(u2 = u) : !(u2 = finduser(target)))
- notice_lang(Config.s_ChanServ, u, NICK_X_NOT_IN_USE, target.c_str());
+ notice_lang(Config->s_ChanServ, u, NICK_X_NOT_IN_USE, target.c_str());
else if (!is_same ? !check_access(u, ci, CA_KICK) : !check_access(u, ci, CA_KICKME))
- notice_lang(Config.s_ChanServ, u, ACCESS_DENIED);
+ notice_lang(Config->s_ChanServ, u, ACCESS_DENIED);
else if (!is_same && (ci->HasFlag(CI_PEACE)) && get_access(u2, ci) >= get_access(u, ci))
- notice_lang(Config.s_ChanServ, u, ACCESS_DENIED);
+ notice_lang(Config->s_ChanServ, u, ACCESS_DENIED);
else if (u2->IsProtected())
- notice_lang(Config.s_ChanServ, u, ACCESS_DENIED);
+ notice_lang(Config->s_ChanServ, u, ACCESS_DENIED);
else if (!c->FindUser(u2))
- notice_lang(Config.s_ChanServ, u, NICK_X_NOT_ON_CHAN, u2->nick.c_str(), c->name.c_str());
+ notice_lang(Config->s_ChanServ, u, NICK_X_NOT_ON_CHAN, u2->nick.c_str(), c->name.c_str());
else
{
if (ci->HasFlag(CI_SIGNKICK) || (ci->HasFlag(CI_SIGNKICK_LEVEL) && !check_access(u, ci, CA_SIGNKICK)))
@@ -61,18 +61,18 @@ class CommandCSKick : public Command
bool OnHelp(User *u, const Anope::string &subcommand)
{
- notice_help(Config.s_ChanServ, u, CHAN_HELP_KICK);
+ notice_help(Config->s_ChanServ, u, CHAN_HELP_KICK);
return true;
}
void OnSyntaxError(User *u, const Anope::string &subcommand)
{
- syntax_error(Config.s_ChanServ, u, "KICK", CHAN_KICK_SYNTAX);
+ syntax_error(Config->s_ChanServ, u, "KICK", CHAN_KICK_SYNTAX);
}
void OnServHelp(User *u)
{
- notice_lang(Config.s_ChanServ, u, CHAN_HELP_CMD_KICK);
+ notice_lang(Config->s_ChanServ, u, CHAN_HELP_CMD_KICK);
}
};