From 9132e2c701f9c9e7bab0fdd39bad06fb10b76a7a Mon Sep 17 00:00:00 2001 From: sweshelo Date: Mon, 18 Mar 2024 13:28:17 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A4=96=E9=83=A8=E3=81=AE=E3=82=B5?= =?UTF-8?q?=E3=83=BC=E3=83=90=E3=81=A7=E3=82=82=E6=9C=80=E7=B5=82=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E6=99=82=E5=88=BB=E3=81=8B=E3=82=89=E3=82=AA=E3=83=B3?= =?UTF-8?q?=E3=83=A9=E3=82=A4=E3=83=B3=E7=8A=B6=E6=B3=81=E3=82=92=E6=8E=A8?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/entities/UserEntityService.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index 2b1c4d5c63..433a72cef0 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -376,8 +376,9 @@ export class UserEntityService implements OnModuleInit { @bindThis public getOnlineStatus(user: MiUser): 'unknown' | 'online' | 'active' | 'offline' { if (user.hideOnlineStatus) return 'unknown'; - if (user.lastActiveDate == null) return 'unknown'; - const elapsed = Date.now() - user.lastActiveDate.getTime(); + const activeDate = user.lastActiveDate ?? user.updatedAt + if (activeDate == null) return 'unknown'; + const elapsed = Date.now() - activeDate.getTime(); return ( elapsed < USER_ONLINE_THRESHOLD ? 'online' : elapsed < USER_ACTIVE_THRESHOLD ? 'active' :