|
@@ -972,25 +972,28 @@ func (server *Server) GetHistorySequence(providedChannel *Channel, client *Clien
|
972
|
972
|
}
|
973
|
973
|
|
974
|
974
|
var cutoff time.Time
|
975
|
|
- if config.History.Restrictions.ExpireTime != 0 {
|
976
|
|
- cutoff = time.Now().UTC().Add(-time.Duration(config.History.Restrictions.ExpireTime))
|
977
|
|
- }
|
978
|
|
- // #836: registration date cutoff is always enforced for DMs
|
979
|
|
- // either way, take the later of the two cutoffs
|
980
|
|
- if restriction == HistoryCutoffRegistrationTime || channel == nil {
|
981
|
|
- regCutoff := client.historyCutoff()
|
982
|
|
- if regCutoff.After(cutoff) {
|
983
|
|
- cutoff = regCutoff
|
|
975
|
+ // #1593: cutoff is ignored for operators
|
|
976
|
+ if !client.HasRoleCapabs("history") {
|
|
977
|
+ if config.History.Restrictions.ExpireTime != 0 {
|
|
978
|
+ cutoff = time.Now().UTC().Add(-time.Duration(config.History.Restrictions.ExpireTime))
|
984
|
979
|
}
|
985
|
|
- } else if restriction == HistoryCutoffJoinTime {
|
986
|
|
- if joinTimeCutoff.After(cutoff) {
|
987
|
|
- cutoff = joinTimeCutoff
|
|
980
|
+ // #836: registration date cutoff is always enforced for DMs
|
|
981
|
+ // either way, take the later of the two cutoffs
|
|
982
|
+ if restriction == HistoryCutoffRegistrationTime || channel == nil {
|
|
983
|
+ regCutoff := client.historyCutoff()
|
|
984
|
+ if regCutoff.After(cutoff) {
|
|
985
|
+ cutoff = regCutoff
|
|
986
|
+ }
|
|
987
|
+ } else if restriction == HistoryCutoffJoinTime {
|
|
988
|
+ if joinTimeCutoff.After(cutoff) {
|
|
989
|
+ cutoff = joinTimeCutoff
|
|
990
|
+ }
|
988
|
991
|
}
|
989
|
|
- }
|
990
|
992
|
|
991
|
|
- // #836 again: grace period is never applied to DMs
|
992
|
|
- if !cutoff.IsZero() && channel != nil && restriction != HistoryCutoffJoinTime {
|
993
|
|
- cutoff = cutoff.Add(-time.Duration(config.History.Restrictions.GracePeriod))
|
|
993
|
+ // #836 again: grace period is never applied to DMs
|
|
994
|
+ if !cutoff.IsZero() && channel != nil && restriction != HistoryCutoffJoinTime {
|
|
995
|
+ cutoff = cutoff.Add(-time.Duration(config.History.Restrictions.GracePeriod))
|
|
996
|
+ }
|
994
|
997
|
}
|
995
|
998
|
|
996
|
999
|
if hist != nil {
|