This commit is contained in:
sadposter 2021-05-12 16:16:13 +01:00
parent 50d5ef7416
commit 350d0b0888
6 changed files with 14 additions and 3 deletions

View file

@ -115,7 +115,7 @@ const PostStatusForm = {
? this.copyMessageScope ? this.copyMessageScope
: this.$store.state.users.currentUser.default_scope : this.$store.state.users.currentUser.default_scope
const { postContentType: contentType, sensitiveByDefault } = this.$store.getters.mergedConfig const { postContentType: contentType, sensitiveByDefault, sensitiveIfSubject } = this.$store.getters.mergedConfig
return { return {
dropFiles: [], dropFiles: [],
@ -272,6 +272,8 @@ const PostStatusForm = {
if (this.preview) this.previewStatus() if (this.preview) this.previewStatus()
}, },
async postStatus (event, newStatus, opts = {}) { async postStatus (event, newStatus, opts = {}) {
const { sensitiveIfSubject } = this.$store.getters.mergedConfig
if (this.posting && !this.optimisticPosting) { return } if (this.posting && !this.optimisticPosting) { return }
if (this.disableSubmit) { return } if (this.disableSubmit) { return }
if (this.emojiInputShown) { return } if (this.emojiInputShown) { return }
@ -307,7 +309,7 @@ const PostStatusForm = {
status: newStatus.status, status: newStatus.status,
spoilerText: newStatus.spoilerText || null, spoilerText: newStatus.spoilerText || null,
visibility: newStatus.visibility, visibility: newStatus.visibility,
sensitive: newStatus.nsfw, sensitive: (newStatus.nsfw || (sensitiveIfSubject && newStatus.spoilerText)),
media: newStatus.files, media: newStatus.files,
store: this.$store, store: this.$store,
inReplyToStatusId: this.replyTo, inReplyToStatusId: this.replyTo,

View file

@ -152,6 +152,11 @@
{{ $t('settings.sensitive_by_default') }} {{ $t('settings.sensitive_by_default') }}
</BooleanSetting> </BooleanSetting>
</li> </li>
<li>
<BooleanSetting path="sensitiveIfSubject">
{{ $t('settings.sensitive_if_subject') }}
</BooleanSetting>
</li>
<li> <li>
<BooleanSetting path="autohideFloatingPostButton"> <BooleanSetting path="autohideFloatingPostButton">
{{ $t('settings.autohide_floating_post_button') }} {{ $t('settings.autohide_floating_post_button') }}

View file

@ -443,6 +443,7 @@
"subject_line_noop": "Do not copy", "subject_line_noop": "Do not copy",
"post_status_content_type": "Post status content type", "post_status_content_type": "Post status content type",
"sensitive_by_default": "Mark posts as sensitive by default", "sensitive_by_default": "Mark posts as sensitive by default",
"sensitive_if_subject": "Automatically mark images as sensitive if a subject line is specified",
"stop_gifs": "Play-on-hover GIFs", "stop_gifs": "Play-on-hover GIFs",
"streaming": "Enable automatic streaming of new posts when scrolled to the top", "streaming": "Enable automatic streaming of new posts when scrolled to the top",
"user_mutes": "Users", "user_mutes": "Users",

View file

@ -575,6 +575,7 @@
"setting_changed": "規定の設定と異なっています", "setting_changed": "規定の設定と異なっています",
"greentext": "引用を緑色で表示", "greentext": "引用を緑色で表示",
"sensitive_by_default": "はじめから投稿をセンシティブとして設定", "sensitive_by_default": "はじめから投稿をセンシティブとして設定",
"sensitive_if_subject": "ステータスにサブジェクトをついたらNSFWにする",
"more_settings": "その他の設定", "more_settings": "その他の設定",
"reply_visibility_self_short": "自分宛のリプライを見る", "reply_visibility_self_short": "自分宛のリプライを見る",
"reply_visibility_following_short": "フォローしている人に宛てられたリプライを見る", "reply_visibility_following_short": "フォローしている人に宛てられたリプライを見る",

View file

@ -68,7 +68,8 @@ export const defaultState = {
hidePostStats: undefined, // instance default hidePostStats: undefined, // instance default
hideUserStats: undefined, // instance default hideUserStats: undefined, // instance default
virtualScrolling: undefined, // instance default virtualScrolling: undefined, // instance default
sensitiveByDefault: undefined // instance default sensitiveByDefault: undefined, // instance default
sensitiveIfSubject: undefined
} }
// caching the instance default properties // caching the instance default properties

View file

@ -44,6 +44,7 @@ const defaultState = {
theme: 'pleroma-dark', theme: 'pleroma-dark',
virtualScrolling: true, virtualScrolling: true,
sensitiveByDefault: false, sensitiveByDefault: false,
sensitiveIfSubject: false,
// Nasty stuff // Nasty stuff
customEmoji: [], customEmoji: [],