X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FContact%2FConversations.php;h=838e499ccbaaf7fa94e7b3a08d65e7dc755471a4;hb=79235b6db1c9badd6c9602d54ad0d550e4bec2fd;hp=2c1cf91d6bc997f20f722d9fd057e5f8116f91f0;hpb=06284e60073f374c1bd411e0bba6474a13c14f10;p=friendica.git diff --git a/src/Module/Contact/Conversations.php b/src/Module/Contact/Conversations.php index 2c1cf91d6b..838e499ccb 100644 --- a/src/Module/Contact/Conversations.php +++ b/src/Module/Contact/Conversations.php @@ -1,8 +1,8 @@ page = $page; $this->conversation = $conversation; - $this->baseUrl = $baseUrl; $this->localRelationship = $localRelationship; + $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.')); } @@ -90,7 +94,7 @@ class Conversations 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']); }