summaryrefslogtreecommitdiff
path: root/modules/core/ms_del.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/ms_del.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/ms_del.cpp')
-rw-r--r--modules/core/ms_del.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/core/ms_del.cpp b/modules/core/ms_del.cpp
index 8d5b45c04..8ffed7532 100644
--- a/modules/core/ms_del.cpp
+++ b/modules/core/ms_del.cpp
@@ -59,17 +59,17 @@ class CommandMSDel : public Command
if (!(ci = cs_findchan(chan)))
{
- notice_lang(Config.s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan.c_str());
+ notice_lang(Config->s_MemoServ, u, CHAN_X_NOT_REGISTERED, chan.c_str());
return MOD_CONT;
}
else if (readonly)
{
- notice_lang(Config.s_MemoServ, u, READ_ONLY_MODE);
+ notice_lang(Config->s_MemoServ, u, READ_ONLY_MODE);
return MOD_CONT;
}
else if (!check_access(u, ci, CA_MEMO))
{
- notice_lang(Config.s_MemoServ, u, ACCESS_DENIED);
+ notice_lang(Config->s_MemoServ, u, ACCESS_DENIED);
return MOD_CONT;
}
mi = &ci->memos;
@@ -81,9 +81,9 @@ class CommandMSDel : public Command
else if (mi->memos.empty())
{
if (!chan.empty())
- notice_lang(Config.s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan.c_str());
+ notice_lang(Config->s_MemoServ, u, MEMO_X_HAS_NO_MEMOS, chan.c_str());
else
- notice_lang(Config.s_MemoServ, u, MEMO_HAVE_NO_MEMOS);
+ notice_lang(Config->s_MemoServ, u, MEMO_HAVE_NO_MEMOS);
}
else
{
@@ -102,7 +102,7 @@ class CommandMSDel : public Command
else
FOREACH_MOD(I_OnMemoDel, OnMemoDel(u->Account(), mi, last));
delmemo(mi, last);
- notice_lang(Config.s_MemoServ, u, MEMO_DELETED_ONE, last);
+ notice_lang(Config->s_MemoServ, u, MEMO_DELETED_ONE, last);
}
else
{
@@ -115,9 +115,9 @@ class CommandMSDel : public Command
delete mi->memos[i];
mi->memos.clear();
if (!chan.empty())
- notice_lang(Config.s_MemoServ, u, MEMO_CHAN_DELETED_ALL, chan.c_str());
+ notice_lang(Config->s_MemoServ, u, MEMO_CHAN_DELETED_ALL, chan.c_str());
else
- notice_lang(Config.s_MemoServ, u, MEMO_DELETED_ALL);
+ notice_lang(Config->s_MemoServ, u, MEMO_DELETED_ALL);
}
/* Reset the order */
@@ -129,18 +129,18 @@ class CommandMSDel : public Command
bool OnHelp(User *u, const Anope::string &subcommand)
{
- notice_help(Config.s_MemoServ, u, MEMO_HELP_DEL);
+ notice_help(Config->s_MemoServ, u, MEMO_HELP_DEL);
return true;
}
void OnSyntaxError(User *u, const Anope::string &subcommand)
{
- syntax_error(Config.s_MemoServ, u, "DEL", MEMO_DEL_SYNTAX);
+ syntax_error(Config->s_MemoServ, u, "DEL", MEMO_DEL_SYNTAX);
}
void OnServHelp(User *u)
{
- notice_lang(Config.s_MemoServ, u, MEMO_HELP_CMD_DEL);
+ notice_lang(Config->s_MemoServ, u, MEMO_HELP_CMD_DEL);
}
};