mirror of
https://github.com/anope/anope.git
synced 2026-07-04 08:43:14 +02:00
Rewrote the config reader to better handle invalid configs.
This prevents Anope from exploding when /os reload has errors.
This commit is contained in:
@@ -32,31 +32,31 @@ class CommandNSStatus : public Command
|
||||
while (sep.GetToken(nickbuf))
|
||||
{
|
||||
if (!(u2 = finduser(nickbuf))) /* Nick is not online */
|
||||
notice_lang(Config.s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 0, "");
|
||||
notice_lang(Config->s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 0, "");
|
||||
else if (u2->IsIdentified() && na && na->nc == u2->Account()) /* Nick is identified */
|
||||
notice_lang(Config.s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 3, u2->Account()->display.c_str());
|
||||
notice_lang(Config->s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 3, u2->Account()->display.c_str());
|
||||
else if (u2->IsRecognized()) /* Nick is recognised, but NOT identified */
|
||||
notice_lang(Config.s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 2, u2->Account() ? u2->Account()->display.c_str() : "");
|
||||
notice_lang(Config->s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 2, u2->Account() ? u2->Account()->display.c_str() : "");
|
||||
else if (!na) /* Nick is online, but NOT a registered */
|
||||
notice_lang(Config.s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 0, "");
|
||||
notice_lang(Config->s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 0, "");
|
||||
else
|
||||
/* Nick is not identified for the nick, but they could be logged into an account,
|
||||
* so we tell the user about it
|
||||
*/
|
||||
notice_lang(Config.s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 1, u2->Account() ? u2->Account()->display.c_str() : "");
|
||||
notice_lang(Config->s_NickServ, u, NICK_STATUS_REPLY, nickbuf.c_str(), 1, u2->Account() ? u2->Account()->display.c_str() : "");
|
||||
}
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bool OnHelp(User *u, const Anope::string &subcommand)
|
||||
{
|
||||
notice_help(Config.s_NickServ, u, NICK_HELP_STATUS);
|
||||
notice_help(Config->s_NickServ, u, NICK_HELP_STATUS);
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnServHelp(User *u)
|
||||
{
|
||||
notice_lang(Config.s_NickServ, u, NICK_HELP_CMD_STATUS);
|
||||
notice_lang(Config->s_NickServ, u, NICK_HELP_CMD_STATUS);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user