jank shit to get the private note from the relationship route instead of the weird pleroma thing inside the user route

This commit is contained in:
notfire 2025-12-22 16:43:17 -05:00
commit d47db568d2
No known key found for this signature in database
3 changed files with 18 additions and 0 deletions

View file

@ -150,6 +150,12 @@ const UserProfile = {
this.$store.dispatch('fetchUser', userNameOrId) this.$store.dispatch('fetchUser', userNameOrId)
.then(({ id, relationship, background_image }) => { .then(({ id, relationship, background_image }) => {
this.note = relationship?.note this.note = relationship?.note
if (this.note === undefined) {
this.$store.dispatch('fetchUserRelationshipNote', userNameOrId)
.then((resp) => {
this.note = resp
})
}
this.$store.dispatch('setDisplayBackground', background_image) this.$store.dispatch('setDisplayBackground', background_image)
return loadById(id) return loadById(id)
}) })
@ -163,6 +169,7 @@ const UserProfile = {
this.error = this.$t('user_profile.profile_loading_error') this.error = this.$t('user_profile.profile_loading_error')
} }
}) })
} }
}, },
stopFetching () { stopFetching () {

View file

@ -349,6 +349,9 @@ const users = {
.then((relationships) => store.commit('updateUserRelationship', relationships)) .then((relationships) => store.commit('updateUserRelationship', relationships))
} }
}, },
fetchUserRelationshipNote (store, id) {
return store.rootState.api.backendInteractor.fetchUserRelationshipNote({ id })
},
fetchBlocks (store, args) { fetchBlocks (store, args) {
const { reset } = args || {} const { reset } = args || {}

View file

@ -381,6 +381,13 @@ const fetchUserRelationship = ({ id, credentials }) => {
}) })
} }
const fetchUserRelationshipNote = ({ id, credentials }) => {
const url = `${MASTODON_USER_RELATIONSHIPS_URL}/?id=${id}`
return promisedRequest({ url, credentials }).then((resp) => {
return resp[0].note
})
}
const fetchFriends = ({ id, maxId, sinceId, limit = 20, credentials }) => { const fetchFriends = ({ id, maxId, sinceId, limit = 20, credentials }) => {
let url = MASTODON_FOLLOWING_URL(id) let url = MASTODON_FOLLOWING_URL(id)
const args = [ const args = [
@ -1799,6 +1806,7 @@ const apiService = {
removeUserFromFollowers, removeUserFromFollowers,
fetchUser, fetchUser,
fetchUserRelationship, fetchUserRelationship,
fetchUserRelationshipNote,
favorite, favorite,
unfavorite, unfavorite,
retweet, retweet,