forked from External/ergo
exempt a configurable number of MARKREAD commands from fakelag
This commit is contained in:
parent
7d6ff58bf8
commit
7ad31497c2
6 changed files with 59 additions and 12 deletions
|
|
@ -524,6 +524,7 @@ type FakelagConfig struct {
|
|||
BurstLimit uint `yaml:"burst-limit"`
|
||||
MessagesPerWindow uint `yaml:"messages-per-window"`
|
||||
Cooldown time.Duration
|
||||
CommandBudgets map[string]int `yaml:"command-budgets"`
|
||||
}
|
||||
|
||||
type TorListenersConfig struct {
|
||||
|
|
@ -1428,6 +1429,17 @@ func LoadConfig(filename string) (config *Config, err error) {
|
|||
}
|
||||
config.Server.capValues[caps.Languages] = config.languageManager.CapValue()
|
||||
|
||||
if len(config.Fakelag.CommandBudgets) != 0 {
|
||||
// normalize command names to uppercase:
|
||||
commandBudgets := make(map[string]int, len(config.Fakelag.CommandBudgets))
|
||||
for command, budget := range config.Fakelag.CommandBudgets {
|
||||
commandBudgets[strings.ToUpper(command)] = budget
|
||||
}
|
||||
config.Fakelag.CommandBudgets = commandBudgets
|
||||
} else {
|
||||
config.Fakelag.CommandBudgets = nil
|
||||
}
|
||||
|
||||
if config.Server.Relaymsg.Enabled {
|
||||
for _, char := range protocolBreakingNameCharacters {
|
||||
if strings.ContainsRune(config.Server.Relaymsg.Separators, char) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue