1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 18:23:13 +02:00

Show the protection time in the INFO output.

This commit is contained in:
Sadie Powell
2025-04-15 19:26:32 +01:00
parent 3691887297
commit b421ba258e
+8 -3
View File
@@ -157,11 +157,16 @@ public:
void OnNickInfo(CommandSource &source, NickAlias *na, InfoFormatter &info, bool show_hidden) override
{
if (!show_hidden)
if (!protect.HasExt(na->nc))
return;
if (protect.HasExt(na->nc))
info.AddOption(_("Protection"));
info.AddOption(_("Protection"));
if (show_hidden)
{
auto protectafter = na->nc->GetExt<time_t>("PROTECT_AFTER");
auto protect = protectafter ? *protectafter : Config->GetModule("nickserv").Get<time_t>("defaultprotect", "1m");
info[_("Protection after")] = Anope::Duration(protect, source.GetAccount());
}
}
};