From 891da73e5664826f0c889d8e75cfea87eab1b109 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Mon, 24 Feb 2020 05:44:55 -0500 Subject: [PATCH] fix handling of history grace periods --- irc/server.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/irc/server.go b/irc/server.go index 24b48094..bda37fa9 100644 --- a/irc/server.go +++ b/irc/server.go @@ -913,12 +913,14 @@ func (server *Server) GetHistorySequence(providedChannel *Channel, client *Clien } if config.History.Restrictions.EnforceRegistrationDate { regCutoff := client.historyCutoff() - regCutoff.Add(-time.Duration(config.History.Restrictions.GracePeriod)) - // take the earlier of the two cutoffs + // take the later of the two cutoffs if regCutoff.After(cutoff) { cutoff = regCutoff } } + if !cutoff.IsZero() { + cutoff = cutoff.Add(-time.Duration(config.History.Restrictions.GracePeriod)) + } if hist != nil { sequence = hist.MakeSequence(recipient, cutoff) } else if recipient != "" {