mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-30 19:22:08 +00:00
Renamed to reflect registering moderation setting instead of actions setting, on which the initial implementation was based
28 lines
697 B
Go
28 lines
697 B
Go
// Copyright 2025 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
package setting
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
// Moderation settings
|
|
var Moderation = struct {
|
|
Enabled bool `ini:"ENABLED"`
|
|
RemoveResolvedReportsTimeout time.Duration `ini:"KEEP_RESOLVED_REPORTS_FOR"`
|
|
}{
|
|
Enabled: false,
|
|
}
|
|
|
|
func loadModerationFrom(rootCfg ConfigProvider) error {
|
|
sec := rootCfg.Section("moderation")
|
|
err := sec.MapTo(&Moderation)
|
|
if err != nil {
|
|
return fmt.Errorf("failed to map Moderation settings: %v", err)
|
|
}
|
|
|
|
Moderation.RemoveResolvedReportsTimeout = sec.Key("KEEP_RESOLVED_REPORTS_FOR").MustDuration(10 * time.Minute)
|
|
return nil
|
|
}
|