1
0
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:
Sadie Powell
2025-04-19 16:43:21 +01:00
parent 18dfa62626
commit 70bf013ef0
7 changed files with 73 additions and 60 deletions
+22 -11
View File
@@ -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> &params) 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;
}
};