This commit is contained in:
FloatingGhost 2021-05-21 11:37:33 +01:00
commit 6d47156297
21 changed files with 1073 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Before After
Before After

View file

@ -192,8 +192,8 @@ $status-margin: 0.75em;
object-fit: contain;
&.emoji {
width: 32px;
height: 32px;
width: 50px;
height: 50px;
}
}

View file

@ -313,6 +313,8 @@
"collapse_subject": "Collapse posts with subjects",
"composing": "Composing",
"confirm_new_password": "Confirm new password",
"current_avatar": "Your current avatar",
"current_mascot": "Your current mascot",
"current_password": "Current password",
"mutes_and_blocks": "Mutes and Blocks",
"data_import_export_tab": "Data import / export",
@ -433,8 +435,10 @@
"search_user_to_mute": "Search whom you want to mute",
"security_tab": "Security",
"scope_copy": "Copy scope when replying (DMs are always copied)",
"mascot": "Mastodon FE Mascot",
"minimal_scopes_mode": "Minimize post scope selection options",
"set_new_avatar": "Set new avatar",
"set_new_mascot": "Set new mascot",
"set_new_profile_background": "Set new profile background",
"set_new_profile_banner": "Set new profile banner",
"reset_avatar": "Reset avatar",

View file

@ -88,6 +88,10 @@ const showReblogs = (store, userId) => {
.then((relationship) => store.commit('updateUserRelationship', [relationship]))
}
const fetchMascot = (store) => {
return store.rootState.api.backendInteractor.fetchMascot()
.then(({ url }) => store.commit('updateMascot', url))
}
const muteDomain = (store, domain) => {
return store.rootState.api.backendInteractor.muteDomain({ domain })
.then(() => store.commit('addDomainMute', domain))
@ -186,6 +190,9 @@ export const mutations = {
state.currentUser.muteIds.push(muteId)
}
},
updateMascot (state, mascotUrl) {
state.currentUser.mascot = mascotUrl
},
saveDomainMutes (state, domainMutes) {
state.currentUser.domainMutes = domainMutes
},
@ -332,6 +339,9 @@ const users = {
unmuteUsers (store, ids = []) {
return Promise.all(ids.map(id => unmuteUser(store, id)))
},
fetchMascot (store) {
return fetchMascot(store)
},
fetchDomainMutes (store) {
return store.rootState.api.backendInteractor.fetchDomainMutes()
.then((domainMutes) => {

View file

@ -76,6 +76,7 @@ const MASTODON_MUTE_CONVERSATION = id => `/api/v1/statuses/${id}/mute`
const MASTODON_UNMUTE_CONVERSATION = id => `/api/v1/statuses/${id}/unmute`
const MASTODON_SEARCH_2 = `/api/v2/search`
const MASTODON_USER_SEARCH_URL = '/api/v1/accounts/search'
const MASTODON_MASCOT_URL = '/api/v1/pleroma/mascot'
const MASTODON_DOMAIN_BLOCKS_URL = '/api/v1/domain_blocks'
const MASTODON_STREAMING = '/api/v1/streaming'
const MASTODON_KNOWN_DOMAIN_LIST_URL = '/api/v1/instance/peers'
@ -855,6 +856,20 @@ const unmuteUser = ({ id, credentials }) => {
return promisedRequest({ url: MASTODON_UNMUTE_USER_URL(id), credentials, method: 'POST' })
}
const fetchMascot = ({ credentials }) => {
return promisedRequest({ url: MASTODON_MASCOT_URL, credentials })
}
const updateMascot = ({ mascot, credentials }) => {
const form = new FormData()
form.append('file', mascot)
return fetch(MASTODON_MASCOT_URL, {
headers: authHeaders(credentials),
method: 'PUT',
body: form
}).then((data) => data.json())
}
const subscribeUser = ({ id, credentials }) => {
return promisedRequest({ url: MASTODON_SUBSCRIBE_USER(id), credentials, method: 'POST' })
}
@ -1335,6 +1350,8 @@ const apiService = {
fetchPoll,
fetchFavoritedByUsers,
fetchRebloggedByUsers,
fetchMascot,
updateMascot,
fetchEmojiReactions,
reactWithEmoji,
unreactWithEmoji,