From a77a9e04d9579a27cdfb6ebc31b17b906bf8833e Mon Sep 17 00:00:00 2001 From: Oneric Date: Wed, 17 Jan 2024 19:50:47 +0000 Subject: [PATCH] Expose new server-side permit_followback setting Added to backend in https://akkoma.dev/AkkomaGang/akkoma/pulls/674 --- src/components/settings_modal/tabs/profile_tab.js | 2 ++ src/components/settings_modal/tabs/profile_tab.vue | 13 +++++++++++++ src/i18n/en.json | 1 + src/modules/serverSideConfig.js | 4 ++++ .../entity_normalizer/entity_normalizer.service.js | 1 + 5 files changed, 21 insertions(+) diff --git a/src/components/settings_modal/tabs/profile_tab.js b/src/components/settings_modal/tabs/profile_tab.js index 46cb91e5..a5794630 100644 --- a/src/components/settings_modal/tabs/profile_tab.js +++ b/src/components/settings_modal/tabs/profile_tab.js @@ -33,6 +33,7 @@ const ProfileTab = { newName: this.$store.state.users.currentUser.name_unescaped, newBio: unescape(this.$store.state.users.currentUser.description), newLocked: this.$store.state.users.currentUser.locked, + newPermitFollowback: this.$store.state.users.currentUser.permit_followback, newFields: this.$store.state.users.currentUser.fields.map(field => ({ name: field.name, value: field.value })), showRole: this.$store.state.users.currentUser.show_role, role: this.$store.state.users.currentUser.role, @@ -135,6 +136,7 @@ const ProfileTab = { bot: this.bot, show_role: this.showRole, status_ttl_days: this.expirePosts ? this.newPostTTLDays : -1, + permit_followback: this.permit_followback, accepts_direct_messages_from: this.userAcceptsDirectMessagesFrom /* eslint-enable camelcase */ } diff --git a/src/components/settings_modal/tabs/profile_tab.vue b/src/components/settings_modal/tabs/profile_tab.vue index 9f80582f..f3cabd37 100644 --- a/src/components/settings_modal/tabs/profile_tab.vue +++ b/src/components/settings_modal/tabs/profile_tab.vue @@ -259,6 +259,19 @@ {{ $t('settings.lock_account_description') }} +
  • diff --git a/src/i18n/en.json b/src/i18n/en.json index a7fbb12f..aaac5f8e 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -601,6 +601,7 @@ "list_aliases_error": "Error fetching aliases: {error}", "list_backups_error": "Error fetching backup list: {error}", "lock_account_description": "Restrict your account to approved followers only", + "permit_followback_description": "Automatically approve requests from already followed users", "loop_video": "Loop videos", "loop_video_silent_only": "Loop only videos without sound (i.e. Mastodon's \"gifs\")", "mascot": "Mastodon FE Mascot", diff --git a/src/modules/serverSideConfig.js b/src/modules/serverSideConfig.js index e7a6c95c..0764073d 100644 --- a/src/modules/serverSideConfig.js +++ b/src/modules/serverSideConfig.js @@ -47,6 +47,10 @@ export const settingsMap = { }, // Privacy 'locked': 'locked', + 'permitFollowback': { + get: 'akkoma.permit_followback', + set: 'permit_followback' + }, 'allowFollowingMove': { get: 'pleroma.allow_following_move', set: 'allow_following_move' diff --git a/src/services/entity_normalizer/entity_normalizer.service.js b/src/services/entity_normalizer/entity_normalizer.service.js index 4fddd875..b7f382d8 100644 --- a/src/services/entity_normalizer/entity_normalizer.service.js +++ b/src/services/entity_normalizer/entity_normalizer.service.js @@ -95,6 +95,7 @@ export const parseUser = (data) => { if (data.akkoma) { output.instance = data.akkoma.instance output.status_ttl_days = data.akkoma.status_ttl_days + output.permit_followback = data.akkoma.permit_followback } if (data.pleroma) {