From 69a3d7ed5be171acf381067ceb22fb652578dae0 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 30 Mar 2020 15:47:54 +0200 Subject: [PATCH] Use websocket to get last activity --- src/controllers/FriendsController.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/controllers/FriendsController.ts b/src/controllers/FriendsController.ts index e8c6b3f..1796274 100644 --- a/src/controllers/FriendsController.ts +++ b/src/controllers/FriendsController.ts @@ -5,6 +5,8 @@ import { UserHelper } from "../helpers/UserHelper"; import { NotifEventType } from "../entities/Notification"; import { NotificationsHelper } from "../helpers/NotificationsHelper"; import { AccountHelper } from "../helpers/AccountHelper"; +import { UserWebSocketController } from "./UserWebSocketController"; +import { time } from "../utils/DateUtils"; /** * Friends controller @@ -217,7 +219,8 @@ export class FriendsController { let info: any = { ID_friend: friend.friendID, accepted: friend.accepted, - time_last_activity: friend.lastActivityTime + time_last_activity: + UserWebSocketController.IsConnected(friend.friendID) ? time() : friend.lastActivityTime } if(full) {