From 457290e81ec9a37bf848f5d166fc77bf487e834d Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 3 Sep 2019 19:59:28 +0300 Subject: [PATCH 01/19] Replace `/api/externalprofile/show.json` with a MastoAPI equialent `/api/v1/accounts/:id` supports remote nicknames since pleroma!1622 --- src/components/who_to_follow/who_to_follow.js | 2 +- .../who_to_follow_panel/who_to_follow_panel.js | 2 +- src/services/api/api.service.js | 10 ---------- .../backend_interactor_service.js | 3 --- 4 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/components/who_to_follow/who_to_follow.js b/src/components/who_to_follow/who_to_follow.js index 8fab6c4d..1aa3a4cd 100644 --- a/src/components/who_to_follow/who_to_follow.js +++ b/src/components/who_to_follow/who_to_follow.js @@ -26,7 +26,7 @@ const WhoToFollow = { } this.users.push(user) - this.$store.state.api.backendInteractor.externalProfile(user.screen_name) + this.$store.state.api.backendInteractor.fetchUser({ id: user.screen_name }) .then((externalUser) => { if (!externalUser.error) { this.$store.commit('addNewUsers', [externalUser]) diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js index 7d01678b..dcb56106 100644 --- a/src/components/who_to_follow_panel/who_to_follow_panel.js +++ b/src/components/who_to_follow_panel/who_to_follow_panel.js @@ -13,7 +13,7 @@ function showWhoToFollow (panel, reply) { toFollow.img = img toFollow.name = name - panel.$store.state.api.backendInteractor.externalProfile(name) + panel.$store.state.api.backendInteractor.fetchUser({ id: name }) .then((externalUser) => { if (!externalUser.error) { panel.$store.commit('addNewUsers', [externalUser]) diff --git a/src/services/api/api.service.js b/src/services/api/api.service.js index 4cf41e61..887d7d7a 100644 --- a/src/services/api/api.service.js +++ b/src/services/api/api.service.js @@ -4,7 +4,6 @@ import 'whatwg-fetch' import { RegistrationError, StatusCodeError } from '../errors/errors' /* eslint-env browser */ -const EXTERNAL_PROFILE_URL = '/api/externalprofile/show.json' const QVITTER_USER_NOTIFICATIONS_READ_URL = '/api/qvitter/statuses/notifications/read.json' const BLOCKS_IMPORT_URL = '/api/pleroma/blocks_import' const FOLLOW_IMPORT_URL = '/api/pleroma/follow_import' @@ -220,14 +219,6 @@ const authHeaders = (accessToken) => { } } -const externalProfile = ({ profileUrl, credentials }) => { - let url = `${EXTERNAL_PROFILE_URL}?profileurl=${profileUrl}` - return fetch(url, { - headers: authHeaders(credentials), - method: 'GET' - }).then((data) => data.json()) -} - const followUser = ({ id, credentials }) => { let url = MASTODON_FOLLOW_URL(id) return fetch(url, { @@ -966,7 +957,6 @@ const apiService = { updateBg, updateProfile, updateBanner, - externalProfile, importBlocks, importFollows, deleteAccount, diff --git a/src/services/backend_interactor_service/backend_interactor_service.js b/src/services/backend_interactor_service/backend_interactor_service.js index 846d9415..3c44a10c 100644 --- a/src/services/backend_interactor_service/backend_interactor_service.js +++ b/src/services/backend_interactor_service/backend_interactor_service.js @@ -127,8 +127,6 @@ const backendInteractorService = credentials => { const updateBanner = ({ banner }) => apiService.updateBanner({ credentials, banner }) const updateProfile = ({ params }) => apiService.updateProfile({ credentials, params }) - const externalProfile = (profileUrl) => apiService.externalProfile({ profileUrl, credentials }) - const importBlocks = (file) => apiService.importBlocks({ file, credentials }) const importFollows = (file) => apiService.importFollows({ file, credentials }) @@ -194,7 +192,6 @@ const backendInteractorService = credentials => { updateBg, updateBanner, updateProfile, - externalProfile, importBlocks, importFollows, deleteAccount, From cdbb8ca8b925c0803513b26a15ff927d79fa0316 Mon Sep 17 00:00:00 2001 From: taehoon Date: Tue, 3 Sep 2019 16:44:51 -0400 Subject: [PATCH 02/19] force img updating immediately --- src/components/still-image/still-image.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index 3fff63f9..5a6529f2 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -9,6 +9,7 @@ /> Date: Wed, 4 Sep 2019 11:23:47 -0400 Subject: [PATCH 03/19] add a comment --- src/components/still-image/still-image.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/still-image/still-image.vue b/src/components/still-image/still-image.vue index 5a6529f2..4137bd59 100644 --- a/src/components/still-image/still-image.vue +++ b/src/components/still-image/still-image.vue @@ -7,6 +7,7 @@ v-if="animated" ref="canvas" /> + Date: Thu, 5 Sep 2019 11:16:11 +0300 Subject: [PATCH 04/19] Utilize `user.requested` to display follow request status on user card Closes #635 --- src/components/user_card/user_card.js | 4 +--- src/components/user_card/user_card.vue | 4 ++-- src/services/follow_manipulate/follow_manipulate.js | 11 ++++------- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js index 82d3b835..e3bd7697 100644 --- a/src/components/user_card/user_card.js +++ b/src/components/user_card/user_card.js @@ -11,7 +11,6 @@ export default { data () { return { followRequestInProgress: false, - followRequestSent: false, hideUserStatsLocal: typeof this.$store.state.config.hideUserStats === 'undefined' ? this.$store.state.instance.hideUserStats : this.$store.state.config.hideUserStats, @@ -112,9 +111,8 @@ export default { followUser () { const store = this.$store this.followRequestInProgress = true - requestFollow(this.user, store).then(({ sent }) => { + requestFollow(this.user, store).then(() => { this.followRequestInProgress = false - this.followRequestSent = sent }) }, unfollowUser () { diff --git a/src/components/user_card/user_card.vue b/src/components/user_card/user_card.vue index fc18e240..0b83cf16 100644 --- a/src/components/user_card/user_card.vue +++ b/src/components/user_card/user_card.vue @@ -135,13 +135,13 @@