Преглед на файлове

Merge pull request #809 from slingamn/graceperiod

fix handling of history grace periods
tags/v2.0.0-rc1
Shivaram Lingamneni преди 4 години
родител
ревизия
7f4c50b81d
No account linked to committer's email address
променени са 1 файла, в които са добавени 4 реда и са изтрити 2 реда
  1. 4
    2
      irc/server.go

+ 4
- 2
irc/server.go Целия файл

@@ -913,12 +913,14 @@ func (server *Server) GetHistorySequence(providedChannel *Channel, client *Clien
913 913
 	}
914 914
 	if config.History.Restrictions.EnforceRegistrationDate {
915 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 917
 		if regCutoff.After(cutoff) {
919 918
 			cutoff = regCutoff
920 919
 		}
921 920
 	}
921
+	if !cutoff.IsZero() {
922
+		cutoff = cutoff.Add(-time.Duration(config.History.Restrictions.GracePeriod))
923
+	}
922 924
 	if hist != nil {
923 925
 		sequence = hist.MakeSequence(recipient, cutoff)
924 926
 	} else if recipient != "" {

Loading…
Отказ
Запис