forked from External/ergo
fix handling of history grace periods
This commit is contained in:
parent
7b10902181
commit
891da73e56
1 changed files with 4 additions and 2 deletions
|
|
@ -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 != "" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue