summaryrefslogtreecommitdiff
path: root/modules/protocol/inspircd11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/protocol/inspircd11.cpp')
-rw-r--r--modules/protocol/inspircd11.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/protocol/inspircd11.cpp b/modules/protocol/inspircd11.cpp
index 77b619f64..262892c42 100644
--- a/modules/protocol/inspircd11.cpp
+++ b/modules/protocol/inspircd11.cpp
@@ -110,7 +110,7 @@ class InspIRCdProto : public IRCDProto
{
// Calculate the time left before this would expire, capping it at 2 days
time_t timeleft = x->Expires - Anope::CurTime;
- if (timeleft > 172800)
+ if (timeleft > 172800 || !x->Expires)
timeleft = 172800;
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());
}
@@ -187,7 +187,11 @@ class InspIRCdProto : public IRCDProto
/* SQLINE */
void SendSQLine(User *, const XLine *x)
{
- send_cmd(Config->ServerName, "ADDLINE Q %s %s %ld 0 :%s", x->Mask.c_str(), Config->OperServ.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str());
+ // 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;
+ send_cmd(Config->ServerName, "ADDLINE Q %s %s %ld %ld :%s", x->Mask.c_str(), Config->OperServ.c_str(), static_cast<long>(Anope::CurTime), static_cast<long>(timeleft), x->Reason.c_str());
}
/* SQUIT */
@@ -249,7 +253,11 @@ class InspIRCdProto : public IRCDProto
/* SZLINE */
void SendSZLine(User *, const XLine *x)
{
- send_cmd(Config->ServerName, "ADDLINE Z %s %s %ld 0 :%s", x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), x->Reason.c_str());
+ // 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;
+ send_cmd(Config->ServerName, "ADDLINE Z %s %s %ld %ld :%s", x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime), static_cast<long>(timeleft), x->Reason.c_str());
}
void SendSVSJoin(const Anope::string &source, const Anope::string &nick, const Anope::string &chan, const Anope::string &)