diff --git a/lib/Controller/SocialPubController.php b/lib/Controller/SocialPubController.php index ce9f131b..49d291dd 100644 --- a/lib/Controller/SocialPubController.php +++ b/lib/Controller/SocialPubController.php @@ -94,6 +94,12 @@ class SocialPubController extends Controller { $this->navigationController = $navigationController; } + /** + * @param $username + * + * @return Response + * @throws UrlCloudException + */ private function renderPage($username): Response { if ($this->userId) { return $this->navigationController->navigate(''); diff --git a/lib/Db/NotesRequestBuilder.php b/lib/Db/NotesRequestBuilder.php index 5995560c..5d770ddd 100644 --- a/lib/Db/NotesRequestBuilder.php +++ b/lib/Db/NotesRequestBuilder.php @@ -31,11 +31,10 @@ namespace OCA\Social\Db; use daita\MySmallPhpTools\Traits\TArrayTools; -use DateTime; use Doctrine\DBAL\Query\QueryBuilder; use OCA\Social\Exceptions\InvalidResourceException; -use OCA\Social\Model\ActivityPub\Object\Note; use OCA\Social\Model\ActivityPub\Actor\Person; +use OCA\Social\Model\ActivityPub\Object\Note; use OCA\Social\Model\InstancePath; use OCP\DB\QueryBuilder\ICompositeExpression; use OCP\DB\QueryBuilder\IQueryBuilder; diff --git a/lib/Interfaces/Activity/DeleteInterface.php b/lib/Interfaces/Activity/DeleteInterface.php index ce963115..5d57ffc9 100644 --- a/lib/Interfaces/Activity/DeleteInterface.php +++ b/lib/Interfaces/Activity/DeleteInterface.php @@ -77,8 +77,8 @@ class DeleteInterface implements IActivityPubInterface { $interface->delete($object); return; - } catch (UnknownItemException $e) { } catch (ItemNotFoundException $e) { + } catch (ItemUnknownException $e) { } } } diff --git a/lib/Interfaces/Object/NoteInterface.php b/lib/Interfaces/Object/NoteInterface.php index 7c4b7ae7..612d2081 100644 --- a/lib/Interfaces/Object/NoteInterface.php +++ b/lib/Interfaces/Object/NoteInterface.php @@ -38,7 +38,6 @@ use OCA\Social\Exceptions\NoteNotFoundException; use OCA\Social\Interfaces\IActivityPubInterface; use OCA\Social\Model\ActivityPub\ACore; use OCA\Social\Model\ActivityPub\Activity\Create; -use OCA\Social\Model\ActivityPub\Activity\Update; use OCA\Social\Model\ActivityPub\Object\Note; use OCA\Social\Service\ConfigService; use OCA\Social\Service\CurlService; diff --git a/lib/Service/AccountService.php b/lib/Service/AccountService.php index ff868350..f94bd965 100644 --- a/lib/Service/AccountService.php +++ b/lib/Service/AccountService.php @@ -38,6 +38,7 @@ use OCA\Social\Db\FollowsRequest; use OCA\Social\Db\NotesRequest; use OCA\Social\Exceptions\AccountAlreadyExistsException; use OCA\Social\Exceptions\ActorDoesNotExistException; +use OCA\Social\Exceptions\ItemUnknownException; use OCA\Social\Exceptions\SocialAppConfigException; use OCA\Social\Exceptions\UrlCloudException; use OCA\Social\Model\ActivityPub\Actor\Person; @@ -245,8 +246,11 @@ class AccountService { return; } - $iconId = $this->documentService->cacheLocalAvatarByUsername($actor); - $actor->setIconId($iconId); + try { + $iconId = $this->documentService->cacheLocalAvatarByUsername($actor); + $actor->setIconId($iconId); + } catch (ItemUnknownException $e) { + } $count = [ 'followers' => $this->followsRequest->countFollowers($actor->getId()),