diff options
author | Adam <Adam@anope.org> | 2013-05-17 22:53:55 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-05-17 22:53:55 -0400 |
commit | cc4a14b0badfe3d617ec2dd230d7921f8650a069 (patch) | |
tree | 73ded53114ee7b100c548bdb448a6cc36b392da8 /src/command.cpp | |
parent | 934b5843744e586ce9a3c7725a19c7ddffe14ee8 (diff) |
Removed some hard coded command names in help output
Diffstat (limited to 'src/command.cpp')
-rw-r--r-- | src/command.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/command.cpp b/src/command.cpp index b7289b848..421c90b93 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -194,7 +194,7 @@ void Command::OnSyntaxError(CommandSource &source, const Anope::string &subcomma source.Reply(MORE_INFO, Config->StrictPrivmsg.c_str(), source.service->nick.c_str(), source.command.c_str()); } -void RunCommand(CommandSource &source, const Anope::string &message) +void Command::Run(CommandSource &source, const Anope::string &message) { std::vector<Anope::string> params; spacesepstream(message).GetTokens(params); @@ -282,3 +282,28 @@ void RunCommand(CommandSource &source, const Anope::string &message) FOREACH_MOD(I_OnPostCommand, OnPostCommand(source, c, params)); } +bool Command::FindCommandFromService(const Anope::string &command_service, BotInfo* &bot, Anope::string &name) +{ + bot = NULL; + + for (botinfo_map::iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it) + { + BotInfo *bi = it->second; + + for (CommandInfo::map::const_iterator cit = bi->commands.begin(), cit_end = bi->commands.end(); cit != cit_end; ++cit) + { + const Anope::string &c_name = cit->first; + const CommandInfo &info = cit->second; + + if (info.name != command_service) + continue; + + bot = bi; + name = c_name; + return true; + } + } + + return false; +} + |