summaryrefslogtreecommitdiff
path: root/modules/protocol/unreal.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-11-05 00:11:49 -0400
committerAdam <Adam@anope.org>2011-11-05 00:11:49 -0400
commit5f0b9338dc58923bbbba8293bf9021e87ceb1976 (patch)
tree1f86843375527d98e51a2afaff2dee0eb5e58453 /modules/protocol/unreal.cpp
parentb3194a10c520aa97d0e50ee74554f6c76f7f6c9e (diff)
Set proper expirys on ZLines if the IRCd supports it
Diffstat (limited to 'modules/protocol/unreal.cpp')
-rw-r--r--modules/protocol/unreal.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/protocol/unreal.cpp b/modules/protocol/unreal.cpp
index 6b4d844d5..bb23ade2a 100644
--- a/modules/protocol/unreal.cpp
+++ b/modules/protocol/unreal.cpp
@@ -267,7 +267,11 @@ class UnrealIRCdProto : public IRCDProto
/* SZLINE */
void SendSZLine(User *, const XLine *x)
{
- send_cmd("", "BD + Z * %s %s %ld %ld :%s", x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime + 172800), 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("", "BD + Z * %s %s %ld %ld :%s", x->GetHost().c_str(), x->By.c_str(), static_cast<long>(Anope::CurTime + timeleft), static_cast<long>(x->Created), x->Reason.c_str());
}
/* SGLINE */