summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-04-15 19:26:32 +0100
committerSadie Powell <sadie@witchery.services>2025-04-15 19:26:32 +0100
commitb421ba258e4332d512edab35ddc3e6e41e297381 (patch)
treee2516da32ea87866e0f2d8418a22de987e79df45 /modules
parent36918872971dd55e77f07d8b2148b1b97a1f631e (diff)
Show the protection time in the INFO output.
Diffstat (limited to 'modules')
-rw-r--r--modules/nickserv/ns_set_protect.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/nickserv/ns_set_protect.cpp b/modules/nickserv/ns_set_protect.cpp
index 12c995486..af4f37e0a 100644
--- a/modules/nickserv/ns_set_protect.cpp
+++ b/modules/nickserv/ns_set_protect.cpp
@@ -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());
+ }
}
};