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(