diff options
author | Adam <Adam@anope.org> | 2017-10-08 14:21:59 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2017-10-08 14:21:59 -0400 |
commit | 2cb0d9057bf1968d36168a76e25f4cf4d3b33fbf (patch) | |
tree | 0a6caccce7e5c4f4bed51964cb130b79d8219f1e /modules | |
parent | 50f7429fda7cb3ffd8c34abb0a13f3dcc929f2ed (diff) |
Remove 2 day xline cap
Diffstat (limited to 'modules')
-rw-r--r-- | modules/protocol/bahamut.cpp | 17 | ||||
-rw-r--r-- | modules/protocol/hybrid.cpp | 18 | ||||
-rw-r--r-- | modules/protocol/inspircd20.cpp | 27 | ||||
-rw-r--r-- | modules/protocol/ngircd.cpp | 9 | ||||
-rw-r--r-- | modules/protocol/ratbox.cpp | 9 | ||||
-rw-r--r-- | modules/protocol/unreal.cpp | 18 |
6 files changed, 49 insertions, 49 deletions
diff --git a/modules/protocol/bahamut.cpp b/modules/protocol/bahamut.cpp index 211570ccb..0d9b22786 100644 --- a/modules/protocol/bahamut.cpp +++ b/modules/protocol/bahamut.cpp @@ -65,11 +65,11 @@ void bahamut::senders::Akill::Send(User* u, XLine* x) } } - // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = x->GetExpires() - Anope::CurTime; - if (timeleft > 172800) - timeleft = 172800; + if (x->IsExpired()) + return; + // Calculate the time left before this would expire + time_t timeleft = x->GetExpires() > 0 ? x->GetExpires() - Anope::CurTime : 0; Uplink::Send("AKILL", x->GetHost(), x->GetUser(), timeleft, x->GetBy(), Anope::CurTime, x->GetReason()); } @@ -194,10 +194,11 @@ void bahamut::senders::SQLineDel::Send(XLine* x) void bahamut::senders::SZLine::Send(User*, XLine* x) { - // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = x->GetExpires() - Anope::CurTime; - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; + if (x->IsExpired()) + return; + + // Calculate the time left before this would expire + time_t timeleft = x->GetExpires() > 0 ? x->GetExpires() - Anope::CurTime : 0; /* this will likely fail so its only here for legacy */ Uplink::Send("SZLINE", x->GetHost(), x->GetReason()); /* this is how we are supposed to deal with it */ diff --git a/modules/protocol/hybrid.cpp b/modules/protocol/hybrid.cpp index 76cad6fd3..d65a6c45f 100644 --- a/modules/protocol/hybrid.cpp +++ b/modules/protocol/hybrid.cpp @@ -62,12 +62,11 @@ void hybrid::senders::Akill::Send(User* u, XLine* x) x->GetMask(), u->GetMask(), u->realname, old->GetMask()); } - /* Calculate the time left before this would expire, capping it at 2 days */ - time_t timeleft = x->GetExpires() - Anope::CurTime; - - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; + if (x->IsExpired()) + return; + /* Calculate the time left before this would expire */ + time_t timeleft = x->GetExpires() > 0 ? x->GetExpires() - Anope::CurTime : 0; Uplink::Send(Config->GetClient("OperServ"), "KLINE", timeleft, x->GetUser(), x->GetHost(), x->GetReason()); } @@ -173,12 +172,11 @@ void hybrid::senders::SQLineDel::Send(XLine* x) void hybrid::senders::SZLine::Send(User*, XLine* x) { - /* Calculate the time left before this would expire, capping it at 2 days */ - time_t timeleft = x->GetExpires() - Anope::CurTime; - - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; + if (x->IsExpired()) + return; + /* Calculate the time left before this would expire */ + time_t timeleft = x->GetExpires() > 0 ? x->GetExpires() - Anope::CurTime : 0; Uplink::Send(Config->GetClient("OperServ"), "DLINE", "*", timeleft, x->GetHost(), x->GetReason()); } diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp index 774d214c6..6fce47af8 100644 --- a/modules/protocol/inspircd20.cpp +++ b/modules/protocol/inspircd20.cpp @@ -39,10 +39,11 @@ static unsigned int spanningtree_proto_ver = 0; void inspircd20::senders::Akill::Send(User* u, XLine* x) { - // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = x->GetExpires() - Anope::CurTime; - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; + if (x->IsExpired()) + return; + + // Calculate the time left before this would expire + time_t timeleft = x->GetExpires() > 0 ? x->GetExpires() - Anope::CurTime : 0; /* InspIRCd may support regex bans, if they do we can send this and forget about it */ if (x->IsRegex() && Servers::Capab.count("RLINE")) @@ -218,10 +219,11 @@ void inspircd20::senders::MessageServer::Send(Server* server) void inspircd20::senders::SQLine::Send(User*, XLine* x) { - // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = x->GetExpires() - Anope::CurTime; - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; + if (x->IsExpired()) + return; + + // Calculate the time left before this would expire + time_t timeleft = x->GetExpires() > 0 ? x->GetExpires() - Anope::CurTime : 0; proto->SendAddLine("Q", x->GetMask(), timeleft, x->GetBy(), x->GetReason()); } @@ -247,10 +249,11 @@ void inspircd20::senders::SQuit::Send(Server *s, const Anope::string &message) void inspircd20::senders::SZLine::Send(User*, XLine* x) { - // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = x->GetExpires() - Anope::CurTime; - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; + if (x->IsExpired()) + return; + + // Calculate the time left before this would expire + time_t timeleft = x->GetExpires() > 0 ? x->GetExpires() - Anope::CurTime : 0; proto->SendAddLine("Z", x->GetHost(), timeleft, x->GetBy(), x->GetReason()); } diff --git a/modules/protocol/ngircd.cpp b/modules/protocol/ngircd.cpp index bbb594ff8..1c95b3942 100644 --- a/modules/protocol/ngircd.cpp +++ b/modules/protocol/ngircd.cpp @@ -26,10 +26,11 @@ void ngircd::senders::Akill::Send(User* u, XLine* x) { - // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = x->GetExpires() - Anope::CurTime; - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; + if (x->IsExpired()) + return; + + // Calculate the time left before this would expire + time_t timeleft = x->GetExpires() > 0 ? x->GetExpires() - Anope::CurTime : 0; Uplink::Send(Me, "GLINE", x->GetMask(), timeleft, x->GetReason() + " (" + x->GetBy() + ")"); } diff --git a/modules/protocol/ratbox.cpp b/modules/protocol/ratbox.cpp index 4541419b7..f8a6d979c 100644 --- a/modules/protocol/ratbox.cpp +++ b/modules/protocol/ratbox.cpp @@ -46,12 +46,11 @@ void ratbox::senders::Logout::Send(User *u) void ratbox::senders::SQLine::Send(User*, XLine* x) { - /* Calculate the time left before this would expire, capping it at 2 days */ - time_t timeleft = x->GetExpires() - Anope::CurTime; - - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; + if (x->IsExpired()) + return; + /* Calculate the time left before this would expire */ + time_t timeleft = x->GetExpires() > 0 ? x->GetExpires() - Anope::CurTime : 0; #warning "find introduced" // Uplink::Send(FindIntroduced(), "ENCAP", "*", "RESV", timeleft, x->GetMask(), 0, x->GetReason()); } diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp index bf4a6a8a8..0ccbc4008 100644 --- a/modules/protocol/unreal.cpp +++ b/modules/protocol/unreal.cpp @@ -73,11 +73,10 @@ void unreal::senders::Akill::Send(User* u, XLine* x) } } - // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = x->GetExpires() - Anope::CurTime; - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; - Uplink::Send("TKL", "+", "G", x->GetUser(), x->GetHost(), x->GetBy(), Anope::CurTime + timeleft, x->GetCreated(), x->GetReason()); + if (x->IsExpired()) + return; + + Uplink::Send("TKL", "+", "G", x->GetUser(), x->GetHost(), x->GetBy(), x->GetExpires(), x->GetCreated(), x->GetReason()); } void unreal::senders::AkillDel::Send(XLine* x) @@ -209,11 +208,10 @@ void unreal::senders::SQLineDel::Send(XLine* x) void unreal::senders::SZLine::Send(User*, XLine* x) { - // Calculate the time left before this would expire, capping it at 2 days - time_t timeleft = x->GetExpires() - Anope::CurTime; - if (timeleft > 172800 || !x->GetExpires()) - timeleft = 172800; - Uplink::Send("TKL", "+", "Z", "*", x->GetHost(), x->GetBy(), Anope::CurTime + timeleft, x->GetCreated(), x->GetReason()); + if (x->IsExpired()) + return; + + Uplink::Send("TKL", "+", "Z", "*", x->GetHost(), x->GetBy(), x->GetExpires(), x->GetCreated(), x->GetReason()); } void unreal::senders::SZLineDel::Send(XLine* x) |