From d47db568d28813dff0128506ad719c77de36224b Mon Sep 17 00:00:00 2001 From: notfire Date: Mon, 22 Dec 2025 16:43:17 -0500 Subject: [PATCH] jank shit to get the private note from the relationship route instead of the weird pleroma thing inside the user route --- src/components/user_profile/user_profile.js | 7 +++++++ src/modules/users.js | 3 +++ src/services/api/api.service.js | 8 ++++++++ 3 files changed, 18 insertions(+) diff --git a/src/components/user_profile/user_profile.js b/src/components/user_profile/user_profile.js index 913d1bdc..3cc8d2e6 100644 --- a/src/components/user_profile/user_profile.js +++ b/src/components/user_profile/user_profile.js @@ -150,6 +150,12 @@ const UserProfile = { this.$store.dispatch('fetchUser', userNameOrId) .then(({ id, relationship, background_image }) => { this.note = relationship?.note + if (this.note === undefined) { + this.$store.dispatch('fetchUserRelationshipNote', userNameOrId) + .then((resp) => { + this.note = resp + }) + } this.$store.dispatch('setDisplayBackground', background_image) return loadById(id) }) @@ -163,6 +169,7 @@ const UserProfile = { this.error = this.$t('user_profile.profile_loading_error') } }) + } }, stopFetching () { diff --git a/src/modules/users.js b/src/modules/users.js index 8c477b6f..e9754223 100644 --- a/src/modules/users.js +++ b/src/modules/users.js @@ -349,6 +349,9 @@ const users = { .then((relationships) => store.commit('updateUserRelationship', relationships)) } }, + fetchUserRelationshipNote (store, id) { + return store.rootState.api.backendInteractor.fetchUserRelationshipNote({ id }) + }, fetchBlocks (store, args) { const { reset } = args || {} diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index ed131102..7109c9d7 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -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 }) => { let url = MASTODON_FOLLOWING_URL(id) const args = [ @@ -1799,6 +1806,7 @@ const apiService = { removeUserFromFollowers, fetchUser, fetchUserRelationship, + fetchUserRelationshipNote, favorite, unfavorite, retweet,