diff --git a/src/app/features/room/thread/ThreadPanel.tsx b/src/app/features/room/thread/ThreadPanel.tsx index 5ca39c4c8..d1d8cc2d2 100644 --- a/src/app/features/room/thread/ThreadPanel.tsx +++ b/src/app/features/room/thread/ThreadPanel.tsx @@ -28,6 +28,8 @@ import { ThreadNotificationModeSwitcher, } from '../../../components/ThreadNotificationModeSwitcher'; import { useThreadNotificationMode } from '../../../hooks/useThreadNotifications'; +import { useTimestampFormatter } from '../../../hooks/useTimestampFormatter'; +import { getMemberName } from '../../../utils/room'; import { ThreadNotificationMode } from '../../../utils/threadNotifications'; type ThreadPanelHeaderProps = { @@ -37,6 +39,12 @@ type ThreadPanelHeaderProps = { }; function ThreadPanelHeader({ room, threadId, requestClose }: ThreadPanelHeaderProps) { const mode = useThreadNotificationMode(room.roomId, threadId); + const { format } = useTimestampFormatter(); + // [Gitea #165] Who started the thread and when — the first thing you want + // when arriving from the Threads list. + const root = room.findEventById(threadId) ?? room.getThread(threadId)?.rootEvent; + const rootSender = root?.getSender(); + const startedBy = rootSender ? getMemberName(room, rootSender) : undefined; return (
@@ -47,6 +55,7 @@ function ThreadPanelHeader({ room, threadId, requestClose }: ThreadPanelHeaderPr {room.name} + {startedBy && root && ` · started by ${startedBy}, ${format(root.getTs())}`}