diff options
author | Adam <Adam@anope.org> | 2013-07-01 22:17:52 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-07-01 22:17:52 -0400 |
commit | 1a3d9a016d3adc49788bbff73aac9b3b5ea85b17 (patch) | |
tree | c0ecf92ed768473bc82ff64a7fce827245f37ba9 /modules/commands/os_noop.cpp | |
parent | 518182ac9204f815258b0de91b3f884d8efa1502 (diff) |
Change extensible keys to require explicitly having a type defined for it. Completely modularize more features like bs_kick, entrymsg, log, mode, etc. Move fantasy to its own module. Move greet to its own module.
Diffstat (limited to 'modules/commands/os_noop.cpp')
-rw-r--r-- | modules/commands/os_noop.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/modules/commands/os_noop.cpp b/modules/commands/os_noop.cpp index 171b11c94..0b5dc74d9 100644 --- a/modules/commands/os_noop.cpp +++ b/modules/commands/os_noop.cpp @@ -35,7 +35,7 @@ class CommandOSNOOP : public Command { /* Remove the O:lines */ IRCD->SendSVSNOOP(s, true); - s->Extend("noop", new ExtensibleItemClass<Anope::string>(source.GetNick())); + s->Extend<Anope::string>("noop", source.GetNick()); Log(LOG_ADMIN, source, this) << "SET on " << s->GetName(); source.Reply(_("All operators from \002%s\002 have been removed."), s->GetName().c_str()); @@ -52,7 +52,7 @@ class CommandOSNOOP : public Command } else if (cmd.equals_ci("REVOKE")) { - s->Shrink("noop"); + s->Shrink<Anope::string>("noop"); IRCD->SendSVSNOOP(s, false); Log(LOG_ADMIN, source, this) << "REVOKE on " << s->GetName(); source.Reply(_("All O:lines of \002%s\002 have been reset."), s->GetName().c_str()); @@ -76,25 +76,23 @@ class CommandOSNOOP : public Command class OSNOOP : public Module { CommandOSNOOP commandosnoop; + PrimitiveExtensibleItem<Anope::string> noop; public: OSNOOP(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, VENDOR), - commandosnoop(this) + commandosnoop(this), noop(this, "noop") { } void OnUserModeSet(User *u, const Anope::string &mname) anope_override { - if (mname == "OPER" && u->server->HasExt("noop")) + Anope::string *setter; + if (mname == "OPER" && (setter = noop.Get(u->server))) { - Anope::string *setter = u->server->GetExt<ExtensibleItemClass<Anope::string> *>("noop"); - if (setter) - { - Anope::string reason = "NOOP command used by " + *setter; - BotInfo *OperServ = Config->GetClient("OperServ"); - u->Kill(OperServ ? OperServ->nick : "", reason); - } + Anope::string reason = "NOOP command used by " + *setter; + BotInfo *OperServ = Config->GetClient("OperServ"); + u->Kill(OperServ ? OperServ->nick : "", reason); } } }; |