Fix details for public viewers

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/244/head
Julius Härtl 2018-12-20 11:19:00 +01:00
rodzic 1bf955d51b
commit a951c01aff
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4C614C6ED2CDE6DF
1 zmienionych plików z 3 dodań i 8 usunięć

Wyświetl plik

@ -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);