X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FContact%2FPosts.php;h=c5a6da0d17328c86ac813bca17ddfe88d5afb11b;hb=79235b6db1c9badd6c9602d54ad0d550e4bec2fd;hp=3409d9169bc9f947ff751f7c4c00a531b7b11f9c;hpb=214a0524ddc069f71c896eef8ccf031033125932;p=friendica.git diff --git a/src/Module/Contact/Posts.php b/src/Module/Contact/Posts.php index 3409d9169b..c5a6da0d17 100644 --- a/src/Module/Contact/Posts.php +++ b/src/Module/Contact/Posts.php @@ -1,6 +1,6 @@ localRelationship = $localRelationship; - $this->baseUrl = $baseUrl; $this->page = $page; + $this->userSession = $userSession; } - public function content(): string + protected function content(array $request = []): string { - if (!local_user()) { + if (!$this->userSession->getLocalUserId()) { return Login::form($_SERVER['REQUEST_URI']); } // Backward compatibility: Ensure to use the public contact when the user contact is provided // Remove by version 2022.03 - $data = Model\Contact::getPublicAndUserContactID(intval($this->parameters['id']), local_user()); + $data = Model\Contact::getPublicAndUserContactID(intval($this->parameters['id']), $this->userSession->getLocalUserId()); if (empty($data)) { throw new NotFoundException($this->t('Contact not found.')); } @@ -84,7 +88,7 @@ class Posts extends BaseModule throw new NotFoundException($this->t('Contact not found.')); } - $localRelationship = $this->localRelationship->getForUserContact(local_user(), $contact['id']); + $localRelationship = $this->localRelationship->getForUserContact($this->userSession->getLocalUserId(), $contact['id']); if ($localRelationship->rel === Model\Contact::SELF) { $this->baseUrl->redirect('profile/' . $contact['nick']); }