mirror of
https://github.com/anope/anope.git
synced 2026-07-03 06:13:13 +02:00
Allow syntax messages to take a predicate.
This commit is contained in:
@@ -20,7 +20,7 @@ public:
|
||||
CommandNSLogout(Module *creator) : Command(creator, "nickserv/logout", 0, 2)
|
||||
{
|
||||
this->SetDesc(_("Reverses the effect of the IDENTIFY command"));
|
||||
this->SetSyntax(_("[\037nickname\037 [REVALIDATE]]"));
|
||||
this->SetSyntax(_("[\037nickname\037 [REVALIDATE]]"), [](auto &source) { return source.IsServicesOper(); });
|
||||
}
|
||||
|
||||
void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override
|
||||
@@ -64,17 +64,28 @@ public:
|
||||
{
|
||||
this->SendSyntax(source);
|
||||
source.Reply(" ");
|
||||
source.Reply(_(
|
||||
"Without a parameter, reverses the effect of the \002IDENTIFY\002 "
|
||||
"command, i.e. make you not recognized as the real owner of the nick "
|
||||
"anymore. Note, however, that you won't be asked to reidentify "
|
||||
"yourself."
|
||||
"\n\n"
|
||||
"With a parameter, does the same for the given nick. If you "
|
||||
"specify \002REVALIDATE\002 as well, services will ask the given nick "
|
||||
"to re-identify. This is limited to \002Services Operators\002."
|
||||
));
|
||||
|
||||
if (source.IsServicesOper())
|
||||
{
|
||||
source.Reply(_(
|
||||
"Without a parameter, reverses the effect of the \002IDENTIFY\002 "
|
||||
"command, i.e. make you not recognized as the real owner of the nick "
|
||||
"anymore. Note, however, that you won't be asked to reidentify "
|
||||
"yourself."
|
||||
"\n\n"
|
||||
"With a parameter, does the same for the given nick. If you "
|
||||
"specify \002REVALIDATE\002 as well, services will ask the given nick "
|
||||
"to re-identify. This is limited to \002Services Operators\002."
|
||||
));
|
||||
}
|
||||
else
|
||||
{
|
||||
source.Reply(_(
|
||||
"Reverses the effect of the \002IDENTIFY\002 command, i.e. make you not "
|
||||
"recognized as the real owner of the nick anymore. Note, however, that "
|
||||
"you won't be asked to reidentify yourself."
|
||||
));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user