cs_saset.cpp

Go to the documentation of this file.
00001 /* ChanServ core functions
00002  *
00003  * (C) 2003-2012 Anope Team
00004  * Contact us at team@anope.org
00005  *
00006  * Please read COPYING and README for further details.
00007  *
00008  * Based on the original code of Epona by Lara.
00009  * Based on the original code of Services by Andy Church.
00010  */
00011 
00012 /*************************************************************************/
00013 
00014 #include "module.h"
00015 
00016 class CommandCSSASet : public Command
00017 {
00018  public:
00019         CommandCSSASet(Module *creator) : Command(creator, "chanserv/saset", 2, 3)
00020         {
00021                 this->SetDesc(_("Forcefully set channel options and information"));
00022                 this->SetSyntax(_("\037option\037 \037channel\037 \037parameters\037"));
00023         }
00024 
00025         void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
00026         {
00027                 this->OnSyntaxError(source, "");
00028                 return;
00029         }
00030 
00031         bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
00032         {
00033                 this->SendSyntax(source);
00034                 source.Reply(" ");
00035                 source.Reply(_("Allows Services Operators to forcefully change settings\n"
00036                                 "on channels.\n"
00037                                 " \n"
00038                                 "Available options:"));
00039                 Anope::string this_name = source.command;
00040                 for (CommandInfo::map::const_iterator it = source.service->commands.begin(), it_end = source.service->commands.end(); it != it_end; ++it)
00041                 {
00042                         const Anope::string &c_name = it->first;
00043                         const CommandInfo &info = it->second;
00044                         if (c_name.find_ci(this_name + " ") == 0)
00045                         {
00046                                 ServiceReference<Command> command("Command", info.name);
00047                                 if (command)
00048                                 {
00049                                         source.command = it->first;
00050                                         command->OnServHelp(source);
00051                                 }
00052                         }
00053                 }
00054                 source.Reply(_("Type \002%s%s HELP SASET \037option\037\002 for more information on a\n"
00055                         "particular option."), Config->UseStrictPrivMsgString.c_str(), source.service->nick.c_str());
00056                 return true;
00057         }
00058 };
00059 
00060 class CSSASet : public Module
00061 {
00062         CommandCSSASet commandcssaset;
00063 
00064  public:
00065         CSSASet(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE),
00066                 commandcssaset(this)
00067         {
00068                 this->SetAuthor("Anope");
00069 
00070         }
00071 };
00072 
00073 MODULE_INIT(CSSASet)