From 2451956d838d132a14a3089546ceac59c07e1b3a Mon Sep 17 00:00:00 2001
From: Sergey Suprunenko <suprunenko.s@gmail.com>
Date: Sun, 21 Jun 2020 14:59:05 +0200
Subject: [PATCH 1/3] Add 'bot' flag to Profile settings

---
 src/components/settings_modal/tabs/profile_tab.js  | 2 ++
 src/components/settings_modal/tabs/profile_tab.vue | 5 +++++
 src/i18n/en.json                                   | 1 +
 src/i18n/ru.json                                   | 1 +
 4 files changed, 9 insertions(+)

diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js
index 8658b097..56e956cd 100644
--- a/src/components/settings_modal/tabs/profile_tab.js
+++ b/src/components/settings_modal/tabs/profile_tab.js
@@ -23,6 +23,7 @@ const ProfileTab = {
       showRole: this.$store.state.users.currentUser.show_role,
       role: this.$store.state.users.currentUser.role,
       discoverable: this.$store.state.users.currentUser.discoverable,
+      bot: this.$store.state.users.currentUser.bot,
       allowFollowingMove: this.$store.state.users.currentUser.allow_following_move,
       pickAvatarBtnVisible: true,
       bannerUploading: false,
@@ -79,6 +80,7 @@ const ProfileTab = {
             hide_follows: this.hideFollows,
             hide_followers: this.hideFollowers,
             discoverable: this.discoverable,
+            bot: this.bot,
             allow_following_move: this.allowFollowingMove,
             hide_follows_count: this.hideFollowsCount,
             hide_followers_count: this.hideFollowersCount,
diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue
index fff4f970..decdb389 100644
--- a/src/components/settings_modal/tabs/profile_tab.vue
+++ b/src/components/settings_modal/tabs/profile_tab.vue
@@ -95,6 +95,11 @@
           {{ $t('settings.discoverable') }}
         </Checkbox>
       </p>
+      <p>
+        <Checkbox v-model="bot">
+          {{ $t('settings.bot') }}
+        </Checkbox>
+      </p>
       <button
         :disabled="newName && newName.length === 0"
         class="btn btn-default"
diff --git a/src/i18n/en.json b/src/i18n/en.json
index eefe10e5..4553d25d 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -266,6 +266,7 @@
     "block_import_error": "Error importing blocks",
     "blocks_imported": "Blocks imported! Processing them will take a while.",
     "blocks_tab": "Blocks",
+    "bot": "This is a bot account",
     "btnRadius": "Buttons",
     "cBlue": "Blue (Reply, follow)",
     "cGreen": "Green (Retweet)",
diff --git a/src/i18n/ru.json b/src/i18n/ru.json
index f9a72954..aa78db26 100644
--- a/src/i18n/ru.json
+++ b/src/i18n/ru.json
@@ -130,6 +130,7 @@
     "background": "Фон",
     "bio": "Описание",
     "btnRadius": "Кнопки",
+    "bot": "Это аккаунт бота",
     "cBlue": "Ответить, читать",
     "cGreen": "Повторить",
     "cOrange": "Нравится",

From c04f8b2ccb29e02595e4abd7a75ed42feee5f640 Mon Sep 17 00:00:00 2001
From: Sergey Suprunenko <suprunenko.s@gmail.com>
Date: Sun, 21 Jun 2020 15:02:44 +0200
Subject: [PATCH 2/3] Show a 'bot' badge on the service account page

---
 CHANGELOG.md                           |  1 +
 src/components/user_card/user_card.vue | 18 ++++++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3b41a04d..feabbf06 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -17,6 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
 - Added private notifications option for push notifications
 - 'Copy link' button for statuses (in the ellipsis menu)
 - Autocomplete domains from list of known instances
+- 'Bot' settings option and badge
 
 ### Changed
 - Registration page no longer requires email if the server is configured not to require it
diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index c4a5ce9d..243a46f1 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -70,10 +70,20 @@
               >
                 @{{ user.screen_name }}
               </router-link>
-              <span
-                v-if="!hideBio && !!visibleRole"
-                class="alert staff"
-              >{{ visibleRole }}</span>
+              <template v-if="!hideBio">
+                <span
+                  v-if="!!visibleRole"
+                  class="alert staff"
+                >
+                  {{ visibleRole }}
+                </span>
+                <span
+                  v-if="user.bot"
+                  class="alert staff"
+                >
+                  bot
+                </span>
+              </template>
               <span v-if="user.locked"><i class="icon icon-lock" /></span>
               <span
                 v-if="!mergedConfig.hideUserStats && !hideBio"

From 2b6d16900b9f0bd515dbb616ef0f031f6c026dcc Mon Sep 17 00:00:00 2001
From: Sergey Suprunenko <suprunenko.s@gmail.com>
Date: Sun, 21 Jun 2020 15:36:20 +0200
Subject: [PATCH 3/3] Use more correct class name for user badges

---
 src/components/user_card/user_card.vue | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue
index 243a46f1..9529d7f6 100644
--- a/src/components/user_card/user_card.vue
+++ b/src/components/user_card/user_card.vue
@@ -73,13 +73,13 @@
               <template v-if="!hideBio">
                 <span
                   v-if="!!visibleRole"
-                  class="alert staff"
+                  class="alert user-role"
                 >
                   {{ visibleRole }}
                 </span>
                 <span
                   v-if="user.bot"
-                  class="alert staff"
+                  class="alert user-role"
                 >
                   bot
                 </span>
@@ -468,7 +468,7 @@
       color: var(--text, $fallback--text);
     }
 
-    .staff {
+    .user-role {
       flex: none;
       text-transform: capitalize;
       color: $fallback--text;