From a57334991e886aff4c98575c4e8576ff3a4966fe Mon Sep 17 00:00:00 2001 From: leap123 Date: Fri, 19 Jan 2024 04:27:26 +0000 Subject: [PATCH 1/3] Add Indonesian translation The Indonesian translation is technically almost complete, just not added to messages.js --- src/i18n/messages.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/i18n/messages.js b/src/i18n/messages.js index 4e92834c..3282fd85 100644 --- a/src/i18n/messages.js +++ b/src/i18n/messages.js @@ -21,6 +21,7 @@ const loaders = { ga: () => import('./ga.json'), he: () => import('./he.json'), hu: () => import('./hu.json'), + id: () => import('./id.json'), it: () => import('./it.json'), ja: () => import('./ja_pedantic.json'), ja_easy: () => import('./ja_easy.json'), From a77a9e04d9579a27cdfb6ebc31b17b906bf8833e Mon Sep 17 00:00:00 2001 From: Oneric Date: Wed, 17 Jan 2024 19:50:47 +0000 Subject: [PATCH 2/3] 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) { From 050c7df2e669620a689ab5ac26d6f9c84889d39c Mon Sep 17 00:00:00 2001 From: Oneric Date: Wed, 14 Feb 2024 17:44:57 +0000 Subject: [PATCH 3/3] Display profile background of other users And add a new frontend setting to hide other people's background. --- src/App.js | 7 ++++++- src/components/settings_modal/tabs/general_tab.vue | 5 +++++ src/components/user_profile/user_profile.js | 7 ++++++- src/i18n/en.json | 1 + src/modules/config.js | 1 + src/modules/users.js | 9 +++++++++ 6 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index d4b3b41a..3e0d0d6f 100644 --- a/src/App.js +++ b/src/App.js @@ -64,6 +64,11 @@ export default { '-' + this.layoutType ] }, + pageBackground () { + return this.mergedConfig.displayPageBackgrounds + ? this.$store.state.users.displayBackground + : null + }, currentUser () { return this.$store.state.users.currentUser }, userBackground () { return this.currentUser.background_image }, instanceBackground () { @@ -71,7 +76,7 @@ export default { ? null : this.$store.state.instance.background }, - background () { return this.userBackground || this.instanceBackground }, + background () { return this.pageBackground || this.userBackground || this.instanceBackground }, bgStyle () { if (this.background) { return { diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index 2754cde0..64950f8a 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -146,6 +146,11 @@ {{ $t('settings.show_wider_shortcuts') }}
  • +
  • + + {{ $t('settings.show_page_backgrounds') }} + +
  • {{ $t('settings.stop_gifs') }} diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 9ea8c2a7..eaadca72 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -145,10 +145,12 @@ const UserProfile = { if (user) { loadById(user.id) this.note = user.relationship.note + this.$store.dispatch('setDisplayBackground', user.background_image) } else { this.$store.dispatch('fetchUser', userNameOrId) - .then(({ id, relationship }) => { + .then(({ id, relationship, background_image }) => { this.note = relationship.note + this.$store.dispatch('setDisplayBackground', background_image) return loadById(id) }) .catch((reason) => { @@ -225,6 +227,9 @@ const UserProfile = { Conversation, RichContent, FollowedTagList + }, + beforeRouteLeave(to, from) { + this.$store.dispatch('setDisplayBackground', null) } } diff --git a/src/i18n/en.json b/src/i18n/en.json index a7fbb12f..7b091cd2 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -750,6 +750,7 @@ "show_nav_shortcuts": "Show extra navigation shortcuts in top panel", "show_panel_nav_shortcuts": "Show timeline navigation shortcuts at the top of the panel", "show_scrollbars": "Show side column's scrollbars", + "show_page_backgrounds": "Show page-specific backgrounds, e.g. for user profiles", "show_wider_shortcuts": "Show wider gap between top panel shortcuts", "show_yous": "Show (You)s", "stop_gifs": "Pause animated images until you hover on them", diff --git a/src/modules/config.js b/src/modules/config.js index 91a966bd..551b5bb6 100644 --- a/src/modules/config.js +++ b/src/modules/config.js @@ -55,6 +55,7 @@ export const defaultState = { alwaysShowNewPostButton: false, autohideFloatingPostButton: false, pauseOnUnfocused: true, + displayPageBackgrounds: true, stopGifs: undefined, replyVisibility: 'all', thirdColumnMode: 'notifications', diff --git a/src/modules/users.js b/src/modules/users.js index 6968ce1e..b8baf9a4 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -135,6 +135,10 @@ export const mutations = { const user = state.usersObject[id] user['deactivated'] = deactivated }, + setDisplayBackground(state, url) { + console.log("Commiting user profile bg mutation") + state.displayBackground = url + }, setCurrentUser (state, user) { state.lastLoginName = user.screen_name state.currentUser = mergeWith(state.currentUser || {}, user, mergeArrayLength) @@ -307,6 +311,7 @@ export const defaultState = { currentUser: false, users: [], usersObject: {}, + displayBackground: null, signUpPending: false, signUpErrors: [], relationships: {}, @@ -319,6 +324,10 @@ const users = { mutations, getters, actions: { + setDisplayBackground (store, url) { + console.log("Performing user profile bg action...") + store.commit('setDisplayBackground', url) + }, fetchUserIfMissing (store, id) { if (!store.getters.findUser(id)) { store.dispatch('fetchUser', id)