From 40b5a67f2c129b2b3bf55953dc196e89177e90d7 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Thu, 27 Jun 2019 13:01:05 -0100 Subject: fixing Signed-off-by: Maxence Lange --- lib/Command/Timeline.php | 13 +++++++------ lib/Service/FollowService.php | 2 ++ 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/Command/Timeline.php b/lib/Command/Timeline.php index f68711e4..d2120ead 100644 --- a/lib/Command/Timeline.php +++ b/lib/Command/Timeline.php @@ -41,6 +41,7 @@ use OCA\Social\Exceptions\RedundancyLimitException; use OCA\Social\Exceptions\SocialAppConfigException; use OCA\Social\Model\ActivityPub\Actor\Person; use OCA\Social\Model\ActivityPub\Stream; +use OCA\Social\Service\AccountService; use OCA\Social\Service\CacheActorService; use OCA\Social\Service\ConfigService; use OCA\Social\Service\MiscService; @@ -66,8 +67,8 @@ class Timeline extends Base { /** @var StreamRequest */ private $streamRequest; - /** @var CacheActorService */ - private $cacheActorService; + /** @var AccountService */ + private $accountService; /** @var ConfigService */ private $configService; @@ -91,20 +92,20 @@ class Timeline extends Base { * * @param IUserManager $userManager * @param StreamRequest $streamRequest - * @param CacheActorService $cacheActorService + * @param AccountService $accountService * @param ConfigService $configService * @param MiscService $miscService */ public function __construct( IUserManager $userManager, StreamRequest $streamRequest, - CacheActorService $cacheActorService, ConfigService $configService, + AccountService $accountService, ConfigService $configService, MiscService $miscService ) { parent::__construct(); $this->userManager = $userManager; $this->streamRequest = $streamRequest; - $this->cacheActorService = $cacheActorService; + $this->accountService = $accountService; $this->configService = $configService; $this->miscService = $miscService; } @@ -144,7 +145,7 @@ class Timeline extends Base { throw new Exception('Unknown user'); } - $actor = $this->cacheActorService->getFromLocalAccount($userId); + $actor = $this->accountService->getActor($userId); $this->outputActor($actor); $this->displayStream($actor, $timeline); diff --git a/lib/Service/FollowService.php b/lib/Service/FollowService.php index ec4b5b67..512dbd83 100644 --- a/lib/Service/FollowService.php +++ b/lib/Service/FollowService.php @@ -48,6 +48,7 @@ use OCA\Social\Exceptions\RequestResultSizeException; use OCA\Social\Exceptions\RequestServerException; use OCA\Social\Exceptions\SocialAppConfigException; use OCA\Social\Exceptions\ItemUnknownException; +use OCA\Social\Exceptions\UnauthorizedFediverseException; use OCA\Social\Exceptions\UrlCloudException; use OCA\Social\Model\ActivityPub\Object\Follow; use OCA\Social\Model\ActivityPub\Activity\Undo; @@ -131,6 +132,7 @@ class FollowService { * @throws RequestResultSizeException * @throws RequestServerException * @throws RequestResultNotJsonException + * @throws UnauthorizedFediverseException */ public function followAccount(Person $actor, string $account) { $remoteActor = $this->cacheActorService->getFromAccount($account); -- cgit v1.2.3