diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js
index 8a5fda6764..219f7de7ab 100644
--- a/app/javascript/flavours/glitch/components/status.js
+++ b/app/javascript/flavours/glitch/components/status.js
@@ -508,8 +508,21 @@ class Status extends ImmutablePureComponent {
const { isExpanded, isCollapsed, forceFilter } = this.state;
let background = null;
let attachments = null;
- let media = [];
- let mediaIcons = [];
+
+ // Depending on user settings, some media are considered as parts of the
+ // contents (affected by CW) while other will be displayed outside of the
+ // CW.
+ let contentMedia = [];
+ let contentMediaIcons = [];
+ let extraMedia = [];
+ let extraMediaIcons = [];
+ let media = contentMedia;
+ let mediaIcons = contentMediaIcons;
+
+ if (settings.getIn(['content_warnings', 'media_outside'])) {
+ media = extraMedia;
+ mediaIcons = extraMediaIcons;
+ }
if (status === null) {
return null;
@@ -681,8 +694,8 @@ class Status extends ImmutablePureComponent {
}
if (status.get('poll')) {
- media.push();
- mediaIcons.push('tasks');
+ contentMedia.push();
+ contentMediaIcons.push('tasks');
}
// Here we prepare extra data-* attributes for CSS selectors.
@@ -748,7 +761,7 @@ class Status extends ImmutablePureComponent {
+
{!isCollapsed || !(muted || !settings.getIn(['collapsed', 'show_action_bar'])) ? (
+ {extraMedia}
+
);
} else if (parseClick) {
@@ -372,6 +376,7 @@ export default class StatusContent extends React.PureComponent {
lang={lang}
/>
{media}
+ {extraMedia}
);
} else {
@@ -391,6 +396,7 @@ export default class StatusContent extends React.PureComponent {
lang={lang}
/>
{media}
+ {extraMedia}
);
}
diff --git a/app/javascript/flavours/glitch/features/local_settings/page/index.js b/app/javascript/flavours/glitch/features/local_settings/page/index.js
index 2490b6e2db..2f16ed50c4 100644
--- a/app/javascript/flavours/glitch/features/local_settings/page/index.js
+++ b/app/javascript/flavours/glitch/features/local_settings/page/index.js
@@ -303,6 +303,15 @@ class LocalSettingsPage extends React.PureComponent {
({ intl, onChange, settings }) => (
+
+
+
+
+
+
diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.js b/app/javascript/flavours/glitch/features/status/components/detailed_status.js
index f4e6c24c54..301a2add6f 100644
--- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js
+++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js
@@ -122,14 +122,27 @@ class DetailedStatus extends ImmutablePureComponent {
return null;
}
- let media = [];
- let mediaIcons = [];
let applicationLink = '';
let reblogLink = '';
let reblogIcon = 'retweet';
let favouriteLink = '';
let edited = '';
+ // Depending on user settings, some media are considered as parts of the
+ // contents (affected by CW) while other will be displayed outside of the
+ // CW.
+ let contentMedia = [];
+ let contentMediaIcons = [];
+ let extraMedia = [];
+ let extraMediaIcons = [];
+ let media = contentMedia;
+ let mediaIcons = contentMediaIcons;
+
+ if (settings.getIn(['content_warnings', 'media_outside'])) {
+ media = extraMedia;
+ mediaIcons = extraMediaIcons;
+ }
+
if (this.props.measureHeight) {
outerStyle.height = `${this.state.height}px`;
}
@@ -199,8 +212,8 @@ class DetailedStatus extends ImmutablePureComponent {
}
if (status.get('poll')) {
- media.push();
- mediaIcons.push('tasks');
+ contentMedia.push();
+ contentMediaIcons.push('tasks');
}
if (status.get('application')) {
@@ -282,8 +295,9 @@ class DetailedStatus extends ImmutablePureComponent {