From 9d3275024f1b523c1bc065006ab0de3739c0faf3 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 9 Apr 2020 12:05:46 +0200 Subject: [PATCH] Fix bad users sorting --- src/helpers/WebappHelper.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/helpers/WebappHelper.ts b/src/helpers/WebappHelper.ts index bcee41e..fda5202 100644 --- a/src/helpers/WebappHelper.ts +++ b/src/helpers/WebappHelper.ts @@ -2,6 +2,8 @@ import { UserMembershipEntry, UserMembershipType } from "../entities/UserMembers import { FriendsHelper } from "./FriendsHelper"; import { GroupsHelper } from "./GroupsHelper"; import { ConversationsHelper } from "./ConversationsHelper"; +import { UserWebSocketController } from "../controllers/UserWebSocketController"; +import { time } from "../utils/DateUtils"; /** * Web applications helper @@ -27,7 +29,10 @@ export class WebappHelper { // Add friends to the list friendsList.forEach((f) => list.push(new UserMembershipEntry( - f.lastActivityTime, f, UserMembershipType.FRIEND))); + UserWebSocketController.IsConnected(f.friendID) ? time() : f.lastActivityTime, + f, + UserMembershipType.FRIEND + ))); // Add groups to the list for(const g of groupsList) list.push(new UserMembershipEntry(