From 11c312b11be738a8d50899ecaa97ec5fc5689e8a Mon Sep 17 00:00:00 2001 From: Michael Reber Date: Tue, 30 Dec 2025 11:35:32 +0100 Subject: [PATCH] fixed recurring IPs now only count bans, not unbans --- internal/storage/storage.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/storage/storage.go b/internal/storage/storage.go index 0aba7eb..06e4966 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -669,7 +669,7 @@ func CountBanEventsByIP(ctx context.Context, ip, serverID string) (int64, error) query := ` SELECT COUNT(*) FROM ban_events -WHERE ip = ?` +WHERE ip = ? AND (event_type = 'ban' OR event_type IS NULL)` args := []any{ip} if serverID != "" { @@ -743,7 +743,7 @@ func ListRecurringIPStats(ctx context.Context, since time.Time, minCount, limit query := ` SELECT ip, COALESCE(country, '') AS country, COUNT(*) AS cnt, MAX(occurred_at) AS last_seen FROM ban_events -WHERE ip != ''` +WHERE ip != '' AND (event_type = 'ban' OR event_type IS NULL)` args := []any{} if serverID != "" {