]> git.mxchange.org Git - friendica.git/commitdiff
Allow longer avatar URLs / the system outbox is now handled
authorMichael <heluecht@pirati.ca>
Fri, 15 Dec 2023 10:39:41 +0000 (10:39 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 15 Dec 2023 10:39:41 +0000 (10:39 +0000)
src/Model/APContact.php
src/Module/ActivityPub/Outbox.php
static/routes.config.php

index c77e20818685c7110552b556d99ffc730abde7b5..53b70398e5e8d2b4527a7148903b95698fcdbb76 100644 (file)
@@ -385,18 +385,18 @@ class APContact
                }
 
                // When the photo is too large, try to shorten it by removing parts
-               if (strlen($apcontact['photo'] ?? '') > 255) {
+               if (strlen($apcontact['photo'] ?? '') > 383) {
                        $parts = parse_url($apcontact['photo']);
                        unset($parts['fragment']);
                        $apcontact['photo'] = (string)Uri::fromParts((array)$parts);
 
-                       if (strlen($apcontact['photo']) > 255) {
+                       if (strlen($apcontact['photo']) > 383) {
                                unset($parts['query']);
                                $apcontact['photo'] = (string)Uri::fromParts((array)$parts);
                        }
 
-                       if (strlen($apcontact['photo']) > 255) {
-                               $apcontact['photo'] = substr($apcontact['photo'], 0, 255);
+                       if (strlen($apcontact['photo']) > 383) {
+                               $apcontact['photo'] = substr($apcontact['photo'], 0, 383);
                        }
                }
 
index e637a8e55300cf1d4b3bd50e826ce6698a60dc56..a0050b1ce4f1d6bbfa15c37e94a92a1c5a0b39bb 100644 (file)
@@ -21,7 +21,6 @@
 
 namespace Friendica\Module\ActivityPub;
 
-use Friendica\Core\System;
 use Friendica\Model\User;
 use Friendica\Module\BaseApi;
 use Friendica\Protocol\ActivityPub;
@@ -36,7 +35,7 @@ class Outbox extends BaseApi
        protected function rawContent(array $request = [])
        {
                if (empty($this->parameters['nickname'])) {
-                       throw new \Friendica\Network\HTTPException\NotFoundException();
+                       $this->jsonExit([], 'application/activity+json');
                }
 
                $owner = User::getOwnerDataByNick($this->parameters['nickname']);
index e1dbc6321b3ab8caa6bcdc0a9603691723b749e2..8aa2d22ed9cbf82005218de183218d8c7dc2ed01 100644 (file)
@@ -452,6 +452,7 @@ return [
        '/following/{nickname}' => [Module\ActivityPub\Following::class, [R::GET]],
        '/friendica[/{format:json}]' => [Module\Friendica::class,        [R::GET]],
        '/friendica/inbox'      => [Module\ActivityPub\Inbox::class,     [R::GET, R::POST]],
+       '/friendica/outbox'     => [Module\ActivityPub\Outbox::class,    [R::GET]],
 
        '/fsuggest/{contact:\d+}' => [Module\FriendSuggest::class,  [R::GET, R::POST]],