render profile page for ostatus follow url

when initiating a follow from a remote mastadon instance, the user gets directed to 'apps/social/ostatus/follow/?uri=' which is currently broken.

this changes it to render the regular profile page for that link, allowing the user to follow the profile.

I'm not sure what the previous behavior was before things got broken

Signed-off-by: Robin Appelman <robin@icewind.nl>
pull/1027/head
Robin Appelman 2020-09-14 15:31:37 +02:00
rodzic 8e6b2d3c49
commit 952ffb94a6
3 zmienionych plików z 19 dodań i 8 usunięć

Wyświetl plik

@ -72,12 +72,15 @@ class OStatusController extends Controller {
/** @var IUserManager */
private $userSession;
/** @var IInitialStateService */
private $initialStateService;
/**
* OStatusController constructor.
*
* @param IRequest $request
* @param IInitialStateService $initialStateService
* @param CacheActorService $cacheActorService
* @param AccountService $accountService
* @param CurlService $curlService
@ -122,14 +125,14 @@ class OStatusController extends Controller {
}
$this->initialStateService->provideInitialState('social', 'serverData', [
'account' => $actor->getAccount(),
'account' => $actor->getAccount(),
'currentUser' => [
'uid' => $user->getUID(),
'uid' => $user->getUID(),
'displayName' => $user->getDisplayName(),
]
],
]);
return new TemplateResponse(
'social', 'main', 'guest'
'social', 'main', []
);
} catch (Exception $e) {
return $this->fail($e);
@ -151,11 +154,11 @@ class OStatusController extends Controller {
$following = $this->accountService->getActor($local);
$this->initialStateService->provideInitialState('social', 'serverData', [
'local' => $local,
'account' => $following->getAccount()
'local' => $local,
'account' => $following->getAccount(),
]);
return new TemplateResponse(
'social', 'main', 'guest'
'social', 'main', [], 'guest'
);
} catch (Exception $e) {
return $this->fail($e);

Wyświetl plik

@ -97,6 +97,14 @@ export default new Router({
}
}
]
},
{
path: '/:index(index.php/)?apps/social/ostatus/follow',
components: {
default: Profile,
details: ProfileTimeline
},
props: true,
}
]
})

Wyświetl plik

@ -81,7 +81,7 @@ export default {
beforeMount() {
let fetchMethod = ''
this.uid = this.$route.params.account
this.uid = this.$route.params.account || this.serverData.account
// Are we authenticated?
if (this.serverData.public) {