2023-03-06 12:08:04 +01:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2023-03-06 12:08:04 +01:00
|
|
|
Copyright 2023 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
2025-01-06 11:18:54 +00:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
2024-09-09 14:57:16 +01:00
|
|
|
Please see LICENSE files in the repository root for full details.
|
2023-03-06 12:08:04 +01:00
|
|
|
*/
|
|
|
|
|
|
2025-02-05 13:25:06 +00:00
|
|
|
import React, { type RefObject } from "react";
|
|
|
|
|
import { type MatrixEvent } from "matrix-js-sdk/src/matrix";
|
2026-01-05 17:14:51 +00:00
|
|
|
import { LockSolidIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
|
2023-03-06 12:08:04 +01:00
|
|
|
|
2025-02-05 13:25:06 +00:00
|
|
|
import type ResizeNotifier from "../../utils/ResizeNotifier";
|
2023-03-06 12:08:04 +01:00
|
|
|
import ErrorBoundary from "../views/elements/ErrorBoundary";
|
2025-01-27 20:35:46 +05:30
|
|
|
import RoomHeader from "../views/rooms/RoomHeader/RoomHeader.tsx";
|
2023-03-06 12:08:04 +01:00
|
|
|
import ScrollPanel from "./ScrollPanel";
|
|
|
|
|
import EventTileBubble from "../views/messages/EventTileBubble";
|
|
|
|
|
import NewRoomIntro from "../views/rooms/NewRoomIntro";
|
|
|
|
|
import { UnwrappedEventTile } from "../views/rooms/EventTile";
|
|
|
|
|
import { _t } from "../../languageHandler";
|
2023-05-12 11:25:20 +01:00
|
|
|
import SdkConfig from "../../SdkConfig";
|
2024-12-02 09:49:52 +00:00
|
|
|
import { useScopedRoomContext } from "../../contexts/ScopedRoomContext.tsx";
|
2023-03-06 12:08:04 +01:00
|
|
|
|
|
|
|
|
interface Props {
|
2025-03-28 10:07:41 +00:00
|
|
|
roomView: RefObject<HTMLElement | null>;
|
2023-03-06 12:08:04 +01:00
|
|
|
resizeNotifier: ResizeNotifier;
|
|
|
|
|
inviteEvent: MatrixEvent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Component that displays a waiting room for an encrypted DM with a third party invite.
|
|
|
|
|
* If encryption by default is enabled, DMs with a third party invite should be encrypted as well.
|
|
|
|
|
* To avoid UTDs, users are shown a waiting room until the others have joined.
|
|
|
|
|
*/
|
|
|
|
|
export const WaitingForThirdPartyRoomView: React.FC<Props> = ({ roomView, resizeNotifier, inviteEvent }) => {
|
2024-12-02 09:49:52 +00:00
|
|
|
const context = useScopedRoomContext("room");
|
2023-05-12 11:25:20 +01:00
|
|
|
const brand = SdkConfig.get().brand;
|
2023-03-06 12:08:04 +01:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="mx_RoomView mx_RoomView--local">
|
|
|
|
|
<ErrorBoundary>
|
2024-10-02 13:10:58 +01:00
|
|
|
<RoomHeader room={context.room!} />
|
2023-03-06 12:08:04 +01:00
|
|
|
<main className="mx_RoomView_body" ref={roomView}>
|
|
|
|
|
<div className="mx_RoomView_timeline">
|
2025-10-06 10:23:06 +01:00
|
|
|
<ScrollPanel className="mx_RoomView_messagePanel">
|
2023-03-06 12:08:04 +01:00
|
|
|
<EventTileBubble
|
2026-01-05 17:14:51 +00:00
|
|
|
icon={<LockSolidIcon />}
|
2023-03-06 12:08:04 +01:00
|
|
|
className="mx_cryptoEvent mx_cryptoEvent_icon"
|
2023-10-02 16:13:00 +05:30
|
|
|
title={_t("room|waiting_for_join_title", { brand })}
|
|
|
|
|
subtitle={_t("room|waiting_for_join_subtitle", { brand })}
|
2023-03-06 12:08:04 +01:00
|
|
|
/>
|
|
|
|
|
<NewRoomIntro />
|
|
|
|
|
<UnwrappedEventTile mxEvent={inviteEvent} />
|
|
|
|
|
</ScrollPanel>
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
</ErrorBoundary>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|