From 39cd3018c3e41eee648d5dda0dfa896647a4cb05 Mon Sep 17 00:00:00 2001 From: Hank Shen Date: Thu, 21 Nov 2024 19:02:46 +0800 Subject: [PATCH] update --- application/handler/manager/user.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/application/handler/manager/user.go b/application/handler/manager/user.go index 2992a8770..172ad2020 100644 --- a/application/handler/manager/user.go +++ b/application/handler/manager/user.go @@ -62,10 +62,17 @@ func User(ctx echo.Context) error { rows := m.Objects() var offlineUserIDs []uint for index, row := range rows { - if row.Id != user.Id && row.Online == `Y` && !notice.IsOnline(row.Username) { - row.Online = `N` - rows[index] = row - offlineUserIDs = append(offlineUserIDs, row.Id) + if row.Online == `Y` { + if row.Id != user.Id && !notice.IsOnline(row.Username) { + row.Online = `N` + rows[index] = row + offlineUserIDs = append(offlineUserIDs, row.Id) + } + } else { + if row.Id == user.Id { + row.Online = `Y` + rows[index] = row + } } } if len(offlineUserIDs) > 0 {