Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/components/structures/SpaceRoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ import AccessibleButton, { type ButtonEvent } from "../views/elements/Accessible
import ErrorBoundary from "../views/elements/ErrorBoundary";
import Field from "../views/elements/Field";
import RoomFacePile from "../views/elements/RoomFacePile";
import RoomName from "../views/elements/RoomName";
import RoomTopic from "../views/elements/RoomTopic";
import withValidation from "../views/elements/Validation";
import RoomInfoLine from "../views/rooms/RoomInfoLine";
Expand All @@ -76,6 +75,7 @@ import RightPanel from "./RightPanel";
import SpaceHierarchy, { showRoom } from "./SpaceHierarchy";
import { type RoomPermalinkCreator } from "../../utils/permalinks/Permalinks";
import SpacePillButton from "./SpacePillButton.tsx";
import { useRoomName } from "../../hooks/useRoomName.ts";

interface IProps {
space: Room;
Expand Down Expand Up @@ -214,6 +214,7 @@ const SpaceLanding: React.FC<{ space: Room }> = ({ space }) => {
const cli = useContext(MatrixClientContext);
const myMembership = useMyRoomMembership(space);
const userId = cli.getSafeUserId();
const name = useRoomName(space);

const storeIsShowingSpaceMembers = useCallback(
() =>
Expand Down Expand Up @@ -273,12 +274,7 @@ const SpaceLanding: React.FC<{ space: Room }> = ({ space }) => {
<RoomAvatar room={space} size="80px" viewAvatarOnClick={true} type="square" />
</div>
<div className="mx_SpaceRoomView_landing_name">
<RoomName room={space}>
{(name) => {
const tags = { name: () => <h1>{name}</h1> };
return _t("space|landing_welcome", {}, tags) as JSX.Element;
}}
</RoomName>
{_t("space|landing_welcome", {}, { name: () => <h1>{name}</h1> })}
</div>
<div className="mx_SpaceRoomView_landing_infoBar">
<RoomInfoLine room={space} />
Expand Down
7 changes: 3 additions & 4 deletions src/components/views/dialogs/SpacePreferencesDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import StyledCheckbox from "../elements/StyledCheckbox";
import { useSettingValue } from "../../../hooks/useSettings";
import SettingsStore from "../../../settings/SettingsStore";
import { SettingLevel } from "../../../settings/SettingLevel";
import RoomName from "../elements/RoomName";
import { SpacePreferenceTab } from "../../../dispatcher/payloads/OpenSpacePreferencesPayload";
import { type NonEmptyArray } from "../../../@types/common";
import SettingsTab from "../settings/tabs/SettingsTab";
import { SettingsSection } from "../settings/shared/SettingsSection";
import { SettingsSubsection, SettingsSubsectionText } from "../settings/shared/SettingsSubsection";
import { useRoomName } from "../../../hooks/useRoomName.ts";

interface IProps {
space: Room;
Expand Down Expand Up @@ -60,6 +60,7 @@ const SpacePreferencesAppearanceTab: React.FC<Pick<IProps, "space">> = ({ space
};

const SpacePreferencesDialog: React.FC<IProps> = ({ space, onFinished }) => {
const name = useRoomName(space);
const tabs: NonEmptyArray<Tab<SpacePreferenceTab>> = [
new Tab(
SpacePreferenceTab.Appearance,
Expand All @@ -77,9 +78,7 @@ const SpacePreferencesDialog: React.FC<IProps> = ({ space, onFinished }) => {
title={_t("common|preferences")}
fixedWidth={false}
>
<h4>
<RoomName room={space} />
</h4>
<h4>{name}</h4>
<div className="mx_SettingsDialog_content">
<TabbedView tabs={tabs} activeTabId={SpacePreferenceTab.Appearance} onChange={() => {}} />
</div>
Expand Down
35 changes: 0 additions & 35 deletions src/components/views/elements/RoomName.tsx

This file was deleted.

26 changes: 12 additions & 14 deletions src/components/views/right_panel/RoomSummaryCardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ import { _t } from "../../../languageHandler.tsx";
import RoomAvatar from "../avatars/RoomAvatar.tsx";
import { E2EStatus } from "../../../utils/ShieldUtils.ts";
import { type RoomPermalinkCreator } from "../../../utils/permalinks/Permalinks.ts";
import RoomName from "../elements/RoomName.tsx";
import { Linkify, topicToHtml } from "../../../HtmlUtils.tsx";
import { useRoomSummaryCardViewModel } from "../../viewmodels/right_panel/RoomSummaryCardViewModel.tsx";
import { useRoomTopicViewModel } from "../../viewmodels/right_panel/RoomSummaryCardTopicViewModel.tsx";
import { useRoomName } from "../../../hooks/useRoomName.ts";

interface IProps {
room: Room;
Expand Down Expand Up @@ -131,6 +131,8 @@ const RoomSummaryCardView: React.FC<IProps> = ({
searchTerm = "",
}) => {
const vm = useRoomSummaryCardViewModel(room, permalinkCreator, onSearchCancel);
// XXX: this name should be part of the view model
const name = useRoomName(room);

// The search field is controlled and onSearchChange is debounced in RoomView,
// so we need to set the value of the input right away
Expand All @@ -142,19 +144,15 @@ const RoomSummaryCardView: React.FC<IProps> = ({
const roomInfo = (
<header className="mx_RoomSummaryCard_container">
<RoomAvatar room={room} size="80px" viewAvatarOnClick />
<RoomName room={room}>
{(name) => (
<Heading
as="h1"
size="md"
weight="semibold"
className="mx_RoomSummaryCard_roomName text-primary"
title={name}
>
{name}
</Heading>
)}
</RoomName>
<Heading
as="h1"
size="md"
weight="semibold"
className="mx_RoomSummaryCard_roomName text-primary"
title={name}
>
{name}
</Heading>
<Text
as="div"
size="sm"
Expand Down
7 changes: 3 additions & 4 deletions src/components/views/rooms/RoomPreviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { useRoomState } from "../../../hooks/useRoomState";
import { useMyRoomMembership } from "../../../hooks/useRoomMembers";
import AccessibleButton from "../elements/AccessibleButton";
import InlineSpinner from "../elements/InlineSpinner";
import RoomName from "../elements/RoomName";
import RoomTopic from "../elements/RoomTopic";
import RoomFacePile from "../elements/RoomFacePile";
import RoomAvatar from "../avatars/RoomAvatar";
import MemberAvatar from "../avatars/MemberAvatar";
import { BetaPill } from "../beta/BetaCard";
import RoomInfoLine from "./RoomInfoLine";
import { isVideoRoom as calcIsVideoRoom } from "../../../utils/video-rooms";
import { useRoomName } from "../../../hooks/useRoomName.ts";

interface IProps {
room: Room;
Expand All @@ -56,6 +56,7 @@ const RoomPreviewCard: FC<IProps> = ({ room, onJoinButtonClicked, onRejectButton
const joinRule = useRoomState(room, (state) => state.getJoinRule());
const cannotJoin =
getEffectiveMembership(myMembership) === EffectiveMembership.Leave && joinRule !== JoinRule.Public;
const name = useRoomName(room);

const viewLabs = (): void =>
defaultDispatcher.dispatch({
Expand Down Expand Up @@ -169,9 +170,7 @@ const RoomPreviewCard: FC<IProps> = ({ room, onJoinButtonClicked, onRejectButton
<div className="mx_RoomPreviewCard">
{inviterSection}
<div className="mx_RoomPreviewCard_avatar">{avatarRow}</div>
<h1 className="mx_RoomPreviewCard_name">
<RoomName room={room} />
</h1>
<h1 className="mx_RoomPreviewCard_name">{name}</h1>
<RoomInfoLine room={room} />
<RoomTopic room={room} className="mx_RoomPreviewCard_topic" />
{room.getJoinRule() === "public" && <RoomFacePile room={room} />}
Expand Down
1 change: 0 additions & 1 deletion src/models/Call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,6 @@ export class ElementCall extends Call {
// We can pass the raw EW analyticsID here since we need to trust EC with not sending sensitive data to posthog (EC has access to more sensible data than the analyticsID e.g. the username)
const analyticsID: string = accountAnalyticsData?.pseudonymousAnalyticsOptIn ? accountAnalyticsData?.id : "";

params.append("analyticsID", analyticsID); // Legacy, deprecated in favour of posthogUserId
params.append("posthogUserId", analyticsID);
params.append("posthogApiHost", posthogConfig.api_host);
params.append("posthogApiKey", posthogConfig.project_api_key);
Expand Down
14 changes: 0 additions & 14 deletions src/utils/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
Please see LICENSE files in the repository root for full details.
*/

import { logger } from "matrix-js-sdk/src/logger";
import { type MatrixClient } from "matrix-js-sdk/src/matrix";

import { type IConfigOptions } from "../IConfigOptions";
Expand All @@ -19,19 +18,6 @@ export function getHomePageUrl(appConfig: IConfigOptions, matrixClient: MatrixCl
const pagesConfig = config.get("embedded_pages");
let pageUrl = pagesConfig ? new SnakedObject(pagesConfig).get("home_url") : null;

if (!pageUrl) {
// This is a deprecated config option for the home page
// (despite the name, given we also now have a welcome
// page, which is not the same).
pageUrl = (<any>appConfig).welcomePageUrl;
if (pageUrl) {
logger.warn(
"You are using a deprecated config option: `welcomePageUrl`. Please use " +
"`embedded_pages.home_url` instead, per https://github.com/vector-im/element-web/issues/21428",
);
}
}

if (!pageUrl) {
pageUrl = getEmbeddedPagesWellKnown(matrixClient)?.home_url;
}
Expand Down
1 change: 0 additions & 1 deletion test/unit-tests/models/Call-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,6 @@ describe("ElementCall", () => {
if (!(call instanceof ElementCall)) throw new Error("Failed to create call");

const urlParams = new URLSearchParams(new URL(call.widget.url).hash.slice(1));
expect(urlParams.get("analyticsID")).toBe("123456789987654321");
expect(urlParams.get("posthogUserId")).toBe("123456789987654321");
expect(urlParams.get("posthogApiHost")).toBe("https://posthog");
expect(urlParams.get("posthogApiKey")).toBe("DEADBEEF");
Expand Down
Loading