mirror of
https://github.com/anope/anope.git
synced 2026-07-07 12:23:13 +02:00
Always show expire time for nicks in /ns info to opers, even if the user is online
Make Anope::strftime show "now" if the time is now Fix typo in nickalias.cpp for the type of the last_seen field, spotted by grawity
This commit is contained in:
@@ -521,7 +521,7 @@ class NickServCore : public Module, public NickServService
|
||||
if (!na->nc->HasExt("UNCONFIRMED"))
|
||||
{
|
||||
time_t nickserv_expire = Config->GetModule(this)->Get<time_t>("expire", "21d");
|
||||
if (!na->HasExt("NS_NO_EXPIRE") && nickserv_expire && !Anope::NoExpire && na->last_seen != Anope::CurTime)
|
||||
if (!na->HasExt("NS_NO_EXPIRE") && nickserv_expire && !Anope::NoExpire && (source.HasPriv("nickserv/auspex") || na->last_seen != Anope::CurTime))
|
||||
info[_("Expires")] = Anope::strftime(na->last_seen + nickserv_expire, source.GetAccount());
|
||||
}
|
||||
else
|
||||
|
||||
+3
-1
@@ -362,8 +362,10 @@ Anope::string Anope::strftime(time_t t, const NickCore *nc, bool short_output)
|
||||
return buf;
|
||||
if (t < Anope::CurTime)
|
||||
return Anope::string(buf) + " " + Anope::printf(Language::Translate(nc, _("(%s ago)")), Duration(Anope::CurTime - t, nc).c_str(), nc);
|
||||
else
|
||||
else if (t > Anope::CurTime)
|
||||
return Anope::string(buf) + " " + Anope::printf(Language::Translate(nc, _("(%s from now)")), Duration(t - Anope::CurTime, nc).c_str(), nc);
|
||||
else
|
||||
return Anope::string(buf) + " " + Language::Translate(nc, _("(now)"));
|
||||
}
|
||||
|
||||
Anope::string Anope::Expires(time_t expires, const NickCore *nc)
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ void NickAlias::Serialize(Serialize::Data &data) const
|
||||
data["last_usermask"] << this->last_usermask;
|
||||
data["last_realhost"] << this->last_realhost;
|
||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["time_registered"] << this->time_registered;
|
||||
data.SetType("time_registered", Serialize::Data::DT_INT); data["last_seen"] << this->last_seen;
|
||||
data.SetType("last_seen", Serialize::Data::DT_INT); data["last_seen"] << this->last_seen;
|
||||
data["nc"] << this->nc->display;
|
||||
|
||||
if (this->HasVhost())
|
||||
|
||||
Reference in New Issue
Block a user