diff options
| author | Adam <Adam@anope.org> | 2010-09-10 20:31:31 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2010-09-10 20:31:31 -0400 |
| commit | f00e76d30a86acf0f18bcde5647eedd50de50569 (patch) | |
| tree | 04af81a883ea6e71ec36e35a2822487c7f8192c6 /modules/protocol/inspircd11.cpp | |
| parent | 9eb7562bee7f2a52cf91b0ab0ebc10351f2a46f2 (diff) | |
Added Anope::CurTime to keep us from calling time() everywhere
Diffstat (limited to 'modules/protocol/inspircd11.cpp')
| -rw-r--r-- | modules/protocol/inspircd11.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp index d5cacb6a6..4b92a694c 100644 --- a/modules/protocol/inspircd11.cpp +++ b/modules/protocol/inspircd11.cpp @@ -73,7 +73,7 @@ void inspircd_cmd_chghost(const Anope::string &nick, const Anope::string &vhost) int anope_event_idle(const Anope::string &source, int ac, const char **av) { if (ac == 1) - send_cmd(av[0], "IDLE %s %ld 0", source.c_str(), static_cast<long>(time(NULL))); + send_cmd(av[0], "IDLE %s %ld 0", source.c_str(), static_cast<long>(Anope::CurTime)); return MOD_CONT; } @@ -111,10 +111,10 @@ class InspIRCdProto : public IRCDProto void SendAkill(const XLine *x) { // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = x->Expires - time(NULL); + time_t timeleft = x->Expires - Anope::CurTime; if (timeleft > 172800) timeleft = 172800; - send_cmd(Config->ServerName, "ADDLINE G %s %s %ld %ld :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL)), static_cast<long>(timeleft), x->Reason.c_str()); + send_cmd(Config->ServerName, "ADDLINE G %s %s %ld %ld :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), static_cast<long>(timeleft), x->Reason.c_str()); } void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf) @@ -201,7 +201,7 @@ class InspIRCdProto : public IRCDProto /* SQLINE */ void SendSQLine(const XLine *x) { - send_cmd(Config->ServerName, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config->s_OperServ.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str()); + send_cmd(Config->ServerName, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config->s_OperServ.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str()); } /* SQUIT */ @@ -264,7 +264,7 @@ class InspIRCdProto : public IRCDProto /* SZLINE */ void SendSZLine(const XLine *x) { - send_cmd(Config->ServerName, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(time(NULL)), x->Reason.c_str()); + send_cmd(Config->ServerName, "ADDLINE Z %s %s %ld 0 :%s", x->Mask.c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str()); } void SendSVSJoin(const Anope::string &source, const Anope::string &nick, const Anope::string &chan, const Anope::string &) @@ -279,7 +279,7 @@ class InspIRCdProto : public IRCDProto void SendBOB() { - send_cmd("", "BURST %ld", time(NULL)); + send_cmd("", "BURST %ld", Anope::CurTime); } void SendEOB() @@ -516,7 +516,6 @@ int anope_event_away(const Anope::string &source, int ac, const char **av) int anope_event_topic(const Anope::string &source, int ac, const char **av) { Channel *c = findchan(av[0]); - time_t topic_time = time(NULL); if (!c) { @@ -524,7 +523,7 @@ int anope_event_topic(const Anope::string &source, int ac, const char **av) return MOD_CONT; } - if (check_topiclock(c, topic_time)) + if (check_topiclock(c, Anope::CurTime)) return MOD_CONT; c->topic.clear(); @@ -532,7 +531,7 @@ int anope_event_topic(const Anope::string &source, int ac, const char **av) c->topic = av[1]; c->topic_setter = source; - c->topic_time = topic_time; + c->topic_time = Anope::CurTime; record_topic(av[0]); |
