Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
admpub committed Nov 21, 2024
1 parent 851f2c3 commit 39cd301
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions application/handler/manager/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 39cd301

Please sign in to comment.