]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/DFRN/Poll.php
Changes:
[friendica.git] / src / Module / DFRN / Poll.php
index e41dafed56f2c2d90d2d7017024fe86135a54d07..d05298a79d97f556f0d4ca93c133a0fec3091294 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -23,7 +23,9 @@ namespace Friendica\Module\DFRN;
 
 use Friendica\BaseModule;
 use Friendica\Core\System;
+use Friendica\Model\User;
 use Friendica\Module\Response;
+use Friendica\Network\HTTPException;
 use Friendica\Protocol\OStatus;
 
 /**
@@ -33,7 +35,19 @@ class Poll extends BaseModule
 {
        protected function rawContent(array $request = [])
        {
+               $owner = User::getByNickname(
+                       $this->parameters['nickname'] ?? '',
+                       ['nickname', 'blocked', 'account_expired', 'account_removed']
+               );
+               if (!$owner || $owner['account_expired'] || $owner['account_removed']) {
+                       throw new HTTPException\NotFoundException($this->t('User not found.'));
+               }
+
+               if ($owner['blocked']) {
+                       throw new HTTPException\UnauthorizedException($this->t('Access to this profile has been restricted.'));
+               }
+
                $last_update = $request['last_update'] ?? '';
-               System::httpExit(OStatus::feed($this->parameters['nickname'], $last_update, 10) ?? '', Response::TYPE_ATOM);
+               $this->httpExit(OStatus::feed($owner['nickname'], $last_update, 10) ?? '', Response::TYPE_ATOM);
        }
 }