switch to another settings key for e2e url previews to protect on change

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2018-06-22 18:44:54 +01:00
parent ed4b82f8fc
commit acbc84a69c
No known key found for this signature in database
GPG key ID: 3F879DA5AD802A5E
3 changed files with 16 additions and 25 deletions

View file

@ -50,7 +50,6 @@ module.exports = React.createClass({
let previewsForAccount = null;
let previewsForRoom = null;
if (!isEncrypted) {
// Only show account setting state and room state setting state in non-e2ee rooms where they apply
const accountEnabled = SettingsStore.getValueAt(SettingLevel.ACCOUNT, "urlPreviewsEnabled");
@ -73,7 +72,7 @@ module.exports = React.createClass({
<label>
<SettingsFlag name="urlPreviewsEnabled"
level={SettingLevel.ROOM}
roomId={this.props.room.roomId}
roomId={roomId}
isExplicit={true}
manualSave={true}
ref="urlPreviewsRoom" />
@ -94,10 +93,10 @@ module.exports = React.createClass({
);
}
const previewsForRoomAccount = (
<SettingsFlag name="urlPreviewsEnabled"
const previewsForRoomAccount = ( // in an e2ee room we use a special key to enforce per-room opt-in
<SettingsFlag name={isEncrypted ? 'urlPreviewsEnabled_e2ee' : 'urlPreviewsEnabled'}
level={SettingLevel.ROOM_ACCOUNT}
roomId={this.props.room.roomId}
roomId={roomId}
manualSave={true}
ref="urlPreviewsSelf"
/>