diff --git a/apps/matrix/apps/web/src/lib/components/chat/RoomItem.svelte b/apps/matrix/apps/web/src/lib/components/chat/RoomItem.svelte index 31d25537e..5f037431b 100644 --- a/apps/matrix/apps/web/src/lib/components/chat/RoomItem.svelte +++ b/apps/matrix/apps/web/src/lib/components/chat/RoomItem.svelte @@ -27,6 +27,22 @@ .substring(0, 2) .toUpperCase() ); + + // Online status for DMs + let isOnline = $derived(room.isDirect && room.presence === 'online'); + + // Format last active time + let lastActiveText = $derived(() => { + if (!room.isDirect || !room.lastActiveAgo) return ''; + if (room.presence === 'online') return 'Online'; + const minutes = Math.floor(room.lastActiveAgo / 60000); + if (minutes < 1) return 'Gerade aktiv'; + if (minutes < 60) return `Vor ${minutes} Min.`; + const hours = Math.floor(minutes / 60); + if (hours < 24) return `Vor ${hours} Std.`; + const days = Math.floor(hours / 24); + return `Vor ${days} Tag${days > 1 ? 'en' : ''}`; + });