summaryrefslogtreecommitdiff
path: root/modules/protocol/inspircd20.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2017-10-08 14:21:59 -0400
committerAdam <Adam@anope.org>2017-10-08 14:21:59 -0400
commit2cb0d9057bf1968d36168a76e25f4cf4d3b33fbf (patch)
tree0a6caccce7e5c4f4bed51964cb130b79d8219f1e /modules/protocol/inspircd20.cpp
parent50f7429fda7cb3ffd8c34abb0a13f3dcc929f2ed (diff)
Remove 2 day xline cap
Diffstat (limited to 'modules/protocol/inspircd20.cpp')
-rw-r--r--modules/protocol/inspircd20.cpp27
1 files changed, 15 insertions, 12 deletions
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());
}