Move files to more correct location

This commit is contained in:
Gigiaj 2025-05-23 00:01:19 -05:00
parent c108295e5a
commit d54bc2c110
5 changed files with 18 additions and 13 deletions

View file

@ -1,9 +1,8 @@
/* eslint-disable no-nested-ternary */
import { Room } from 'matrix-js-sdk';
import React, { useContext, useMemo } from 'react';
import { useCallback, useEffect, useRef } from 'react';
import React, { useContext, useMemo, useCallback, useEffect, useRef } from 'react';
import { Box } from 'folds';
import { RoomViewHeader } from './RoomViewHeader';
import { RoomViewHeader } from '../room/RoomViewHeader';
import { useCallState } from '../../pages/client/call/CallProvider';
import {
PrimaryRefContext,
@ -34,11 +33,6 @@ type OriginalStyles = {
border?: string;
};
interface CallViewOutletContext {
primaryIframeRef: React.RefObject<HTMLIFrameElement | null>;
backupIframeRef: React.RefObject<HTMLIFrameElement | null>;
}
export function CallView({ room, eventId }: { room: Room; eventId?: string }) {
const primaryIframeRef = useContext(PrimaryRefContext);
const backupIframeRef = useContext(BackupRefContext);

View file

@ -1,3 +1,8 @@
/* eslint-disable no-return-await */
/* eslint-disable no-param-reassign */
/* eslint-disable no-continue */
/* eslint-disable class-methods-use-this */
/* eslint-disable no-dupe-class-members */
/*
* Copyright 2024 New Vector Ltd.
* Copyright 2020-2023 The Matrix.org Foundation C.I.C.
@ -22,7 +27,6 @@ import {
type IGetMediaConfigResult,
type UpdateDelayedEventAction,
OpenIDRequestState,
IOpenIDCredentials,
SimpleObservable,
IOpenIDUpdate,
} from 'matrix-widget-api';
@ -123,6 +127,7 @@ export class SmallWidgetDriver extends WidgetDriver {
EventType.RoomRedaction,
'io.element.call.reaction',
];
// eslint-disable-next-line no-restricted-syntax
for (const eventType of sendRecvRoomEvents) {
this.allowedCapabilities.add(
WidgetEventCapability.forRoomEvent(EventDirection.Send, eventType).raw
@ -145,6 +150,7 @@ export class SmallWidgetDriver extends WidgetDriver {
EventType.CallReplaces,
EventType.CallEncryptionKeysPrefix,
];
// eslint-disable-next-line no-restricted-syntax
for (const eventType of sendRecvToDevice) {
this.allowedCapabilities.add(
WidgetEventCapability.forToDeviceEvent(EventDirection.Send, eventType).raw
@ -166,12 +172,14 @@ export class SmallWidgetDriver extends WidgetDriver {
stateKey: string | null,
targetRoomId: string | null
): Promise<ISendEventDetails>;
public async sendEvent<K extends keyof TimelineEvents>(
eventType: K,
content: TimelineEvents[K],
stateKey: null,
targetRoomId: string | null
): Promise<ISendEventDetails>;
public async sendEvent(
eventType: string,
content: IContent,
@ -194,7 +202,7 @@ export class SmallWidgetDriver extends WidgetDriver {
);
} else if (eventType === EventType.RoomRedaction) {
// special case: extract the `redacts` property and call redact
r = await client.redactEvent(roomId, content['redacts']);
r = await client.redactEvent(roomId, content.redacts);
} else {
// message event
r = await client.sendEvent(
@ -219,6 +227,7 @@ export class SmallWidgetDriver extends WidgetDriver {
stateKey: string | null,
targetRoomId: string | null
): Promise<ISendDelayedEventDetails>;
/**
* @experimental Part of MSC4140 & MSC4157
*/
@ -230,6 +239,7 @@ export class SmallWidgetDriver extends WidgetDriver {
stateKey: null,
targetRoomId: string | null
): Promise<ISendDelayedEventDetails>;
public async sendDelayedEvent(
delay: number | null,
parentDelayId: string | null,
@ -315,8 +325,10 @@ export class SmallWidgetDriver extends WidgetDriver {
// attempt to re-batch these up into a single request
const invertedContentMap: { [content: string]: { userId: string; deviceId: string }[] } = {};
// eslint-disable-next-line no-restricted-syntax
for (const userId of Object.keys(contentMap)) {
const userContentMap = contentMap[userId];
// eslint-disable-next-line no-restricted-syntax
for (const deviceId of Object.keys(userContentMap)) {
const content = userContentMap[deviceId];
const stringifiedContent = JSON.stringify(content);
@ -386,7 +398,7 @@ export class SmallWidgetDriver extends WidgetDriver {
if (since !== undefined && ev.getId() === since) break;
if (ev.getType() !== eventType || ev.isState()) continue;
if (eventType === EventType.RoomMessage && msgtype && msgtype !== ev.getContent()['msgtype'])
if (eventType === EventType.RoomMessage && msgtype && msgtype !== ev.getContent().msgtype)
continue;
if (ev.getStateKey() !== undefined && stateKey !== undefined && ev.getStateKey() !== stateKey)
continue;

View file

@ -9,7 +9,7 @@ import {
SmallWidget,
getWidgetData,
getWidgetUrl,
} from '../../../features/room/SmallWidget';
} from '../../../features/call/SmallWidget';
import { useMatrixClient } from '../../../hooks/useMatrixClient';
import { useClientConfig } from '../../../hooks/useClientConfig';
import { ScreenSize, useScreenSizeContext } from '../../../hooks/useScreenSize';
@ -127,7 +127,6 @@ export function PersistentCallContainer({ children }: PersistentCallContainerPro
widgetApiInstance.once('ready', () => {
logger.info(`PersistentCallContainer: Widget for ${roomIdToSet} is ready.`);
});
}
}
},