3 * @copyright Copyright (C) 2010-2023, the Friendica project
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 namespace Friendica\Module\Profile;
25 use Friendica\BaseModule;
26 use Friendica\Content\Conversation;
27 use Friendica\Core\Config\Capability\IManageConfigValues;
28 use Friendica\Core\L10n;
29 use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues;
30 use Friendica\Core\Session\Capability\IHandleUserSessions;
31 use Friendica\Database\Database;
32 use Friendica\Module\Response;
33 use Friendica\Profile\ProfileField\Repository\ProfileField;
34 use Friendica\Util\DateTimeFormat;
35 use Friendica\Util\Profiler;
36 use Psr\Log\LoggerInterface;
39 * Profile index router
41 * The default profile path (https://domain.tld/profile/nickname) has to serve the profile data when queried as an
42 * ActivityPub endpoint, but it should show statuses to web users.
44 * Both these view have dedicated sub-paths,
45 * respectively https://domain.tld/profile/nickname/profile and https://domain.tld/profile/nickname/conversations
47 class Index extends BaseModule
53 /** @var IHandleUserSessions */
55 /** @var IManageConfigValues */
59 /** @var ProfileField */
60 private $profileField;
61 /** @var DateTimeFormat */
62 private $dateTimeFormat;
63 /** @var Conversation */
64 private $conversation;
65 /** @var IManagePersonalConfigValues */
70 public function __construct(App\Mode $mode, IManagePersonalConfigValues $pConfig, Conversation $conversation, DateTimeFormat $dateTimeFormat, ProfileField $profileField, App\Page $page, IManageConfigValues $config, IHandleUserSessions $session, App $app, Database $database, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
72 parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
74 $this->database = $database;
76 $this->session = $session;
77 $this->config = $config;
79 $this->profileField = $profileField;
80 $this->dateTimeFormat = $dateTimeFormat;
81 $this->conversation = $conversation;
82 $this->pConfig = $pConfig;
86 protected function rawContent(array $request = [])
88 (new Profile($this->profileField, $this->page, $this->config, $this->session, $this->app, $this->database, $this->l10n, $this->baseUrl, $this->args, $this->logger, $this->profiler, $this->response, $this->server, $this->parameters))->rawContent();
91 protected function content(array $request = []): string
93 return (new Conversations($this->mode, $this->pConfig, $this->conversation, $this->session, $this->config, $this->dateTimeFormat, $this->page, $this->app, $this->l10n, $this->baseUrl, $this->args, $this->logger, $this->profiler, $this->response, $this->server, $this->parameters))->content();