]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Home.php
Remove extraneous ID parameter from Mastodon Blocks Listing API
[friendica.git] / src / Module / Home.php
index 43e783f18c64f9ce8410a63175a07987e3d0223f..74cc88d30d95d032afd8f74d91ce5fb5f114dc3c 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -25,14 +25,23 @@ use Friendica\BaseModule;
 use Friendica\Core\Hook;
 use Friendica\Core\Renderer;
 use Friendica\DI;
+use Friendica\Model\User;
 use Friendica\Module\Security\Login;
+use Friendica\Protocol\ActivityPub;
 
 /**
  * Home module - Landing page of the current node
  */
 class Home extends BaseModule
 {
-       public static function content(array $parameters = [])
+       protected function rawContent(array $request = [])
+       {
+               if (ActivityPub::isRequest()) {
+                       DI::baseUrl()->redirect(User::getActorName());
+               }
+       }
+
+       protected function content(array $request = []): string
        {
                $app = DI::app();
                $config = DI::config();
@@ -42,11 +51,11 @@ class Home extends BaseModule
 
                Hook::callAll('home_init', $ret);
 
-               if (local_user() && ($app->user['nickname'])) {
+               if (DI::userSession()->getLocalUserId() && ($app->getLoggedInUserNickname())) {
                        DI::baseUrl()->redirect('network');
                }
 
-               if (strlen($config->get('system', 'singleuser'))) {
+               if ($config->get('system', 'singleuser')) {
                        DI::baseUrl()->redirect('/profile/' . $config->get('system', 'singleuser'));
                }