From dcb7e1ecf479a72c904dd882c05f1c446dbe2fe4 Mon Sep 17 00:00:00 2001
From: scarlett <nia@netbsd.org>
Date: Tue, 4 Sep 2018 00:32:25 +0100
Subject: Add option for disabling counts (followers, statuses) in user
 profiles.

---
 src/components/settings/settings.vue | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'src/components/settings/settings.vue')

diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index c106b79c..2cf62200 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -122,6 +122,10 @@
               <i class="icon-down-open"/>
             </label>
           </div>
+          <div>
+            <input type="checkbox" id="hideUserStats" v-model="hideUserStatsLocal">
+            <label for="hideUserStats">{{$t('settings.hide_user_stats')}}</label>
+          </div>
         </div>
         <div class="setting-item">
           <p>{{$t('settings.filtering_explanation')}}</p>
-- 
cgit v1.2.3-70-g09d2


From bdcbd110e42a5deb46116f3ba631118143f71a69 Mon Sep 17 00:00:00 2001
From: scarlett <nia@netbsd.org>
Date: Tue, 4 Sep 2018 00:41:37 +0100
Subject: Add option for hiding post statistics (e.g. repeats, favs)

---
 src/components/favorite_button/favorite_button.js  | 1 +
 src/components/favorite_button/favorite_button.vue | 4 ++--
 src/components/retweet_button/retweet_button.js    | 1 +
 src/components/retweet_button/retweet_button.vue   | 4 ++--
 src/components/settings/settings.js                | 4 ++++
 src/components/settings/settings.vue               | 4 ++++
 src/i18n/messages.js                               | 1 +
 src/main.js                                        | 1 +
 src/modules/config.js                              | 1 +
 9 files changed, 17 insertions(+), 4 deletions(-)

(limited to 'src/components/settings/settings.vue')

