From 0927a3c56ffea36c217bb62a5160759a7267e662 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 2 Nov 2024 13:36:28 +0100 Subject: [PATCH] Don't prune kicked users. --- misc/infrastructure/powerbot/powerlevels.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/infrastructure/powerbot/powerlevels.go b/misc/infrastructure/powerbot/powerlevels.go index 5f904b4d..5d717874 100644 --- a/misc/infrastructure/powerbot/powerlevels.go +++ b/misc/infrastructure/powerbot/powerlevels.go @@ -99,7 +99,7 @@ func syncPowerLevels(client *mautrix.Client, room id.RoomID, roomGroup []Room, s for user, score := range scores[room] { // Expire users that for some reason did not get pruned from the database. // This may cause them to lose their power level below. - if _, found := roomUsers[room][user]; !found && score.CurrentState != NotActive { + if _, found := roomUsers[room][user]; !found && score.CurrentState != NotActive && score.CurrentState != Kicked { log.Printf("Pruning long inactive user %v from room %v.", user, room) setUserStateAt(room, user, time.Now(), NotActive, NotActive) score.CurrentState = NotActive -- 2.39.2