make banlist consistent, fixes #54

This commit is contained in:
Aine
2022-12-14 00:35:15 +02:00
parent fcd6110790
commit 2ac6c64d13
2 changed files with 13 additions and 5 deletions

View File

@@ -119,12 +119,14 @@ func (b *Bot) IsTrusted(addr net.Addr) bool {
}
}
b.log.Debug("address %s is NOT trusted", ip)
return false
}
// Ban an address
func (b *Bot) Ban(addr net.Addr) {
if !b.cfg.BanlistEnalbed() {
return
}
if b.IsTrusted(addr) {
return
}