From 3f23aecd10e570f78b4142687a9a3fa349c13018 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 23 Feb 2021 10:00:23 +0200 Subject: [PATCH 1/3] add sensitive by default option --- src/components/post_status_form/post_status_form.js | 4 ++-- src/components/settings_modal/tabs/general_tab.vue | 7 ++++++- src/i18n/en.json | 1 + src/modules/config.js | 3 ++- src/modules/instance.js | 1 + 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 4148381c..e540654b 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -115,7 +115,7 @@ const PostStatusForm = { ? this.copyMessageScope : this.$store.state.users.currentUser.default_scope - const { postContentType: contentType } = this.$store.getters.mergedConfig + const { postContentType: contentType, sensitiveByDefault } = this.$store.getters.mergedConfig return { dropFiles: [], @@ -126,7 +126,7 @@ const PostStatusForm = { newStatus: { spoilerText: this.subject || '', status: statusText, - nsfw: false, + nsfw: !!sensitiveByDefault, files: [], poll: {}, mediaDescriptions: {}, diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index f93f4ea0..9228c78e 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -144,7 +144,12 @@
  • - {{ $t('settings.minimal_scopes_mode') }} {{ minimalScopesModeDefaultValue }} + {{ $t('settings.minimal_scopes_mode') }} + +
  • +
  • + + {{ $t('settings.sensitive_by_default') }}
  • diff --git a/src/i18n/en.json b/src/i18n/en.json index 0e069785..e6acda9c 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -429,6 +429,7 @@ "subject_line_mastodon": "Like mastodon: copy as is", "subject_line_noop": "Do not copy", "post_status_content_type": "Post status content type", + "sensitive_by_default": "Mark posts as sensitive by default", "stop_gifs": "Play-on-hover GIFs", "streaming": "Enable automatic streaming of new posts when scrolled to the top", "user_mutes": "Users", diff --git a/src/modules/config.js b/src/modules/config.js index f992519e..b08903d1 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -67,7 +67,8 @@ export const defaultState = { greentext: undefined, // instance default hidePostStats: undefined, // instance default hideUserStats: undefined, // instance default - virtualScrolling: undefined // instance default + virtualScrolling: undefined, // instance default + sensitiveByDefault: undefined } // caching the instance default properties diff --git a/src/modules/instance.js b/src/modules/instance.js index 411b1caa..96de73ca 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -43,6 +43,7 @@ const defaultState = { subjectLineBehavior: 'email', theme: 'pleroma-dark', virtualScrolling: true, + sensitiveByDefault: false, // Nasty stuff customEmoji: [], From 29dae3c12e9533f9d9b8ce058686f9a6a47719ad Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 23 Feb 2021 10:03:29 +0200 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fbb3575..0abc3929 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added - Added reason field for registration when approval is required +- Added option to mark posts as sensitive by default ## [2.2.3] - 2021-01-18 ### Added From ecb211606cddeeec809c8a6bc39f9c96a0af95f5 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Tue, 23 Feb 2021 10:06:45 +0200 Subject: [PATCH 3/3] change config comment to be consistent --- src/modules/config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/config.js b/src/modules/config.js index b08903d1..eca58c12 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -68,7 +68,7 @@ export const defaultState = { hidePostStats: undefined, // instance default hideUserStats: undefined, // instance default virtualScrolling: undefined, // instance default - sensitiveByDefault: undefined + sensitiveByDefault: undefined // instance default } // caching the instance default properties