summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-06-27 13:01:05 -0100
committerMaxence Lange <maxence@artificial-owl.com>2019-07-04 16:33:27 -0100
commit40b5a67f2c129b2b3bf55953dc196e89177e90d7 (patch)
treed213d7f9f9f9f088b05060cad7f842bf2600fc6a /lib
parent2afeee24ad2eec19b3329aac03245e4e1e296c56 (diff)
fixing
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Command/Timeline.php13
-rw-r--r--lib/Service/FollowService.php2
2 files changed, 9 insertions, 6 deletions
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);