Don't use m.call for Jitsi video rooms (#8223)

This commit is contained in:
Robin 2022-04-04 10:29:40 -04:00 committed by GitHub
parent ba71fb169f
commit 371ccd7858
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 14 additions and 14 deletions

View file

@ -375,7 +375,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
}; };
private getMainSplitContentType = (room: Room) => { private getMainSplitContentType = (room: Room) => {
if (SettingsStore.getValue("feature_video_rooms") && room.isCallRoom()) { if (SettingsStore.getValue("feature_video_rooms") && room.isElementVideoRoom()) {
return MainSplitContentType.Video; return MainSplitContentType.Video;
} }
if (WidgetLayoutStore.instance.hasMaximisedWidget(room)) { if (WidgetLayoutStore.instance.hasMaximisedWidget(room)) {

View file

@ -347,7 +347,7 @@ const SpaceLandingAddButton = ({ space }) => {
e.stopPropagation(); e.stopPropagation();
closeMenu(); closeMenu();
if (await showCreateNewRoom(space, RoomType.UnstableCall)) { if (await showCreateNewRoom(space, RoomType.ElementVideo)) {
defaultDispatcher.fire(Action.UpdateSpaceHierarchy); defaultDispatcher.fire(Action.UpdateSpaceHierarchy);
} }
}} }}

View file

@ -105,7 +105,7 @@ const RoomContextMenu = ({ room, onFinished, ...props }: IProps) => {
} }
const isDm = DMRoomMap.shared().getUserIdForRoomId(room.roomId); const isDm = DMRoomMap.shared().getUserIdForRoomId(room.roomId);
const isVideoRoom = useFeatureEnabled("feature_video_rooms") && room.isCallRoom(); const isVideoRoom = useFeatureEnabled("feature_video_rooms") && room.isElementVideoRoom();
let inviteOption: JSX.Element; let inviteOption: JSX.Element;
if (room.canInvite(cli.getUserId()) && !isDm) { if (room.canInvite(cli.getUserId()) && !isDm) {

View file

@ -221,7 +221,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
}); });
render() { render() {
const isVideoRoom = this.props.type === RoomType.UnstableCall; const isVideoRoom = this.props.type === RoomType.ElementVideo;
let aliasField; let aliasField;
if (this.state.joinRule === JoinRule.Public) { if (this.state.joinRule === JoinRule.Public) {

View file

@ -269,7 +269,7 @@ const RoomSummaryCard: React.FC<IProps> = ({ room, onClose }) => {
const isRoomEncrypted = useIsEncrypted(cli, room); const isRoomEncrypted = useIsEncrypted(cli, room);
const roomContext = useContext(RoomContext); const roomContext = useContext(RoomContext);
const e2eStatus = roomContext.e2eStatus; const e2eStatus = roomContext.e2eStatus;
const isVideoRoom = useFeatureEnabled("feature_video_rooms") && room.isCallRoom(); const isVideoRoom = useFeatureEnabled("feature_video_rooms") && room.isElementVideoRoom();
const alias = room.getCanonicalAlias() || room.getAltAliases()[0] || ""; const alias = room.getCanonicalAlias() || room.getAltAliases()[0] || "";
const header = <React.Fragment> const header = <React.Fragment>

View file

@ -243,7 +243,7 @@ const UntaggedAuxButton = ({ tabIndex }: IAuxButtonProps) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
closeMenu(); closeMenu();
showCreateNewRoom(activeSpace, RoomType.UnstableCall); showCreateNewRoom(activeSpace, RoomType.ElementVideo);
}} }}
disabled={!canAddRooms} disabled={!canAddRooms}
tooltip={canAddRooms ? undefined tooltip={canAddRooms ? undefined
@ -289,7 +289,7 @@ const UntaggedAuxButton = ({ tabIndex }: IAuxButtonProps) => {
closeMenu(); closeMenu();
defaultDispatcher.dispatch({ defaultDispatcher.dispatch({
action: "view_create_room", action: "view_create_room",
type: RoomType.UnstableCall, type: RoomType.ElementVideo,
}); });
}} }}
/> } /> }

