diff options
Diffstat (limited to 'modules/protocol/hybrid.cpp')
-rw-r--r-- | modules/protocol/hybrid.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
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()); } |