From 455cd0d0289c7633aca22ad6e8737d449e361fce Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 25 Sep 2018 14:47:02 +0300 Subject: settings for scope/subject --- src/components/settings/settings.js | 12 ++++++++++++ src/components/settings/settings.vue | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) (limited to 'src/components') diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js index a24bc265..a7c2c565 100644 --- a/src/components/settings/settings.js +++ b/src/components/settings/settings.js @@ -26,6 +26,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 @@ -99,6 +105,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 42c660a3..f9e7d711 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -53,6 +53,41 @@ + +
+

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

+ +
+

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

    -- cgit v1.2.3-70-g09d2 From ef968d8e1e4f3194a0856fd93bc03d8030112b12 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 25 Sep 2018 15:16:26 +0300 Subject: now it actually works --- src/components/post_status_form/post_status_form.js | 10 ++++++++-- src/components/settings/settings.vue | 6 +++--- src/components/status/status.js | 10 ++++++++-- src/components/status/status.vue | 2 +- src/modules/instance.js | 2 +- 5 files changed, 21 insertions(+), 9 deletions(-) (limited to 'src/components') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index a84e764c..804c4bc2 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,12 @@ const PostStatusForm = { statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser) } + console.log(this.copyMessageScope) + const scope = (this.copyMessageScope && this.$store.state.config.copyScope || this.copyMessageScope === 'direct') + ? this.copyMessageScope + : this.$store.state.users.currentUser.default_scope + + console.log(this) return { dropFiles: [], submitDisabled: false, @@ -58,7 +64,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.vue b/src/components/settings/settings.vue index f9e7d711..5a5b2fb4 100644 --- a/src/components/settings/settings.vue +++ b/src/components/settings/settings.vue @@ -70,15 +70,15 @@ diff --git a/src/components/status/status.js b/src/components/status/status.js index 45f5ccac..38cfc5ae 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -174,10 +174,16 @@ const Status = { return true }, replySubject () { - if (this.status.summary && !this.status.summary.match(/^re[: ]/i)) { + if (!this.status.summary) return ''; + const behavior = this.$store.state.config.subjectLineBehavior + const startsWithRe = this.status.summary.match(/^re[: ]/i) + if (behavior !== 'noop' && startsWithRe || behavior === 'masto') { + return this.status.summary + } else if (behavior === 'email') { return 're: '.concat(this.status.summary) + } else if (behavior === 'noop') { + return '' } - return this.status.summary }, attachmentSize () { if ((this.$store.state.config.hideAttachments && !this.inConversation) || diff --git a/src/components/status/status.vue b/src/components/status/status.vue index eb521280..8087d392 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -106,7 +106,7 @@
- +
diff --git a/src/modules/instance.js b/src/modules/instance.js index 0e67e4d1..58913060 100644 --- a/src/modules/instance.js +++ b/src/modules/instance.js @@ -19,7 +19,7 @@ const defaultState = { formattingOptionsEnabled: false, collapseMessageWithSubject: false, disableChat: false, - scopeCopy: false, + scopeCopy: true, subjectLineBehavior: 'email', // Nasty stuff -- cgit v1.2.3-70-g09d2 From d5e82625d3e14ed22224de871e732f8b6db9df59 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 25 Sep 2018 15:21:47 +0300 Subject: lint fix --- src/components/status/status.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components') diff --git a/src/components/status/status.js b/src/components/status/status.js index 38cfc5ae..9c224ce3 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -174,7 +174,7 @@ const Status = { return true }, replySubject () { - if (!this.status.summary) return ''; + if (!this.status.summary) return '' const behavior = this.$store.state.config.subjectLineBehavior const startsWithRe = this.status.summary.match(/^re[: ]/i) if (behavior !== 'noop' && startsWithRe || behavior === 'masto') { -- cgit v1.2.3-70-g09d2 From b948234aec2ec1d140a46303c09d24424262bd66 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 26 Nov 2018 04:44:54 +0300 Subject: whoops --- src/components/post_status_form/post_status_form.js | 2 -- src/main.js | 2 -- 2 files changed, 4 deletions(-) (limited to 'src/components') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index e49c3ccc..fa86ee59 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -46,12 +46,10 @@ const PostStatusForm = { statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser) } - console.log(this.copyMessageScope) const scope = (this.copyMessageScope && this.$store.state.config.copyScope || this.copyMessageScope === 'direct') ? this.copyMessageScope : this.$store.state.users.currentUser.default_scope - console.log(this) return { dropFiles: [], submitDisabled: false, diff --git a/src/main.js b/src/main.js index 5f459d46..9f094ada 100644 --- a/src/main.js +++ b/src/main.js @@ -43,7 +43,6 @@ const i18n = new VueI18n({ messages }) -======= const persistedStateOptions = { paths: [ 'config', @@ -67,7 +66,6 @@ createPersistedState(persistedStateOptions).then((persistedState) => { plugins: [persistedState], strict: false // Socket modifies itself, let's ignore this for now. // strict: process.env.NODE_ENV !== 'production' ->>>>>>> upstream/develop }) afterStoreSetup({store, i18n}) -- cgit v1.2.3-70-g09d2