View file

@ -217,7 +217,7 @@ const RoomListHeader = ({ onVisibilityChange }: IProps) => {
onClick={(e) => { onClick={(e) => {
e.preventDefault(); e.preventDefault();
e.stopPropagation(); e.stopPropagation();
showCreateNewRoom(activeSpace, RoomType.UnstableCall); showCreateNewRoom(activeSpace, RoomType.ElementVideo);
closePlusMenu(); closePlusMenu();
}} }}
/> } /> }
@ -310,7 +310,7 @@ const RoomListHeader = ({ onVisibilityChange }: IProps) => {
e.stopPropagation(); e.stopPropagation();
defaultDispatcher.dispatch({ defaultDispatcher.dispatch({
action: "view_create_room", action: "view_create_room",
type: RoomType.UnstableCall, type: RoomType.ElementVideo,
}); });
closePlusMenu(); closePlusMenu();
}} }}

View file

@ -123,7 +123,7 @@ export default class RoomTile extends React.PureComponent<IProps, IState> {
this.notificationState = RoomNotificationStateStore.instance.getRoomState(this.props.room); this.notificationState = RoomNotificationStateStore.instance.getRoomState(this.props.room);
this.roomProps = EchoChamber.forRoom(this.props.room); this.roomProps = EchoChamber.forRoom(this.props.room);
this.isVideoRoom = SettingsStore.getValue("feature_video_rooms") && this.props.room.isCallRoom(); this.isVideoRoom = SettingsStore.getValue("feature_video_rooms") && this.props.room.isElementVideoRoom();
} }
private onRoomNameUpdate = (room: Room) => { private onRoomNameUpdate = (room: Room) => {

View file

@ -129,7 +129,7 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
}; };
// In video rooms, allow all users to send video member updates // In video rooms, allow all users to send video member updates
if (opts.roomType === RoomType.UnstableCall) { if (opts.roomType === RoomType.ElementVideo) {
createOpts.power_level_content_override = { createOpts.power_level_content_override = {
events: { events: {
[VIDEO_CHANNEL_MEMBER]: 0, [VIDEO_CHANNEL_MEMBER]: 0,
@ -263,7 +263,7 @@ export default async function createRoom(opts: IOpts): Promise<string | null> {
} }
}).then(() => { }).then(() => {
// Set up video rooms with a Jitsi widget // Set up video rooms with a Jitsi widget
if (opts.roomType === RoomType.UnstableCall) { if (opts.roomType === RoomType.ElementVideo) {
return addVideoChannel(roomId, createOpts.name); return addVideoChannel(roomId, createOpts.name);
} }
}).then(function() { }).then(function() {

View file

@ -73,7 +73,7 @@ describe("RoomTile", () => {
describe("video rooms", () => { describe("video rooms", () => {
const room = mkRoom(cli, "!1:example.org"); const room = mkRoom(cli, "!1:example.org");
room.isCallRoom.mockReturnValue(true); room.isElementVideoRoom.mockReturnValue(true);
it("tracks connection state", () => { it("tracks connection state", () => {
const tile = mount( const tile = mount(

View file

@ -367,7 +367,7 @@ export function mkStubRoom(roomId: string = null, name: string, client: MatrixCl
getAvatarUrl: () => 'mxc://avatar.url/room.png', getAvatarUrl: () => 'mxc://avatar.url/room.png',
getMxcAvatarUrl: () => 'mxc://avatar.url/room.png', getMxcAvatarUrl: () => 'mxc://avatar.url/room.png',
isSpaceRoom: jest.fn().mockReturnValue(false), isSpaceRoom: jest.fn().mockReturnValue(false),
isCallRoom: jest.fn().mockReturnValue(false), isElementVideoRoom: jest.fn().mockReturnValue(false),
getUnreadNotificationCount: jest.fn(() => 0), getUnreadNotificationCount: jest.fn(() => 0),
getEventReadUpTo: jest.fn(() => null), getEventReadUpTo: jest.fn(() => null),
getCanonicalAlias: jest.fn(), getCanonicalAlias: jest.fn(),