mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-20 22:38:11 -07:00
track channel registrations per account
* limit the total number of registrations per account * when an account is unregistered, unregister all its channels
This commit is contained in:
+6
-1
@@ -181,7 +181,8 @@ type NickReservationConfig struct {
|
||||
|
||||
// ChannelRegistrationConfig controls channel registration.
|
||||
type ChannelRegistrationConfig struct {
|
||||
Enabled bool
|
||||
Enabled bool
|
||||
MaxChannelsPerAccount int `yaml:"max-channels-per-account"`
|
||||
}
|
||||
|
||||
// OperClassConfig defines a specific operator class.
|
||||
@@ -789,6 +790,10 @@ func LoadConfig(filename string) (config *Config, err error) {
|
||||
config.Accounts.Registration.BcryptCost = passwd.DefaultCost
|
||||
}
|
||||
|
||||
if config.Channels.Registration.MaxChannelsPerAccount == 0 {
|
||||
config.Channels.Registration.MaxChannelsPerAccount = 10
|
||||
}
|
||||
|
||||
// in the current implementation, we disable history by creating a history buffer
|
||||
// with zero capacity. but the `enabled` config option MUST be respected regardless
|
||||
// of this detail
|
||||
|
||||
Reference in New Issue
Block a user