]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
Don't prune kicked users. master
authorRudolf Polzer <divVerent@gmail.com>
Sat, 2 Nov 2024 12:36:28 +0000 (13:36 +0100)
committerRudolf Polzer <divVerent@gmail.com>
Sat, 2 Nov 2024 12:36:28 +0000 (13:36 +0100)
misc/infrastructure/powerbot/powerlevels.go

index 5f904b4dcb6ea71443540cefe4a9e9b58146bd72..5d717874b0ce13408991ed80ee25620a6441307b 100644 (file)
@@ -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.
                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
                                log.Printf("Pruning long inactive user %v from room %v.", user, room)
                                setUserStateAt(room, user, time.Now(), NotActive, NotActive)
                                score.CurrentState = NotActive