show call not supported message on incoming call notification

This commit is contained in:
Ajay Bura
2026-05-13 10:09:13 +05:30
parent 587e25db13
commit 597785bae9
+13
View File
@@ -7,6 +7,7 @@ import {
Avatar, Avatar,
Box, Box,
Button, Button,
color,
config, config,
Dialog, Dialog,
Icon, Icon,
@@ -52,6 +53,7 @@ import { StateEvent } from '../../types/matrix/room';
import { getPowersLevelFromMatrixEvent } from '../hooks/usePowerLevels'; import { getPowersLevelFromMatrixEvent } from '../hooks/usePowerLevels';
import { getRoomCreatorsForRoomId } from '../hooks/useRoomCreators'; import { getRoomCreatorsForRoomId } from '../hooks/useRoomCreators';
import { getRoomPermissionsAPI } from '../hooks/useRoomPermissions'; import { getRoomPermissionsAPI } from '../hooks/useRoomPermissions';
import { useLivekitSupport } from '../hooks/useLivekitSupport';
type IncomingCallInfo = { type IncomingCallInfo = {
room: Room; room: Room;
@@ -72,6 +74,7 @@ type IncomingCallProps = {
function IncomingCall({ dm, info, onIgnore, onAnswer, onReject }: IncomingCallProps) { function IncomingCall({ dm, info, onIgnore, onAnswer, onReject }: IncomingCallProps) {
const mx = useMatrixClient(); const mx = useMatrixClient();
const useAuthentication = useMediaAuthentication(); const useAuthentication = useMediaAuthentication();
const livekitSupported = useLivekitSupport();
const { room } = info; const { room } = info;
const audioRef = useRef<HTMLAudioElement>(null); const audioRef = useRef<HTMLAudioElement>(null);
@@ -176,12 +179,22 @@ function IncomingCall({ dm, info, onIgnore, onAnswer, onReject }: IncomingCallPr
radii="400" radii="400"
onClick={() => onAnswer(room, info.intent === 'video')} onClick={() => onAnswer(room, info.intent === 'video')}
before={<Icon size="200" src={Icons.Phone} filled />} before={<Icon size="200" src={Icons.Phone} filled />}
disabled={!livekitSupported}
> >
<Text as="span" size="B400"> <Text as="span" size="B400">
Answer Answer
</Text> </Text>
</Button> </Button>
</Box> </Box>
{!livekitSupported && (
<Text
style={{ margin: 'auto', color: color.Critical.Main }}
size="L400"
align="Center"
>
Your homeserver does not support calling.
</Text>
)}
</Box> </Box>
</Dialog> </Dialog>
</FocusTrap> </FocusTrap>