diff options
author | Adam <Adam@anope.org> | 2011-11-05 00:11:49 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-11-05 00:11:49 -0400 |
commit | 5f0b9338dc58923bbbba8293bf9021e87ceb1976 (patch) | |
tree | 1f86843375527d98e51a2afaff2dee0eb5e58453 /modules/protocol/ratbox.cpp | |
parent | b3194a10c520aa97d0e50ee74554f6c76f7f6c9e (diff) |
Set proper expirys on ZLines if the IRCd supports it
Diffstat (limited to 'modules/protocol/ratbox.cpp')
-rw-r--r-- | modules/protocol/ratbox.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 32acfc3e1..6cb58968f 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -144,8 +144,12 @@ class RatboxProto : public IRCDProto void SendAkill(User *, const XLine *x) { + // Calculate the time left before this would expire, capping it at 2 days + time_t timeleft = x->Expires - Anope::CurTime; + if (timeleft > 172800 || !x->Expires) + timeleft = 172800; BotInfo *bi = findbot(Config->OperServ); - send_cmd(bi ? bi->GetUID() : Config->OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(x->Expires - Anope::CurTime), x->GetUser().c_str(), x->GetHost().c_str(), x->Reason.c_str()); + send_cmd(bi ? bi->GetUID() : Config->OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(timeleft), x->GetUser().c_str(), x->GetHost().c_str(), x->Reason.c_str()); } void SendSVSKillInternal(const BotInfo *source, const User *user, const Anope::string &buf) |