kopia lustrzana https://github.com/nextcloud/social
Fix details for public viewers
Signed-off-by: Julius Härtl <jus@bitgrid.net>pull/244/head
rodzic
1bf955d51b
commit
a951c01aff
|
@ -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);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue