diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2020-09-22 21:15:07 -0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-22 21:15:07 -0100 |
commit | 261b7c70036566e71157234c2ae61dddb9e645a9 (patch) | |
tree | 56cba062c557a6019385ab3ae897b56265fd0f53 | |
parent | cb940981cd67d80824bacd487861f19bafa9c97d (diff) | |
parent | 952ffb94a68440cc93d383a30e40e78e24cd9d5d (diff) |
Merge pull request #1027 from nextcloud/ostatus-follow
render profile page for ostatus follow url
-rw-r--r-- | lib/Controller/OStatusController.php | 17 | ||||
-rw-r--r-- | src/router.js | 8 | ||||
-rw-r--r-- | src/views/Profile.vue | 2 |
3 files changed, 19 insertions, 8 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); diff --git a/src/router.js b/src/router.js index 696c62e2..bb797aaf 100644 --- a/src/router.js +++ b/src/router.js @@ -97,6 +97,14 @@ export default new Router({ } } ] + }, + { + path: '/:index(index.php/)?apps/social/ostatus/follow', + components: { + default: Profile, + details: ProfileTimeline + }, + props: true, } ] }) diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 109dd9d0..7e9f7e8d 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -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) { |