diff options
author | Adam <Adam@anope.org> | 2011-08-01 22:37:27 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-08-01 22:37:27 -0400 |
commit | f7adc0b35b50f06706872a161f1c7476e6e6981e (patch) | |
tree | 91fbe281f2772136a327fd4fc4c64740d1ab65ab /modules/core/cs_status.cpp | |
parent | 710c02f3bd3581b7c5b3d48e7604756975219fc8 (diff) |
Rewrote the access systems and added a flags access system
Diffstat (limited to 'modules/core/cs_status.cpp')
-rw-r--r-- | modules/core/cs_status.cpp | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/modules/core/cs_status.cpp b/modules/core/cs_status.cpp deleted file mode 100644 index 586a3b2ce..000000000 --- a/modules/core/cs_status.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* 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 CommandCSStatus : public Command -{ - public: - CommandCSStatus(Module *creator) : Command(creator, "chanserv/status", 2, 2, "chanserv/status") - { - this->SetDesc(_("Returns the current access level of a user on a channel")); - this->SetSyntax(_("\037channel\037 \037item\037")); - } - - void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) - { - const Anope::string &nick = params[1]; - - ChannelInfo *ci = cs_findchan(params[0]); - if (ci == NULL) - { - source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str()); - return; - } - - User *u2 = finduser(nick); - ChanAccess *u2_access = ci->GetAccess(u2); - if (u2) - source.Reply(_("STATUS %s %s %d"), ci->name.c_str(), u2->nick.c_str(), u2_access ? u2_access->level : 0); - else /* !u2 */ - source.Reply(_("STATUS ERROR Nick %s not online"), nick.c_str()); - return; - } - - bool OnHelp(CommandSource &source, const Anope::string &subcommand) - { - this->SendSyntax(source); - source.Reply(" "); - source.Reply(_("Returns the current access level of the given nick on the\n" - "given channel. The reply is of the form:\n" - " \n" - " STATUS \037channel\037 \037nickname\037 \037access-level\037\n" - " \n" - "If an error occurs, the reply will be in the form:\n" - " \n" - " STATUS ERROR \037error-message\037")); - return true; - } -}; - -class CSStatus : public Module -{ - CommandCSStatus commandcsstatus; - - public: - CSStatus(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, CORE), - commandcsstatus(this) - { - this->SetAuthor("Anope"); - - ModuleManager::RegisterService(&commandcsstatus); - } -}; - -MODULE_INIT(CSStatus) |