forked from External/ergo
exempt operators from history cutoffs
See #1593; this enables a client-side implementation of bulk deletion
This commit is contained in:
parent
dd75eb1084
commit
737697d1d4
1 changed files with 19 additions and 16 deletions
|
|
@ -972,6 +972,8 @@ func (server *Server) GetHistorySequence(providedChannel *Channel, client *Clien
|
||||||
}
|
}
|
||||||
|
|
||||||
var cutoff time.Time
|
var cutoff time.Time
|
||||||
|
// #1593: cutoff is ignored for operators
|
||||||
|
if !client.HasRoleCapabs("history") {
|
||||||
if config.History.Restrictions.ExpireTime != 0 {
|
if config.History.Restrictions.ExpireTime != 0 {
|
||||||
cutoff = time.Now().UTC().Add(-time.Duration(config.History.Restrictions.ExpireTime))
|
cutoff = time.Now().UTC().Add(-time.Duration(config.History.Restrictions.ExpireTime))
|
||||||
}
|
}
|
||||||
|
|
@ -992,6 +994,7 @@ func (server *Server) GetHistorySequence(providedChannel *Channel, client *Clien
|
||||||
if !cutoff.IsZero() && channel != nil && restriction != HistoryCutoffJoinTime {
|
if !cutoff.IsZero() && channel != nil && restriction != HistoryCutoffJoinTime {
|
||||||
cutoff = cutoff.Add(-time.Duration(config.History.Restrictions.GracePeriod))
|
cutoff = cutoff.Add(-time.Duration(config.History.Restrictions.GracePeriod))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if hist != nil {
|
if hist != nil {
|
||||||
sequence = hist.MakeSequence(correspondent, cutoff)
|
sequence = hist.MakeSequence(correspondent, cutoff)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue