Skip to content

Commit 67f0b9b

Browse files
authored
Merge pull request #296 from dozro/compat/msc4268
Refactor sendFeedback utility and add ShareE2EEHistory command
2 parents cf4c390 + 8802476 commit 67f0b9b

6 files changed

Lines changed: 189 additions & 204 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
default: minor
3+
---
4+
5+
added a `/sharehistory` command to [share encrypted history with a user](https://github.com/matrix-org/matrix-spec-proposals/blob/rav/proposal/encrypted_history_sharing/proposals/4268-encrypted-history-sharing.md)

src/app/features/settings/experimental/Experimental.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { InfoCard } from '$components/info-card';
44
import { LanguageSpecificPronouns } from '../cosmetics/LanguageSpecificPronouns';
55
import { Sync } from '../general';
66
import { BandwidthSavingEmojis } from './BandwithSavingEmojis';
7+
import { MSC4268HistoryShare } from './MSC4268HistoryShare';
78

89
type ExperimentalProps = {
910
requestClose: () => void;
@@ -43,6 +44,7 @@ export function Experimental({ requestClose }: ExperimentalProps) {
4344
<br />
4445
<Box direction="Column" gap="700">
4546
<Sync />
47+
<MSC4268HistoryShare />
4648
<LanguageSpecificPronouns />
4749
<BandwidthSavingEmojis />
4850
</Box>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { SequenceCard } from '$components/sequence-card';
2+
import { SettingTile } from '$components/setting-tile';
3+
import { useSetting } from '$state/hooks/settings';
4+
import { settingsAtom } from '$state/settings';
5+
import { Box, Switch, Text } from 'folds';
6+
import { SequenceCardStyle } from '../styles.css';
7+
8+
export function MSC4268HistoryShare() {
9+
const [enabledMSC4268Command, setEnabledMSC4268Command] = useSetting(
10+
settingsAtom,
11+
'enableMSC4268CMD'
12+
);
13+
14+
return (
15+
<Box direction="Column" gap="100">
16+
<Text size="L400">Enable Sharing of Encrypted History</Text>
17+
<SequenceCard
18+
className={SequenceCardStyle}
19+
variant="SurfaceVariant"
20+
direction="Column"
21+
gap="100"
22+
>
23+
<SettingTile
24+
title="Enable the /sharehistory command"
25+
description="If enabled, this command will allow users to share encrypted history with other newly joined users, as per MSC4268."
26+
after={
27+
<Switch
28+
variant="Primary"
29+
value={enabledMSC4268Command}
30+
onChange={setEnabledMSC4268Command}
31+
title={
32+
enabledMSC4268Command
33+
? 'Disable /sharehistory command'
34+
: 'Enable /sharehistory command'
35+
}
36+
/>
37+
}
38+
/>
39+
</SequenceCard>
40+
</Box>
41+
);
42+
}

0 commit comments

Comments
 (0)