Browse Source

Merge pull request #809 from slingamn/graceperiod

fix handling of history grace periods
tags/v2.0.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
7f4c50b81d
No account linked to committer's email address
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      irc/server.go

+ 4
- 2
irc/server.go View File

913
 	}
913
 	}
914
 	if config.History.Restrictions.EnforceRegistrationDate {
914
 	if config.History.Restrictions.EnforceRegistrationDate {
915
 		regCutoff := client.historyCutoff()
915
 		regCutoff := client.historyCutoff()
916
-		regCutoff.Add(-time.Duration(config.History.Restrictions.GracePeriod))
917
-		// take the earlier of the two cutoffs
916
+		// take the later of the two cutoffs
918
 		if regCutoff.After(cutoff) {
917
 		if regCutoff.After(cutoff) {
919
 			cutoff = regCutoff
918
 			cutoff = regCutoff
920
 		}
919
 		}
921
 	}
920
 	}
921
+	if !cutoff.IsZero() {
922
+		cutoff = cutoff.Add(-time.Duration(config.History.Restrictions.GracePeriod))
923
+	}
922
 	if hist != nil {
924
 	if hist != nil {
923
 		sequence = hist.MakeSequence(recipient, cutoff)
925
 		sequence = hist.MakeSequence(recipient, cutoff)
924
 	} else if recipient != "" {
926
 	} else if recipient != "" {

Loading…
Cancel
Save