Profiles view is now able to load an account whose domain part is

a host-meta of the real domain.

Signed-off-by: Cyrille Bollu <cyrpub@bollu.be>
feature/noid/sql-rewrite-0929
Cyrille Bollu 2019-09-17 17:10:08 +02:00
rodzic eefa99f287
commit 128438e705
2 zmienionych plików z 15 dodań i 3 usunięć

Wyświetl plik

@ -108,13 +108,15 @@ const actions = {
fetchAccountInfo(context, account) {
return axios.get(OC.generateUrl(`apps/social/api/v1/global/account/info?account=${account}`)).then((response) => {
context.commit('addAccount', { actorId: response.data.result.account.id, data: response.data.result.account })
return response.data.result.account
}).catch(() => {
OC.Notification.showTemporary(`Failed to load account details ${account}`)
})
},
fetchPublicAccountInfo(context, uid) {
axios.get(OC.generateUrl(`apps/social/api/v1/account/${uid}/info`)).then((response) => {
return axios.get(OC.generateUrl(`apps/social/api/v1/account/${uid}/info`)).then((response) => {
context.commit('addAccount', { actorId: response.data.result.account.id, data: response.data.result.account })
return response.data.result.account
}).catch(() => {
OC.Notification.showTemporary(`Failed to load account details ${uid}`)
})

Wyświetl plik

@ -79,12 +79,22 @@ export default {
}
},
beforeMount() {
let fetchMethod = ''
this.uid = this.$route.params.account
// Are we authenticated?
if (this.serverData.public) {
this.$store.dispatch('fetchPublicAccountInfo', this.uid)
fetchMethod = 'fetchPublicAccountInfo'
} else {
this.$store.dispatch('fetchAccountInfo', this.profileAccount)
fetchMethod = 'fetchAccountInfo'
}
// We need to update this.uid because we may have asked info for an account whose domain part was a host-meta,
// and the account returned by the backend always uses a non host-meta'ed domain for its ID
this.$store.dispatch(fetchMethod, this.profileAccount).then((response) => {
this.uid = response.account
})
},
methods: {
}