diff options
Diffstat (limited to 'modules/core/cs_set.cpp')
-rw-r--r-- | modules/core/cs_set.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/modules/core/cs_set.cpp b/modules/core/cs_set.cpp index c9331e6a3..b9acb2a53 100644 --- a/modules/core/cs_set.cpp +++ b/modules/core/cs_set.cpp @@ -15,21 +15,22 @@ class CommandCSSet : public Command { - std::map<ci::string, Command *> subcommands; + typedef std::map<Anope::string, Command *, hash_compare_ci_string> subcommand_map; + subcommand_map subcommands; public: - CommandCSSet(const ci::string &cname) : Command(cname, 2, 3) + CommandCSSet(const Anope::string &cname) : Command(cname, 2, 3) { } ~CommandCSSet() { - for (std::map<ci::string, Command *>::const_iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it) + for (subcommand_map::const_iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it) delete it->second; this->subcommands.clear(); } - CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) + CommandReturn Execute(User *u, const std::vector<Anope::string> ¶ms) { if (readonly) { @@ -46,26 +47,26 @@ class CommandCSSet : public Command if (c) { - ci::string cmdparams = cs_findchan(params[0])->name.c_str(); - for (std::vector<ci::string>::const_iterator it = params.begin() + 2, it_end = params.end(); it != it_end; ++it) + Anope::string cmdparams = cs_findchan(params[0])->name; + for (std::vector<Anope::string>::const_iterator it = params.begin() + 2, it_end = params.end(); it != it_end; ++it) cmdparams += " " + *it; mod_run_cmd(ChanServ, u, c, params[1], cmdparams); } else { notice_lang(Config.s_ChanServ, u, CHAN_SET_UNKNOWN_OPTION, params[1].c_str()); - notice_lang(Config.s_ChanServ, u, MORE_INFO, Config.s_ChanServ, "SET"); + notice_lang(Config.s_ChanServ, u, MORE_INFO, Config.s_ChanServ.c_str(), "SET"); } return MOD_CONT; } - bool OnHelp(User *u, const ci::string &subcommand) + bool OnHelp(User *u, const Anope::string &subcommand) { if (subcommand.empty()) { notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_HEAD); - for (std::map<ci::string, Command *>::iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it) + for (subcommand_map::iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it) it->second->OnServHelp(u); notice_help(Config.s_ChanServ, u, CHAN_HELP_SET_TAIL); return true; @@ -81,7 +82,7 @@ class CommandCSSet : public Command return false; } - void OnSyntaxError(User *u, const ci::string &subcommand) + void OnSyntaxError(User *u, const Anope::string &subcommand) { syntax_error(Config.s_ChanServ, u, "SET", CHAN_SET_SYNTAX); } @@ -96,14 +97,14 @@ class CommandCSSet : public Command return this->subcommands.insert(std::make_pair(c->name, c)).second; } - bool DelSubcommand(const ci::string &command) + bool DelSubcommand(const Anope::string &command) { return this->subcommands.erase(command); } - Command *FindCommand(const ci::string &subcommand) + Command *FindCommand(const Anope::string &subcommand) { - std::map<ci::string, Command *>::const_iterator it = this->subcommands.find(subcommand); + subcommand_map::const_iterator it = this->subcommands.find(subcommand); if (it != this->subcommands.end()) return it->second; @@ -115,7 +116,7 @@ class CommandCSSet : public Command class CSSet : public Module { public: - CSSet(const std::string &modname, const std::string &creator) : Module(modname, creator) + CSSet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator) { this->SetAuthor("Anope"); this->SetType(CORE); |