diff options
author | Adam <Adam@anope.org> | 2011-08-05 05:35:31 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-08-05 05:35:31 -0400 |
commit | e66063e6304538d34c40460ca0aa2be5ddb6bdec (patch) | |
tree | f50fe31097160f8f794669809e4f4ef87f477672 /modules/commands/cs_saset.cpp | |
parent | 9ec18a3b020932eee6242c878149c484f49b13cb (diff) |
Rewrote the example configurations and split them
up into seperate files for each pseudo client.
Also reorganized how the modules are stored, and
made most of the old "extra" modules "core"
Diffstat (limited to 'modules/commands/cs_saset.cpp')
-rw-r--r-- | modules/commands/cs_saset.cpp | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/modules/commands/cs_saset.cpp b/modules/commands/cs_saset.cpp new file mode 100644 index 000000000..699c5bc2c --- /dev/null +++ b/modules/commands/cs_saset.cpp @@ -0,0 +1,74 @@ +/* ChanServ core functions + * + * (C) 2003-2011 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + */ + +/*************************************************************************/ + +#include "module.h" + +class CommandCSSASet : public Command +{ + public: + CommandCSSASet(Module *creator) : Command(creator, "chanserv/saset", 2, 3) + { + this->SetDesc(_("Forcefully set channel options and information")); + this->SetSyntax(_("\037option\037 \037channel\037 \037parameters\037")); + } + + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) + { + this->OnSyntaxError(source, ""); + return; + } + + bool OnHelp(CommandSource &source, const Anope::string &subcommand) + { + this->SendSyntax(source); + source.Reply(" "); + source.Reply(_("Allows Services Operators to forcefully change settings\n" + "on channels.\n" + " \n" + "Available options:")); + Anope::string this_name = source.command; + for (BotInfo::command_map::iterator it = source.owner->commands.begin(), it_end = source.owner->commands.end(); it != it_end; ++it) + { + const Anope::string &c_name = it->first; + CommandInfo &info = it->second; + if (c_name.find_ci(this_name + " ") == 0) + { + service_reference<Command> command(info.name); + if (command) + { + source.command = it->first; + command->OnServHelp(source); + } + } + } + source.Reply(_("Type \002%s%s HELP SASET \037option\037\002 for more information on a\n" + "particular option."), Config->UseStrictPrivMsgString.c_str(), source.owner->nick.c_str()); + return true; + } +}; + +class CSSASet : public Module +{ + CommandCSSASet commandcssaset; + + public: + CSSASet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE), + commandcssaset(this) + { + this->SetAuthor("Anope"); + + ModuleManager::RegisterService(&commandcssaset); + } +}; + +MODULE_INIT(CSSASet) |