diff --git a/app/javascript/mastodon/features/compose/containers/warning_container.jsx b/app/javascript/mastodon/features/compose/containers/warning_container.jsx index 9f9285d74d3..88ec2160149 100644 --- a/app/javascript/mastodon/features/compose/containers/warning_container.jsx +++ b/app/javascript/mastodon/features/compose/containers/warning_container.jsx @@ -10,15 +10,17 @@ import { HASHTAG_PATTERN_REGEX } from 'mastodon/utils/hashtags'; import Warning from '../components/warning'; const mapStateToProps = state => ({ + sensitiveAttachmentHint: state.getIn(['compose', 'spoiler']) !== false && state.getIn(['compose', 'media_attachments']).size > 0, hashtagWarning: state.getIn(['compose', 'privacy']) !== 'public' && HASHTAG_PATTERN_REGEX.test(state.getIn(['compose', 'text'])), needsLockWarning: state.getIn(['compose', 'privacy']) === 'private' && !state.getIn(['accounts', me, 'locked']), directMessageWarning: state.getIn(['compose', 'privacy']) === 'direct', }); -const WarningWrapper = ({ hashtagWarning, needsLockWarning, directMessageWarning }) => { - if ( hashtagWarning || needsLockWarning || directMessageWarning) { +const WarningWrapper = ({ sensitiveAttachmentHint, hashtagWarning, needsLockWarning, directMessageWarning }) => { + if ( sensitiveAttachmentHint || hashtagWarning || needsLockWarning || directMessageWarning) { const message = ( <> + {sensitiveAttachmentHint && } {hashtagWarning && } {needsLockWarning && }} />} {directMessageWarning && } @@ -31,9 +33,10 @@ const WarningWrapper = ({ hashtagWarning, needsLockWarning, directMessageWarning }; WarningWrapper.propTypes = { + sensitiveAttachmentHint: PropTypes.bool, hashtagWarning: PropTypes.bool, needsLockWarning: PropTypes.bool, directMessageWarning: PropTypes.bool, }; -export default connect(mapStateToProps)(WarningWrapper); +export default connect(mapStateToProps)(WarningWrapper); \ No newline at end of file diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 881ed19e0e4..f3d2b99b2fb 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -152,6 +152,7 @@ "compose_form.hashtag_warning": "This post won't be listed under any hashtag as it is not public. Only public posts can be searched by hashtag.", "compose_form.lock_disclaimer": "Your account is not {locked}. Anyone can follow you to view your follower-only posts.", "compose_form.lock_disclaimer.lock": "locked", + "compose_form.sensitive_attachment_hint": "Leave the content warning field empty to mark only the post attachments as sensitive.", "compose_form.placeholder": "What's on your mind?", "compose_form.poll.duration": "Poll duration", "compose_form.poll.multiple": "Multiple choice",