1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 13:46:38 +02:00

Added Anope::CurTime to keep us from calling time() everywhere

This commit is contained in:
Adam
2010-09-10 20:31:31 -04:00
parent 9eb7562bee
commit f00e76d30a
64 changed files with 224 additions and 240 deletions
+2 -4
View File
@@ -354,17 +354,15 @@ Anope::string duration(const NickCore *nc, time_t seconds)
*/
Anope::string expire_left(const NickCore *nc, time_t expires)
{
time_t now = time(NULL);
char buf[256];
if (!expires)
strlcpy(buf, getstring(nc, NO_EXPIRE), sizeof(buf));
else if (expires <= now)
else if (expires <= Anope::CurTime)
strlcpy(buf, getstring(nc, EXPIRES_SOON), sizeof(buf));
else
{
time_t diff = expires - now + 59;
time_t diff = expires - Anope::CurTime + 59;
if (diff >= 86400)
{