Merge remote-tracking branch 'upstream/develop' into bnakkoma

This commit is contained in:
itepechi 2024-03-04 07:13:14 +09:00
commit 60d0c91eb9
Signed by: itepechi
GPG Key ID: D948CE1B5ACD0B25
11 changed files with 50 additions and 2 deletions

View File

@ -64,6 +64,11 @@ export default {
'-' + this.layoutType '-' + this.layoutType
] ]
}, },
pageBackground () {
return this.mergedConfig.displayPageBackgrounds
? this.$store.state.users.displayBackground
: null
},
currentUser () { return this.$store.state.users.currentUser }, currentUser () { return this.$store.state.users.currentUser },
userBackground () { return this.currentUser.background_image }, userBackground () { return this.currentUser.background_image },
instanceBackground () { instanceBackground () {
@ -71,7 +76,7 @@ export default {
? null ? null
: this.$store.state.instance.background : this.$store.state.instance.background
}, },
background () { return this.userBackground || this.instanceBackground }, background () { return this.pageBackground || this.userBackground || this.instanceBackground },
bgStyle () { bgStyle () {
if (this.background) { if (this.background) {
return { return {

View File

@ -154,6 +154,11 @@
{{ $t('settings.show_wider_shortcuts') }} {{ $t('settings.show_wider_shortcuts') }}
</BooleanSetting> </BooleanSetting>
</li> </li>
<li>
<BooleanSetting path="displayPageBackgrounds">
{{ $t('settings.show_page_backgrounds') }}
</BooleanSetting>
</li>
<li> <li>
<BooleanSetting path="stopGifs"> <BooleanSetting path="stopGifs">
{{ $t('settings.stop_gifs') }} {{ $t('settings.stop_gifs') }}

View File

@ -33,6 +33,7 @@ const ProfileTab = {
newName: this.$store.state.users.currentUser.name_unescaped, newName: this.$store.state.users.currentUser.name_unescaped,
newBio: unescape(this.$store.state.users.currentUser.description), newBio: unescape(this.$store.state.users.currentUser.description),
newLocked: this.$store.state.users.currentUser.locked, 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 })), newFields: this.$store.state.users.currentUser.fields.map(field => ({ name: field.name, value: field.value })),
showRole: this.$store.state.users.currentUser.show_role, showRole: this.$store.state.users.currentUser.show_role,
role: this.$store.state.users.currentUser.role, role: this.$store.state.users.currentUser.role,
@ -135,6 +136,7 @@ const ProfileTab = {
bot: this.bot, bot: this.bot,
show_role: this.showRole, show_role: this.showRole,
status_ttl_days: this.expirePosts ? this.newPostTTLDays : -1, status_ttl_days: this.expirePosts ? this.newPostTTLDays : -1,
permit_followback: this.permit_followback,
accepts_direct_messages_from: this.userAcceptsDirectMessagesFrom accepts_direct_messages_from: this.userAcceptsDirectMessagesFrom
/* eslint-enable camelcase */ /* eslint-enable camelcase */
} }

View File

@ -257,6 +257,19 @@
<BooleanSetting path="serverSide_locked"> <BooleanSetting path="serverSide_locked">
{{ $t('settings.lock_account_description') }} {{ $t('settings.lock_account_description') }}
</BooleanSetting> </BooleanSetting>
<ul
class="setting-list suboptions"
:class="[{disabled: !serverSide_locked}]"
>
<li>
<BooleanSetting
path="serverSide_permitFollowback"
:disabled="!serverSide_locked"
>
{{ $t('settings.permit_followback_description') }}
</BooleanSetting>
</li>
</ul>
</li> </li>
<li> <li>
<BooleanSetting path="serverSide_discoverable"> <BooleanSetting path="serverSide_discoverable">

View File

@ -146,10 +146,12 @@ const UserProfile = {
if (user) { if (user) {
loadById(user.id) loadById(user.id)
this.note = user.relationship.note this.note = user.relationship.note
this.$store.dispatch('setDisplayBackground', user.background_image)
} else { } else {
this.$store.dispatch('fetchUser', userNameOrId) this.$store.dispatch('fetchUser', userNameOrId)
.then(({ id, relationship }) => { .then(({ id, relationship, background_image }) => {
this.note = relationship.note this.note = relationship.note
this.$store.dispatch('setDisplayBackground', background_image)
return loadById(id) return loadById(id)
}) })
.catch((reason) => { .catch((reason) => {
@ -233,6 +235,9 @@ const UserProfile = {
Conversation, Conversation,
RichContent, RichContent,
FollowedTagList FollowedTagList
},
beforeRouteLeave(to, from) {
this.$store.dispatch('setDisplayBackground', null)
} }
} }

View File

@ -604,6 +604,7 @@
"list_aliases_error": "Error fetching aliases: {error}", "list_aliases_error": "Error fetching aliases: {error}",
"list_backups_error": "Error fetching backup list: {error}", "list_backups_error": "Error fetching backup list: {error}",
"lock_account_description": "Restrict your account to approved followers only", "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": "Loop videos",
"loop_video_silent_only": "Loop only videos without sound (i.e. Mastodon's \"gifs\")", "loop_video_silent_only": "Loop only videos without sound (i.e. Mastodon's \"gifs\")",
"mascot": "Mastodon FE Mascot", "mascot": "Mastodon FE Mascot",
@ -754,6 +755,7 @@
"show_nav_shortcuts": "Show extra navigation shortcuts in top panel", "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_panel_nav_shortcuts": "Show timeline navigation shortcuts at the top of the panel",
"show_scrollbars": "Show side column's scrollbars", "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_wider_shortcuts": "Show wider gap between top panel shortcuts",
"show_yous": "Show (You)s", "show_yous": "Show (You)s",
"stop_gifs": "Pause animated images until you hover on them", "stop_gifs": "Pause animated images until you hover on them",

View File

@ -21,6 +21,7 @@ const loaders = {
ga: () => import('./ga.json'), ga: () => import('./ga.json'),
he: () => import('./he.json'), he: () => import('./he.json'),
hu: () => import('./hu.json'), hu: () => import('./hu.json'),
id: () => import('./id.json'),
it: () => import('./it.json'), it: () => import('./it.json'),
ja: () => import('./ja_pedantic.json'), ja: () => import('./ja_pedantic.json'),
ja_easy: () => import('./ja_easy.json'), ja_easy: () => import('./ja_easy.json'),

View File

@ -56,6 +56,7 @@ export const defaultState = {
alwaysShowNewPostButton: false, alwaysShowNewPostButton: false,
autohideFloatingPostButton: false, autohideFloatingPostButton: false,
pauseOnUnfocused: true, pauseOnUnfocused: true,
displayPageBackgrounds: true,
stopGifs: undefined, stopGifs: undefined,
replyVisibility: 'all', replyVisibility: 'all',
thirdColumnMode: 'notifications', thirdColumnMode: 'notifications',

View File

@ -47,6 +47,10 @@ export const settingsMap = {
}, },
// Privacy // Privacy
'locked': 'locked', 'locked': 'locked',
'permitFollowback': {
get: 'akkoma.permit_followback',
set: 'permit_followback'
},
'allowFollowingMove': { 'allowFollowingMove': {
get: 'pleroma.allow_following_move', get: 'pleroma.allow_following_move',
set: 'allow_following_move' set: 'allow_following_move'

View File

@ -135,6 +135,10 @@ export const mutations = {
const user = state.usersObject[id] const user = state.usersObject[id]
user['deactivated'] = deactivated user['deactivated'] = deactivated
}, },
setDisplayBackground(state, url) {
console.log("Commiting user profile bg mutation")
state.displayBackground = url
},
setCurrentUser (state, user) { setCurrentUser (state, user) {
state.lastLoginName = user.screen_name state.lastLoginName = user.screen_name
state.currentUser = mergeWith(state.currentUser || {}, user, mergeArrayLength) state.currentUser = mergeWith(state.currentUser || {}, user, mergeArrayLength)
@ -307,6 +311,7 @@ export const defaultState = {
currentUser: false, currentUser: false,
users: [], users: [],
usersObject: {}, usersObject: {},
displayBackground: null,
signUpPending: false, signUpPending: false,
signUpErrors: [], signUpErrors: [],
relationships: {}, relationships: {},
@ -319,6 +324,10 @@ const users = {
mutations, mutations,
getters, getters,
actions: { actions: {
setDisplayBackground (store, url) {
console.log("Performing user profile bg action...")
store.commit('setDisplayBackground', url)
},
fetchUserIfMissing (store, id) { fetchUserIfMissing (store, id) {
if (!store.getters.findUser(id)) { if (!store.getters.findUser(id)) {
store.dispatch('fetchUser', id) store.dispatch('fetchUser', id)

View File

@ -95,6 +95,7 @@ export const parseUser = (data) => {
if (data.akkoma) { if (data.akkoma) {
output.instance = data.akkoma.instance output.instance = data.akkoma.instance
output.status_ttl_days = data.akkoma.status_ttl_days output.status_ttl_days = data.akkoma.status_ttl_days
output.permit_followback = data.akkoma.permit_followback
} }
if (data.pleroma) { if (data.pleroma) {