diff options
author | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-07-25 21:58:20 -0400 |
---|---|---|
committer | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-07-25 21:58:20 -0400 |
commit | ae38212c1ce829c783edf971081c90137abb49a0 (patch) | |
tree | 5c652d9cdc38103dec6fa112d57fca882b4e3e44 /modules/core/cs_help.cpp | |
parent | 15d7f0f6fe8bb903275f603f734c13f65f3aa906 (diff) |
Epic commit to replace most of the strings in Anope with a single Anope::string class, plus some other little fixes here and there. If you follow 1.9.x development and are testing things, THIS is one of those things that NEEDS testing.
Diffstat (limited to 'modules/core/cs_help.cpp')
-rw-r--r-- | modules/core/cs_help.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/core/cs_help.cpp b/modules/core/cs_help.cpp index 536a6e423..0a6ba7aaf 100644 --- a/modules/core/cs_help.cpp +++ b/modules/core/cs_help.cpp @@ -22,31 +22,31 @@ class CommandCSHelp : public Command this->SetFlag(CFLAG_STRIP_CHANNEL); } - CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms) { - ci::string cmd = params[0]; + Anope::string cmd = params[0]; - if (cmd == "LEVELS DESC") + if (cmd.equals_ci("LEVELS DESC")) { int i; notice_help(Config.s_ChanServ, u, CHAN_HELP_LEVELS_DESC); if (!levelinfo_maxwidth) for (i = 0; levelinfo[i].what >= 0; ++i) { - int len = strlen(levelinfo[i].name); + int len = levelinfo[i].name.length(); if (len > levelinfo_maxwidth) levelinfo_maxwidth = len; } for (i = 0; levelinfo[i].what >= 0; ++i) - notice_help(Config.s_ChanServ, u, CHAN_HELP_LEVELS_DESC_FORMAT, levelinfo_maxwidth, levelinfo[i].name, getstring(u, levelinfo[i].desc)); + notice_help(Config.s_ChanServ, u, CHAN_HELP_LEVELS_DESC_FORMAT, levelinfo_maxwidth, levelinfo[i].name.c_str(), getstring(u, levelinfo[i].desc)); } else - mod_help_cmd(ChanServ, u, cmd.c_str()); + mod_help_cmd(ChanServ, u, cmd); return MOD_CONT; } - void OnSyntaxError(User *u, const ci::string &subcommand) + void OnSyntaxError(User *u, const Anope::string &subcommand) { notice_help(Config.s_ChanServ, u, CHAN_HELP); for (CommandMap::const_iterator it = ChanServ->Commands.begin(); it != ChanServ->Commands.end(); ++it) @@ -62,10 +62,11 @@ class CommandCSHelp : public Command class CSHelp : public Module { public: - CSHelp(const std::string &modname, const std::string &creator) : Module(modname, creator) + CSHelp(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator) { this->SetAuthor("Anope"); this->SetType(CORE); + this->AddCommand(ChanServ, new CommandCSHelp()); } }; |