aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/post_status_form/post_status_form.js8
-rw-r--r--src/components/settings/settings.js12
-rw-r--r--src/components/settings/settings.vue35
-rw-r--r--src/components/status/status.js10
-rw-r--r--src/components/status/status.vue2
5 files changed, 62 insertions, 5 deletions
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 @@
</li>
</ul>
</div>
+
+ <div class="setting-item">
+ <h2>{{$t('settings.composing')}}</h2>
+ <ul class="setting-list">
+ <li>
+ <input type="checkbox" id="scopeCopy" v-model="scopeCopyLocal">
+ <label for="scopeCopy">
+ {{$t('settings.scope_copy')}} {{$t('settings.instance_default', { value: scopeCopyDefault })}}
+ </label>
+ </li>
+ <li>
+ <div>
+ {{$t('settings.subject_line_behavior')}}
+ <label for="subjectLineBehavior" class="select">
+ <select id="subjectLineBehavior" v-model="subjectLineBehaviorLocal">
+ <option value="email">
+ {{$t('settings.subject_line_email')}}
+ {{subjectLineBehaviorDefault == 'email' ? $t('settings.instance_default_simple') : ''}}
+ </option>
+ <option value="masto">
+ {{$t('settings.subject_line_mastodon')}}
+ {{subjectLineBehaviorDefault == 'mastodon' ? $t('settings.instance_default_simple') : ''}}
+ </option>
+ <option value="noop">
+ {{$t('settings.subject_line_noop')}}
+ {{subjectLineBehaviorDefault == 'noop' ? $t('settings.instance_default_simple') : ''}}
+ </option>
+ </select>
+ <i class="icon-down-open"/>
+ </label>
+ </div>
+ </li>
+ </ul>
+ </div>
+
<div class="setting-item">
<h2>{{$t('settings.attachments')}}</h2>
<ul class="setting-list">
diff --git a/src/components/status/status.js b/src/components/status/status.js
index f1afcac7..10716583 100644
--- a/src/components/status/status.js
+++ b/src/components/status/status.js
@@ -181,10 +181,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 @@
</div>
<div class="container" v-if="replying">
<div class="reply-left"/>
- <post-status-form class="reply-body" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" :message-scope="status.visibility" :subject="replySubject" v-on:posted="toggleReplying"/>
+ <post-status-form class="reply-body" :reply-to="status.id" :attentions="status.attentions" :repliedUser="status.user" :copy-message-scope="status.visibility" :subject="replySubject" v-on:posted="toggleReplying"/>
</div>
</template>
</div>