summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-12-20 11:19:00 +0100
committerJulius Härtl <jus@bitgrid.net>2018-12-20 11:34:44 +0100
commita951c01affc721292015de32c7d3cb3af9ad464a (patch)
treed476326e35bcfb1554951f6ffa85ac1d7837ef4d /lib
parent1bf955d51b3886a3508cc99014c0a5f20558602d (diff)
Fix details for public viewers
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/LocalController.php11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php
index fd64a64b..282d3de1 100644
--- a/lib/Controller/LocalController.php
+++ b/lib/Controller/LocalController.php
@@ -251,6 +251,7 @@ class LocalController extends Controller {
$this->initViewer();
$account = $this->cacheActorService->getFromLocalAccount($username);
+ $account->setCompleteDetails(true);
$posts = $this->noteService->getStreamAccount($account->getId(), $since, $limit);
return $this->success($posts);
@@ -436,7 +437,7 @@ class LocalController extends Controller {
$this->initViewer();
$actor = $this->cacheActorService->getFromLocalAccount($username);
-
+ $actor->setCompleteDetails(true);
return $this->success(['account' => $actor]);
} catch (Exception $e) {
return $this->fail($e);
@@ -630,15 +631,9 @@ class LocalController extends Controller {
* @throws AccountDoesNotExistException
*/
private function initViewer(bool $exception = false) {
- // only initialize viewer data for logged in users
- if ($this->userId === null) {
- // TODO: properly set viewer
- $this->followService->setViewerId('guest');
- $this->personService->setViewerId('guest');
- $this->noteService->setViewerId('guest');
+ if (!isset($this->userId)) {
return;
}
-
try {
$this->viewer = $this->accountService->getActorFromUserId($this->userId, true);