diff options
| author | Adam <Adam@anope.org> | 2015-12-14 16:52:24 -0500 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2015-12-14 16:52:24 -0500 |
| commit | 6302f980fe6dad83aab7d2dc1046dadea5ffd939 (patch) | |
| tree | 4c27d33f55fc32ce34827977932dac4b3e5ceedd /modules/memoserv/staff.cpp | |
| parent | 64dac60071fab652745a6e7a06cf6b7bdbbd3625 (diff) | |
New source tree structure for modules. From commands/cs_access => chanserv/access etc.
Diffstat (limited to 'modules/memoserv/staff.cpp')
| -rw-r--r-- | modules/memoserv/staff.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/modules/memoserv/staff.cpp b/modules/memoserv/staff.cpp new file mode 100644 index 000000000..f563fd9ea --- /dev/null +++ b/modules/memoserv/staff.cpp @@ -0,0 +1,57 @@ +/* MemoServ core functions + * + * (C) 2003-2014 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" +#include "modules/memoserv.h" + +class CommandMSStaff : public Command +{ + public: + CommandMSStaff(Module *creator) : Command(creator, "memoserv/staff", 1, 1) + { + this->SetDesc(_("Send a memo to all opers/admins")); + this->SetSyntax(_("\037memo-text\037")); + } + + void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override + { + if (!MemoServ::service) + return; + + const Anope::string &text = params[0]; + + for (NickServ::Account *nc : NickServ::service->GetAccountList()) + if (source.nc != nc && nc->IsServicesOper()) + MemoServ::service->Send(source.GetNick(), nc->GetDisplay(), text, true); + } + + bool OnHelp(CommandSource &source, const Anope::string &subcommand) override + { + source.Reply(_("Sends all services staff a memo containing \037memo-text\037.")); + + return true; + } +}; + +class MSStaff : public Module +{ + CommandMSStaff commandmsstaff; + + public: + MSStaff(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR) + , commandmsstaff(this) + { + if (!MemoServ::service) + throw ModuleException("No MemoServ!"); + } +}; + +MODULE_INIT(MSStaff) |
