diff options
author | Robin Appelman <robin@icewind.nl> | 2020-09-14 15:31:37 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2020-09-18 19:25:13 +0200 |
commit | 952ffb94a68440cc93d383a30e40e78e24cd9d5d (patch) | |
tree | 9f81b6009365b7b91714b5fa14462cba93e94254 /lib | |
parent | 8e6b2d3c49ecdfead2cce9780537e600b0e3b4c7 (diff) |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Controller/OStatusController.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/Controller/OStatusController.php b/lib/Controller/OStatusController.php index 3ca22a34..07cd4a92 100644 --- a/lib/Controller/OStatusController.php +++ b/lib/Controller/OStatusController.php @@ -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); |