diff --git a/src/app/features/room/RoomViewHeader.tsx b/src/app/features/room/RoomViewHeader.tsx index 352ae4b5..9e102f30 100644 --- a/src/app/features/room/RoomViewHeader.tsx +++ b/src/app/features/room/RoomViewHeader.tsx @@ -232,6 +232,21 @@ export function RoomViewHeader() { const setPeopleDrawer = useSetSetting(settingsAtom, 'isPeopleDrawer'); + // I assume there is a global state so I don't have to run this check every time but for now we'll stub this in + const isDirectMessage = () => { + const mDirectsEvent = mx.getAccountData('m.direct'); + const { roomId } = room; + return ( + Object.values(mDirectsEvent?.event.content).filter((e) => { + if (e.indexOf(roomId) === 0) return true; + }).length !== 0 + ); + }; + + const handleCall: MouseEventHandler = (evt) => { + setMenuAnchor(evt.currentTarget.getBoundingClientRect()); + }; + const handleSearchClick = () => { const searchParams: _SearchPathSearchParams = { rooms: room.roomId, @@ -325,6 +340,24 @@ export function RoomViewHeader() { + {isDirectMessage() && ( + + Start a call + + } + > + {(triggerRef) => ( + + + + )} + + )} {!ecryptedRoom && ( } /> + {screenSize === ScreenSize.Desktop && (