mirror of
https://github.com/anope/anope.git
synced 2026-07-05 20:33:13 +02:00
Fixed subcommands
This commit is contained in:
+2
-1
@@ -124,9 +124,10 @@ class CoreExport Command : public Flags<CommandFlag>
|
||||
void SetPermission(const Anope::string &reststr);
|
||||
|
||||
/** Add a subcommand to this command
|
||||
* @param creator The creator of the subcommand
|
||||
* @param c The command
|
||||
*/
|
||||
virtual bool AddSubcommand(Command *c);
|
||||
virtual bool AddSubcommand(Module *creator, Command *c);
|
||||
|
||||
/** Delete a subcommand from this command
|
||||
* @param c The command
|
||||
|
||||
@@ -96,8 +96,10 @@ class CommandCSSASet : public Command
|
||||
source.Reply(CHAN_HELP_CMD_SASET);
|
||||
}
|
||||
|
||||
bool AddSubcommand(Command *c)
|
||||
bool AddSubcommand(Module *creator, Command *c)
|
||||
{
|
||||
c->module = creator;
|
||||
c->service = this->service;
|
||||
return this->subcommands.insert(std::make_pair(c->name, c)).second;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class CSSetNoexpire : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetnoexpire);
|
||||
c->AddSubcommand(this, &commandcssasetnoexpire);
|
||||
}
|
||||
|
||||
~CSSetNoexpire()
|
||||
|
||||
@@ -100,8 +100,10 @@ class CommandCSSet : public Command
|
||||
source.Reply(CHAN_HELP_CMD_SET);
|
||||
}
|
||||
|
||||
bool AddSubcommand(Command *c)
|
||||
bool AddSubcommand(Module *creator, Command *c)
|
||||
{
|
||||
c->module = creator;
|
||||
c->service = this->service;
|
||||
return this->subcommands.insert(std::make_pair(c->name, c)).second;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,11 +92,11 @@ class CSSetBanType : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetbantype);
|
||||
c->AddSubcommand(this, &commandcssetbantype);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetbantype);
|
||||
c->AddSubcommand(this, &commandcssasetbantype);
|
||||
}
|
||||
|
||||
~CSSetBanType()
|
||||
|
||||
@@ -84,11 +84,11 @@ class CSSetDescription : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetdescription);
|
||||
c->AddSubcommand(this, &commandcssetdescription);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetdescription);
|
||||
c->AddSubcommand(this, &commandcssasetdescription);
|
||||
}
|
||||
|
||||
~CSSetDescription()
|
||||
|
||||
@@ -120,11 +120,11 @@ class CSSetFounder : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetfounder);
|
||||
c->AddSubcommand(this, &commandcssetfounder);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetfounder);
|
||||
c->AddSubcommand(this, &commandcssasetfounder);
|
||||
}
|
||||
|
||||
~CSSetFounder()
|
||||
|
||||
@@ -91,11 +91,11 @@ class CSSetKeepTopic : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetkeeptopic);
|
||||
c->AddSubcommand(this, &commandcssetkeeptopic);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetkeeptopic);
|
||||
c->AddSubcommand(this, &commandcssasetkeeptopic);
|
||||
}
|
||||
|
||||
~CSSetKeepTopic()
|
||||
|
||||
@@ -91,11 +91,11 @@ class CSSetOpNotice : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetopnotice);
|
||||
c->AddSubcommand(this, &commandcssetopnotice);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetopnotice);
|
||||
c->AddSubcommand(this, &commandcssasetopnotice);
|
||||
}
|
||||
|
||||
~CSSetOpNotice()
|
||||
|
||||
@@ -91,11 +91,11 @@ class CSSetPeace : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetpeace);
|
||||
c->AddSubcommand(this, &commandcssetpeace);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetpeace);
|
||||
c->AddSubcommand(this, &commandcssasetpeace);
|
||||
}
|
||||
|
||||
~CSSetPeace()
|
||||
|
||||
@@ -149,11 +149,11 @@ class CSSetPersist : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetpeace);
|
||||
c->AddSubcommand(this, &commandcssetpeace);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetpeace);
|
||||
c->AddSubcommand(this, &commandcssasetpeace);
|
||||
}
|
||||
|
||||
~CSSetPersist()
|
||||
|
||||
@@ -91,11 +91,11 @@ class CSSetPrivate : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetprivate);
|
||||
c->AddSubcommand(this, &commandcssetprivate);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetprivate);
|
||||
c->AddSubcommand(this, &commandcssasetprivate);
|
||||
}
|
||||
|
||||
~CSSetPrivate()
|
||||
|
||||
@@ -94,11 +94,11 @@ class CSSetRestricted : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetrestricted);
|
||||
c->AddSubcommand(this, &commandcssetrestricted);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetrestricted);
|
||||
c->AddSubcommand(this, &commandcssasetrestricted);
|
||||
}
|
||||
|
||||
~CSSetRestricted()
|
||||
|
||||
@@ -91,11 +91,11 @@ class CSSetSecure : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetsecure);
|
||||
c->AddSubcommand(this, &commandcssetsecure);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetsecure);
|
||||
c->AddSubcommand(this, &commandcssasetsecure);
|
||||
}
|
||||
|
||||
~CSSetSecure()
|
||||
|
||||
@@ -98,11 +98,11 @@ class CSSetSecureFounder : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetsecurefounder);
|
||||
c->AddSubcommand(this, &commandcssetsecurefounder);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetsecurefounder);
|
||||
c->AddSubcommand(this, &commandcssasetsecurefounder);
|
||||
}
|
||||
|
||||
~CSSetSecureFounder()
|
||||
|
||||
@@ -91,11 +91,11 @@ class CSSetSecureOps : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetsecureops);
|
||||
c->AddSubcommand(this, &commandcssetsecureops);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetsecureops);
|
||||
c->AddSubcommand(this, &commandcssasetsecureops);
|
||||
}
|
||||
|
||||
~CSSetSecureOps()
|
||||
|
||||
@@ -99,11 +99,11 @@ class CSSetSignKick : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetsignkick);
|
||||
c->AddSubcommand(this, &commandcssetsignkick);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetsignkick);
|
||||
c->AddSubcommand(this, &commandcssasetsignkick);
|
||||
}
|
||||
|
||||
~CSSetSignKick()
|
||||
|
||||
@@ -122,11 +122,11 @@ class CSSetSuccessor : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetsuccessor);
|
||||
c->AddSubcommand(this, &commandcssetsuccessor);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetsuccessor);
|
||||
c->AddSubcommand(this, &commandcssasetsuccessor);
|
||||
}
|
||||
|
||||
~CSSetSuccessor()
|
||||
|
||||
@@ -91,11 +91,11 @@ class CSSetTopicLock : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssettopiclock);
|
||||
c->AddSubcommand(this, &commandcssettopiclock);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasettopiclock);
|
||||
c->AddSubcommand(this, &commandcssasettopiclock);
|
||||
}
|
||||
|
||||
~CSSetTopicLock()
|
||||
|
||||
@@ -131,11 +131,11 @@ class CSSetXOP : public Module
|
||||
|
||||
Command *c = FindCommand(ChanServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssetxop);
|
||||
c->AddSubcommand(this, &commandcssetxop);
|
||||
|
||||
c = FindCommand(ChanServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandcssasetxop);
|
||||
c->AddSubcommand(this, &commandcssasetxop);
|
||||
}
|
||||
|
||||
~CSSetXOP()
|
||||
|
||||
@@ -101,8 +101,10 @@ class CommandNSSASet : public Command
|
||||
source.Reply(NICK_HELP_CMD_SASET);
|
||||
}
|
||||
|
||||
bool AddSubcommand(Command *c)
|
||||
bool AddSubcommand(Module *creator, Command *c)
|
||||
{
|
||||
c->module = creator;
|
||||
c->service = this->service;
|
||||
return this->subcommands.insert(std::make_pair(c->name, c)).second;
|
||||
}
|
||||
|
||||
@@ -249,8 +251,8 @@ class NSSASet : public Module
|
||||
|
||||
this->AddCommand(NickServ, &commandnssaset);
|
||||
|
||||
commandnssaset.AddSubcommand(&commandnssasetdisplay);
|
||||
commandnssaset.AddSubcommand(&commandnssasetpassword);
|
||||
commandnssaset.AddSubcommand(this, &commandnssasetdisplay);
|
||||
commandnssaset.AddSubcommand(this, &commandnssasetpassword);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ class NSSASetNoexpire : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasetnoexpire);
|
||||
c->AddSubcommand(this, &commandnssasetnoexpire);
|
||||
}
|
||||
|
||||
~NSSASetNoexpire()
|
||||
|
||||
@@ -95,8 +95,10 @@ class CommandNSSet : public Command
|
||||
source.Reply(NICK_HELP_CMD_SET);
|
||||
}
|
||||
|
||||
bool AddSubcommand(Command *c)
|
||||
bool AddSubcommand(Module *creator, Command *c)
|
||||
{
|
||||
c->module = creator;
|
||||
c->service = this->service;
|
||||
return this->subcommands.insert(std::make_pair(c->name, c)).second;
|
||||
}
|
||||
|
||||
@@ -230,8 +232,8 @@ class NSSet : public Module
|
||||
|
||||
this->AddCommand(NickServ, &commandnsset);
|
||||
|
||||
commandnsset.AddSubcommand(&commandnssetdisplay);
|
||||
commandnsset.AddSubcommand(&commandnssetpassword);
|
||||
commandnsset.AddSubcommand(this, &commandnssetdisplay);
|
||||
commandnsset.AddSubcommand(this, &commandnssetpassword);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -99,11 +99,11 @@ class NSSetAutoOp : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssetautoop);
|
||||
c->AddSubcommand(this, &commandnssetautoop);
|
||||
|
||||
c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasetautoop);
|
||||
c->AddSubcommand(this, &commandnssasetautoop);
|
||||
}
|
||||
|
||||
~NSSetAutoOp()
|
||||
|
||||
@@ -104,11 +104,11 @@ class NSSetEmail : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssetemail);
|
||||
c->AddSubcommand(this, &commandnssetemail);
|
||||
|
||||
c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasetemail);
|
||||
c->AddSubcommand(this, &commandnssasetemail);
|
||||
}
|
||||
|
||||
~NSSetEmail()
|
||||
|
||||
@@ -87,11 +87,11 @@ class NSSetGreet : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssetgreet);
|
||||
c->AddSubcommand(this, &commandnssetgreet);
|
||||
|
||||
c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasetgreet);
|
||||
c->AddSubcommand(this, &commandnssasetgreet);
|
||||
}
|
||||
|
||||
~NSSetGreet()
|
||||
|
||||
@@ -133,11 +133,11 @@ class NSSetHide : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssethide);
|
||||
c->AddSubcommand(this, &commandnssethide);
|
||||
|
||||
c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasethide);
|
||||
c->AddSubcommand(this, &commandnssasethide);
|
||||
}
|
||||
|
||||
~NSSetHide()
|
||||
|
||||
@@ -123,11 +123,11 @@ class NSSetKill : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssetkill);
|
||||
c->AddSubcommand(this, &commandnssetkill);
|
||||
|
||||
c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasetkill);
|
||||
c->AddSubcommand(this, &commandnssasetkill);
|
||||
}
|
||||
|
||||
~NSSetKill()
|
||||
|
||||
@@ -109,11 +109,11 @@ class NSSetLanguage : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssetlanguage);
|
||||
c->AddSubcommand(this, &commandnssetlanguage);
|
||||
|
||||
c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasetlanguage);
|
||||
c->AddSubcommand(this, &commandnssasetlanguage);
|
||||
}
|
||||
|
||||
~NSSetLanguage()
|
||||
|
||||
@@ -105,11 +105,11 @@ class NSSetMessage : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssetmessage);
|
||||
c->AddSubcommand(this, &commandnssetmessage);
|
||||
|
||||
c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasetmessage);
|
||||
c->AddSubcommand(this, &commandnssasetmessage);
|
||||
}
|
||||
|
||||
~NSSetMessage()
|
||||
|
||||
@@ -99,11 +99,11 @@ class NSSetPrivate : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssetprivate);
|
||||
c->AddSubcommand(this, &commandnssetprivate);
|
||||
|
||||
c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasetprivate);
|
||||
c->AddSubcommand(this, &commandnssasetprivate);
|
||||
}
|
||||
|
||||
~NSSetPrivate()
|
||||
|
||||
@@ -99,11 +99,11 @@ class NSSetSecure : public Module
|
||||
|
||||
Command *c = FindCommand(NickServ, "SET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssetsecure);
|
||||
c->AddSubcommand(this, &commandnssetsecure);
|
||||
|
||||
c = FindCommand(NickServ, "SASET");
|
||||
if (c)
|
||||
c->AddSubcommand(&commandnssasetsecure);
|
||||
c->AddSubcommand(this, &commandnssasetsecure);
|
||||
}
|
||||
|
||||
~NSSetSecure()
|
||||
|
||||
@@ -158,9 +158,9 @@ class CSSetMisc : public Module
|
||||
}
|
||||
|
||||
if (set)
|
||||
set->AddSubcommand(new CommandCSSetMisc(cname, desc));
|
||||
set->AddSubcommand(this, new CommandCSSetMisc(cname, desc));
|
||||
if (saset)
|
||||
saset->AddSubcommand(new CommandCSSASetMisc(cname, desc));
|
||||
saset->AddSubcommand(this, new CommandCSSASetMisc(cname, desc));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -161,9 +161,9 @@ class NSSetMisc : public Module
|
||||
}
|
||||
|
||||
if (set)
|
||||
set->AddSubcommand(new CommandNSSetMisc(cname, desc));
|
||||
set->AddSubcommand(this, new CommandNSSetMisc(cname, desc));
|
||||
if (saset)
|
||||
saset->AddSubcommand(new CommandNSSASetMisc(cname, desc));
|
||||
saset->AddSubcommand(this, new CommandNSSASetMisc(cname, desc));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -89,7 +89,7 @@ void Command::SetPermission(const Anope::string &reststr)
|
||||
this->permission = reststr;
|
||||
}
|
||||
|
||||
bool Command::AddSubcommand(Command *c)
|
||||
bool Command::AddSubcommand(Module *creator, Command *c)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user