summaryrefslogtreecommitdiff
path: root/modules/commands/ns_group.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-03-09 22:56:51 -0400
committerAdam <Adam@anope.org>2014-03-09 22:59:16 -0400
commit8d1ad6fbe5eba20e78593986f57ccfada5cafaa0 (patch)
tree75b0a44b83ed60799ad2ef71616e4010d91d1af7 /modules/commands/ns_group.cpp
parent750569201a32607b40d920de24c10e9070d7e326 (diff)
Make nickserv/glist show the correct expire time for unconfirmed nicks
Diffstat (limited to 'modules/commands/ns_group.cpp')
-rw-r--r--modules/commands/ns_group.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp
index 0dbc9470e..78c4e164a 100644
--- a/modules/commands/ns_group.cpp
+++ b/modules/commands/ns_group.cpp
@@ -297,14 +297,25 @@ class CommandNSGList : public Command
ListFormatter list(source.GetAccount());
list.AddColumn(_("Nick")).AddColumn(_("Expires"));
- time_t nickserv_expire = Config->GetModule("nickserv")->Get<time_t>("expire");
+ time_t nickserv_expire = Config->GetModule("nickserv")->Get<time_t>("expire", "21d"),
+ unconfirmed_expire = Config->GetModule("nickserv")->Get<time_t>("unconfirmedexpire", "1d");
for (unsigned i = 0; i < nc->aliases->size(); ++i)
{
const NickAlias *na2 = nc->aliases->at(i);
+ Anope::string expires;
+ if (na2->HasExt("NS_NO_EXPIRE"))
+ expires = "Does not expire";
+ else if (!nickserv_expire || Anope::NoExpire)
+ ;
+ else if (na2->nc->HasExt("UNCONFIRMED") && unconfirmed_expire)
+ expires = Anope::strftime(na2->time_registered + unconfirmed_expire, source.GetAccount());
+ else
+ expires = Anope::strftime(na2->last_seen + nickserv_expire, source.GetAccount());
+
ListFormatter::ListEntry entry;
entry["Nick"] = na2->nick;
- entry["Expires"] = (na2->HasExt("NS_NO_EXPIRE") || !nickserv_expire || Anope::NoExpire) ? "Does not expire" : Anope::strftime(na2->last_seen + nickserv_expire, source.GetAccount());
+ entry["Expires"] = expires;
list.AddEntry(entry);
}