diff --git a/src/components/favorite_button/favorite_button.js b/src/components/favorite_button/favorite_button.js
index 1266be90..80893719 100644
--- a/src/components/favorite_button/favorite_button.js
+++ b/src/components/favorite_button/favorite_button.js
@@ -2,6 +2,7 @@ const FavoriteButton = {
   props: ['status', 'loggedIn'],
   data () {
     return {
+      hidePostStatsLocal: this.$store.state.config.hidePostStats,
       animated: false
     }
   },
diff --git a/src/components/favorite_button/favorite_button.vue b/src/components/favorite_button/favorite_button.vue
index 1e1a6970..71cb875e 100644
--- a/src/components/favorite_button/favorite_button.vue
+++ b/src/components/favorite_button/favorite_button.vue
@@ -1,11 +1,11 @@
 <template>
   <div v-if="loggedIn">
     <i :class='classes' class='favorite-button fav-active' @click.prevent='favorite()'/>
-    <span v-if='status.fave_num > 0'>{{status.fave_num}}</span>
+    <span v-if='!hidePostStatsLocal && status.fave_num > 0'>{{status.fave_num}}</span>
   </div>
   <div v-else>
     <i :class='classes' class='favorite-button'/>
-    <span v-if='status.fave_num > 0'>{{status.fave_num}}</span>
+    <span v-if='!hidePostStatsLocal && status.fave_num > 0'>{{status.fave_num}}</span>
   </div>
 </template>
 
diff --git a/src/components/retweet_button/retweet_button.js b/src/components/retweet_button/retweet_button.js
index cafa9cbc..ef2f271a 100644
--- a/src/components/retweet_button/retweet_button.js
+++ b/src/components/retweet_button/retweet_button.js
@@ -2,6 +2,7 @@ const RetweetButton = {
   props: ['status', 'loggedIn', 'visibility'],
   data () {
     return {
+      hidePostStatsLocal: this.$store.state.config.hidePostStats,
       animated: false
     }
   },
diff --git a/src/components/retweet_button/retweet_button.vue b/src/components/retweet_button/retweet_button.vue
index ee5722bd..5b1e64b8 100644
--- a/src/components/retweet_button/retweet_button.vue
+++ b/src/components/retweet_button/retweet_button.vue
@@ -2,7 +2,7 @@
   <div v-if="loggedIn">
     <template v-if="visibility !== 'private' && visibility !== 'direct'">
       <i :class='classes' class='icon-retweet rt-active' v-on:click.prevent='retweet()'></i>
-      <span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span>
+      <span v-if='!hidePostStatsLocal && status.repeat_num > 0'>{{status.repeat_num}}</span>
     </template>
     <template v-else>
       <i :class='classes' class='icon-lock' :title="$t('timeline.no_retweet_hint')"></i>
@@ -10,7 +10,7 @@
   </div>
   <div v-else-if="!loggedIn">
     <i :class='classes' class='icon-retweet'></i>
-    <span v-if='status.repeat_num > 0'>{{status.repeat_num}}</span>
+    <span v-if='!hidePostStatsLocal && status.repeat_num > 0'>{{status.repeat_num}}</span>
   </div>
 </template>
 
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js
index 088e19d3..1dd53ab2 100644
--- a/src/components/settings/settings.js
+++ b/src/components/settings/settings.js
@@ -10,6 +10,7 @@ const settings = {
       hideAttachmentsLocal: this.$store.state.config.hideAttachments,
       hideAttachmentsInConvLocal: this.$store.state.config.hideAttachmentsInConv,
       hideNsfwLocal: this.$store.state.config.hideNsfw,
+      hidePostStatsLocal: this.$store.state.config.hidePostStats,
       hideUserStatsLocal: this.$store.state.config.hideUserStats,
       notificationVisibilityLocal: this.$store.state.config.notificationVisibility,
       replyVisibilityLocal: this.$store.state.config.replyVisibility,
@@ -48,6 +49,9 @@ const settings = {
     hideAttachmentsInConvLocal (value) {
       this.$store.dispatch('setOption', { name: 'hideAttachmentsInConv', value })
     },
+    hidePostStatsLocal (value) {
+      this.$store.dispatch('setOption', { name: 'hidePostStats', value })
+    },
     hideUserStatsLocal (value) {
       this.$store.dispatch('setOption', { name: 'hideUserStats', value })
     },
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index 2cf62200..18e8e244 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -122,6 +122,10 @@
               <i class="icon-down-open"/>
             </label>
           </div>
+          <div>
+            <input type="checkbox" id="hidePostStats" v-model="hidePostStatsLocal">
+            <label for="hidePostStats">{{$t('settings.hide_post_stats')}}</label>
+          </div>
           <div>
             <input type="checkbox" id="hideUserStats" v-model="hideUserStatsLocal">
             <label for="hideUserStats">{{$t('settings.hide_user_stats')}}</label>
diff --git a/src/i18n/messages.js b/src/i18n/messages.js
index 42b1dd40..56cc7b49 100644
--- a/src/i18n/messages.js
+++ b/src/i18n/messages.js
@@ -328,6 +328,7 @@ const en = {
     loop_video_silent_only: 'Loop only videos without sound (i.e. Mastodon\'s "gifs")',
     reply_link_preview: 'Enable reply-link preview on mouse hover',
     replies_in_timeline: 'Replies in timeline',
+    hide_post_stats: 'Hide post statistics (e.g. repeat and favorite counts)',
     hide_user_stats: 'Hide user statistics (e.g. status and follower counts)',
     reply_visibility_all: 'Show all replies',
     reply_visibility_following: 'Only show replies directed at me or users I\'m following',
diff --git a/src/main.js b/src/main.js
index d05ecba8..132029dc 100644
--- a/src/main.js
+++ b/src/main.js
@@ -48,6 +48,7 @@ const persistedStateOptions = {
     'config.collapseMessageWithSubject',
     'config.hideAttachments',
     'config.hideAttachmentsInConv',
+    'config.hidePostStats',
     'config.hideUserStats',
     'config.hideNsfw',
     'config.replyVisibility',
diff --git a/src/modules/config.js b/src/modules/config.js
index 24665e95..dae58eb1 100644
--- a/src/modules/config.js
+++ b/src/modules/config.js
@@ -9,6 +9,7 @@ const defaultState = {
   collapseMessageWithSubject: false,
   hideAttachments: false,
   hideAttachmentsInConv: false,
+  hidePostStats: false,
   hideUserStats: false,
   hideNsfw: true,
   loopVideo: true,
-- 
cgit v1.2.3-70-g09d2


From 455cd0d0289c7633aca22ad6e8737d449e361fce Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
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 +++++++++++++++++++++++++++++++++++
 src/i18n/en.json                     |  7 +++++++
 src/i18n/fr.json                     |  1 +
 src/modules/config.js                |  6 ++++--
 src/modules/instance.js              |  2 ++
 static/config.json                   |  4 +++-
 7 files changed, 64 insertions(+), 3 deletions(-)

(limited to 'src/components/settings/settings.vue')

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 @@
             </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')}}
+                      {{subjectLineBehaviorLocal == 'email' ? $t('settings.instance_default_simple') : ''}}
+                    </option>
+                    <option value="masto">
+                      {{$t('settings.subject_line_mastodon')}}
+                      {{subjectLineBehaviorLocal == 'mastodon' ? $t('settings.instance_default_simple') : ''}}
+                    </option>
+                    <option value="noop">
+                      {{$t('settings.subject_line_noop')}}
+                      {{subjectLineBehaviorLocal == '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/i18n/en.json b/src/i18n/en.json
index 2dc6493e..cd87240b 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -88,6 +88,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",
@@ -115,6 +116,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",
@@ -147,10 +149,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 cf45d9af..b76db32a 100644
--- a/src/i18n/fr.json
+++ b/src/i18n/fr.json
@@ -115,6 +115,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 375d0167..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: false,
+  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 cb724821..0e67e4d1 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -19,6 +19,8 @@ const defaultState = {
   formattingOptionsEnabled: false,
   collapseMessageWithSubject: false,
   disableChat: false,
+  scopeCopy: false,
+  subjectLineBehavior: 'email',
 
   // Nasty stuff
   pleromaBackend: true,
diff --git a/static/config.json b/static/config.json
index 144fe951..988d1cf4 100644
--- a/static/config.json
+++ b/static/config.json
@@ -10,5 +10,7 @@
   "showInstanceSpecificPanel": false,
   "scopeOptionsEnabled": false,
   "formattingOptionsEnabled": false,
-  "collapseMessageWithSubject": false
+  "collapseMessageWithSubject": false,
+  "scopeCopy": false,
+  "subjectLineBehavior": "email"
 }
-- 
cgit v1.2.3-70-g09d2


From ef968d8e1e4f3194a0856fd93bc03d8030112b12 Mon Sep 17 00:00:00 2001
From: Henry Jameson <me@hjkos.com>
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/settings/settings.vue')

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 @@
                   <select id="subjectLineBehavior" v-model="subjectLineBehaviorLocal">
                     <option value="email">
                       {{$t('settings.subject_line_email')}}
-                      {{subjectLineBehaviorLocal == 'email' ? $t('settings.instance_default_simple') : ''}}
+                      {{subjectLineBehaviorDefault == 'email' ? $t('settings.instance_default_simple') : ''}}
                     </option>
                     <option value="masto">
                       {{$t('settings.subject_line_mastodon')}}
-                      {{subjectLineBehaviorLocal == 'mastodon' ? $t('settings.instance_default_simple') : ''}}
+                      {{subjectLineBehaviorDefault == 'mastodon' ? $t('settings.instance_default_simple') : ''}}
                     </option>
                     <option value="noop">
                       {{$t('settings.subject_line_noop')}}
-                      {{subjectLineBehaviorLocal == 'noop' ? $t('settings.instance_default_simple') : ''}}
+                      {{subjectLineBehaviorDefault == 'noop' ? $t('settings.instance_default_simple') : ''}}
                     </option>
                   </select>
                   <i class="icon-down-open"/>
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 @@
       </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>
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

