diff --git a/src/boot/after_store.js b/src/boot/after_store.js index 90c558f6..ea5d4ecd 100644 --- a/src/boot/after_store.js +++ b/src/boot/after_store.js @@ -56,6 +56,8 @@ const afterStoreSetup = ({store, i18n}) => { var formattingOptionsEnabled = (config.formattingOptionsEnabled) var collapseMessageWithSubject = (config.collapseMessageWithSubject) var loginMethod = (config.loginMethod) + var scopeCopy = (config.scopeCopy) + var subjectLineBehavior = (config.subjectLineBehavior) store.dispatch('setInstanceOption', { name: 'theme', value: theme }) store.dispatch('setInstanceOption', { name: 'background', value: background }) @@ -71,6 +73,8 @@ const afterStoreSetup = ({store, i18n}) => { store.dispatch('setInstanceOption', { name: 'formattingOptionsEnabled', value: formattingOptionsEnabled }) store.dispatch('setInstanceOption', { name: 'collapseMessageWithSubject', value: collapseMessageWithSubject }) store.dispatch('setInstanceOption', { name: 'loginMethod', value: loginMethod }) + store.dispatch('setInstanceOption', { name: 'scopeCopy', value: scopeCopy }) + store.dispatch('setInstanceOption', { name: 'subjectLineBehavior', value: subjectLineBehavior }) if (chatDisabled) { store.dispatch('disableChat') } diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index c0e34d72..fa86ee59 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -24,7 +24,7 @@ const PostStatusForm = { 'replyTo', 'repliedUser', 'attentions', - 'messageScope', + 'copyMessageScope', 'subject' ], components: { @@ -46,6 +46,10 @@ const PostStatusForm = { statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser) } + const scope = (this.copyMessageScope && this.$store.state.config.copyScope || this.copyMessageScope === 'direct') + ? this.copyMessageScope + : this.$store.state.users.currentUser.default_scope + return { dropFiles: [], submitDisabled: false, @@ -58,7 +62,7 @@ const PostStatusForm = { contentType: 'text/plain', nsfw: false, files: [], - visibility: this.messageScope || this.$store.state.users.currentUser.default_scope + visibility: scope }, caret: 0 } diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index 67110841..910eea63 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -34,6 +34,12 @@ const settings = { ? instance.collapseMessageWithSubject : user.collapseMessageWithSubject, collapseMessageWithSubjectDefault: this.$t('settings.values.' + instance.collapseMessageWithSubject), + subjectLineBehaviorLocal: typeof user.subjectLineBehavior === 'undefined' + ? instance.subjectLineBehavior + : user.subjectLineBehavior, + subjectLineBehaviorDefault: instance.subjectLineBehavior, + scopeCopyLocal: user.scopeCopy, + scopeCopyDefault: this.$t('settings.values.' + instance.scopeCopy), stopGifs: user.stopGifs, loopSilentAvailable: // Firefox @@ -113,6 +119,12 @@ const settings = { collapseMessageWithSubjectLocal (value) { this.$store.dispatch('setOption', { name: 'collapseMessageWithSubject', value }) }, + scopeCopyLocal (value) { + this.$store.dispatch('setOption', { name: 'scopeCopy', value }) + }, + subjectLineBehaviorLocal (value) { + this.$store.dispatch('setOption', { name: 'subjectLineBehavior', value }) + }, stopGifs (value) { this.$store.dispatch('setOption', { name: 'stopGifs', value }) } diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue index 652bdcc1..4a236d23 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -53,6 +53,41 @@ + +
+

{{$t('settings.composing')}}

+ +
+

{{$t('settings.attachments')}}

- +
diff --git a/src/i18n/en.json b/src/i18n/en.json index 4201ba22..314fa083 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -91,6 +91,7 @@ "change_password_error": "There was an issue changing your password.", "changed_password": "Password changed successfully!", "collapse_subject": "Collapse posts with subjects", + "composing": "Composing", "confirm_new_password": "Confirm new password", "current_avatar": "Your current avatar", "current_password": "Current password", @@ -120,6 +121,7 @@ "import_theme": "Load preset", "inputRadius": "Input fields", "instance_default": "(default: {value})", + "instance_default_simple" : "(default)", "interfaceLanguage": "Interface language", "invalid_theme_imported": "The selected file is not a supported Pleroma theme. No changes to your theme were made.", "limited_availability": "Unavailable in your browser", @@ -152,10 +154,15 @@ "saving_err": "Error saving settings", "saving_ok": "Settings saved", "security_tab": "Security", + "scope_copy": "Copy scope when replying (DMs are always copied)", "set_new_avatar": "Set new avatar", "set_new_profile_background": "Set new profile background", "set_new_profile_banner": "Set new profile banner", "settings": "Settings", + "subject_line_behavior": "Copy subject when replying", + "subject_line_email": "Like email: \"re: subject\"", + "subject_line_mastodon": "Like mastodon: copy as is", + "subject_line_noop": "Do not copy", "stop_gifs": "Play-on-hover GIFs", "streaming": "Enable automatic streaming of new posts when scrolled to the top", "text": "Text", diff --git a/src/i18n/fr.json b/src/i18n/fr.json index b5ad5e49..129b7d7c 100644 --- a/src/i18n/fr.json +++ b/src/i18n/fr.json @@ -119,6 +119,7 @@ "import_theme": "Charger le thème", "inputRadius": "Champs de texte", "instance_default": "(default: {value})", + "instance_default_simple" : "(default)", "interfaceLanguage": "Langue de l'interface", "invalid_theme_imported": "Le fichier sélectionné n'est pas un thème Pleroma pris en charge. Aucun changement n'a été apporté à votre thème.", "limited_availability": "Non disponible dans votre navigateur", diff --git a/src/modules/config.js b/src/modules/config.js index 522940f6..0d36e9bf 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -5,7 +5,7 @@ const browserLocale = (window.navigator.language || 'en').split('-')[0] const defaultState = { colors: {}, - collapseMessageWithSubject: undefined, + collapseMessageWithSubject: undefined, // instance default hideAttachments: false, hideAttachmentsInConv: false, hideNsfw: true, @@ -25,7 +25,9 @@ const defaultState = { }, muteWords: [], highlight: {}, - interfaceLanguage: browserLocale + interfaceLanguage: browserLocale, + scopeCopy: undefined, // instance default + subjectLineBehavior: undefined // instance default } const config = { diff --git a/src/modules/instance.js b/src/modules/instance.js index 8b2c03d2..9a39cccf 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -21,6 +21,8 @@ const defaultState = { hidePostStats: false, hideUserStats: false, disableChat: false, + scopeCopy: true, + subjectLineBehavior: 'email', loginMethod: 'password', // Nasty stuff diff --git a/static/config.json b/static/config.json index 69a70741..67d84579 100644 --- a/static/config.json +++ b/static/config.json @@ -11,6 +11,8 @@ "scopeOptionsEnabled": false, "formattingOptionsEnabled": false, "collapseMessageWithSubject": false, + "scopeCopy": false, + "subjectLineBehavior": "email", "hidePostStats": false, "hideUserStats": false, "loginMethod": "password"