diff --git a/apps/web/src/components/views/right_panel/RoomSummaryCardView.tsx b/apps/web/src/components/views/right_panel/RoomSummaryCardView.tsx index 23d858e4140..ab397796ea7 100644 --- a/apps/web/src/components/views/right_panel/RoomSummaryCardView.tsx +++ b/apps/web/src/components/views/right_panel/RoomSummaryCardView.tsx @@ -50,6 +50,8 @@ import { 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"; +import { useSettingValue } from "../../../hooks/useSettings.ts"; +import { UIFeature } from "../../../settings/UIFeature.ts"; interface IProps { room: Room; @@ -133,6 +135,7 @@ const RoomSummaryCardView: React.FC = ({ const vm = useRoomSummaryCardViewModel(room, permalinkCreator, onSearchCancel); // XXX: this name should be part of the view model const name = useRoomName(room); + const allowChatExport = useSettingValue(UIFeature.AllowChatExport); // The search field is controlled and onSearchChange is debounced in RoomView, // so we need to set the value of the input right away @@ -288,11 +291,14 @@ const RoomSummaryCardView: React.FC = ({ label={_t("right_panel|polls_button")} onSelect={vm.onRoomPollHistoryClick} /> - + + {allowChatExport && ( + + )} )} diff --git a/apps/web/src/settings/Settings.tsx b/apps/web/src/settings/Settings.tsx index 2d192526710..7419692a27f 100644 --- a/apps/web/src/settings/Settings.tsx +++ b/apps/web/src/settings/Settings.tsx @@ -1433,6 +1433,10 @@ export const SETTINGS: Settings = { supportedLevels: LEVELS_UI_FEATURE, default: true, }, + [UIFeature.AllowChatExport]: { + supportedLevels: LEVELS_UI_FEATURE, + default: true, + }, // Electron-specific settings, they are stored by Electron and set/read over an IPC. // We store them over there are they are necessary to know before the renderer process launches. diff --git a/apps/web/src/settings/UIFeature.ts b/apps/web/src/settings/UIFeature.ts index ddb3d65819e..0b0746d9e41 100644 --- a/apps/web/src/settings/UIFeature.ts +++ b/apps/web/src/settings/UIFeature.ts @@ -26,6 +26,7 @@ export const enum UIFeature { TimelineEnableRelativeDates = "UIFeature.timelineEnableRelativeDates", AllowCreatingPublicRooms = "UIFeature.allowCreatingPublicRooms", AllowCreatingPublicSpaces = "UIFeature.allowCreatingPublicSpaces", + AllowChatExport = "UIFeature.allowChatExport", } export { UIComponent } from "@element-hq/element-web-module-api"; diff --git a/docs/config.md b/docs/config.md index 98209c1f8d4..e88f7f20d2e 100644 --- a/docs/config.md +++ b/docs/config.md @@ -581,6 +581,7 @@ Currently, the following UI feature flags are supported: - `UIFeature.locationSharing` - Whether or not location sharing menus will be shown. - `UIFeature.allowCreatingPublicRooms` - Whether or not public rooms can be created. - `UIFeature.allowCreatingPublicSpaces` - Whether or not public spaces can be created. +- `UIFeature.allowChatExport` - Whether or not chats can be exported. ## Modules