diff options
Diffstat (limited to 'src/core/os_global.cpp')
-rw-r--r-- | src/core/os_global.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/core/os_global.cpp b/src/core/os_global.cpp new file mode 100644 index 000000000..df62f753f --- /dev/null +++ b/src/core/os_global.cpp @@ -0,0 +1,64 @@ +/* OperServ core functions + * + * (C) 2003-2010 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 CommandOSGlobal : public Command +{ + public: + CommandOSGlobal() : Command("GLOBAL", 1, 1, "operserv/global") + { + } + + CommandReturn Execute(User *u, const std::vector<ci::string> ¶ms) + { + const char *msg = params[0].c_str(); + + if (Config.WallOSGlobal) + ircdproto->SendGlobops(OperServ, "\2%s\2 just used GLOBAL command.", u->nick.c_str()); + oper_global(const_cast<char *>(u->nick.c_str()), "%s", msg); + return MOD_CONT; + } + + bool OnHelp(User *u, const ci::string &subcommand) + { + notice_help(Config.s_OperServ, u, OPER_HELP_GLOBAL, Config.s_GlobalNoticer); + return true; + } + + void OnSyntaxError(User *u, const ci::string &subcommand) + { + syntax_error(Config.s_OperServ, u, "GLOBAL", OPER_GLOBAL_SYNTAX); + } + + void OnServHelp(User *u) + { + notice_lang(Config.s_OperServ, u, OPER_HELP_CMD_GLOBAL); + } +}; + +class OSGlobal : public Module +{ + public: + OSGlobal(const std::string &modname, const std::string &creator) : Module(modname, creator) + { + this->SetAuthor("Anope"); + this->SetVersion(VERSION_STRING); + this->SetType(CORE); + + this->AddCommand(OperServ, new CommandOSGlobal()); + } +}; + +MODULE_INIT(OSGlobal) |