]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Feed.php
Merge pull request #12131 from MrPetovan/task/4090-move-mod-salmon
[friendica.git] / src / Module / Feed.php
index 8db92c275a7a067c78628b8f90ed335b9ac9e05a..b24ccbc94666ba5b8f842ccde7428c687dc0d5d8 100644 (file)
@@ -25,6 +25,7 @@ use Friendica\BaseModule;
 use Friendica\Core\System;
 use Friendica\DI;
 use Friendica\Protocol\Feed as ProtocolFeed;
+use Friendica\Network\HTTPException;
 
 /**
  * Provides public Atom feeds
@@ -42,10 +43,10 @@ use Friendica\Protocol\Feed as ProtocolFeed;
  */
 class Feed extends BaseModule
 {
-       protected function content(array $request = []): string
+       protected function rawContent(array $request = [])
        {
-               $last_update = $request['last_update'] ?? '';
-               $nocache     = !empty($request['nocache']) && local_user();
+               $last_update = $this->getRequestValue($request, 'last_update', '');
+               $nocache     = !empty($request['nocache']) && DI::userSession()->getLocalUserId();
 
                $type = null;
                // @TODO: Replace with parameter from router
@@ -66,6 +67,11 @@ class Feed extends BaseModule
                                $type = 'posts';
                }
 
-               System::httpExit(ProtocolFeed::atom($this->parameters['nickname'], $last_update, 10, $type, $nocache, true), Response::TYPE_ATOM);
+               $feed = ProtocolFeed::atom($this->parameters['nickname'], $last_update, 10, $type, $nocache, true);
+               if (empty($feed)) {
+                       throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
+               }
+
+               System::httpExit($feed, Response::TYPE_ATOM);
        }
 }