summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2019-01-16 12:11:45 -0100
committerBackportbot <backportbot-noreply@rullzer.com>2019-01-20 22:35:38 +0000
commitf66dce1cc9aa14b76143ecb79f6f27ba51d0983b (patch)
treec5f37143b6d4aab1158dc63c3e729fe84f507465
parent83bf668b690bc1962987129d88194517e6b8c50a (diff)
some fix
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r--lib/Controller/LocalController.php2
-rw-r--r--lib/Service/PostService.php15
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/Controller/LocalController.php b/lib/Controller/LocalController.php
index a0a7ed48..a65752b0 100644
--- a/lib/Controller/LocalController.php
+++ b/lib/Controller/LocalController.php
@@ -151,8 +151,6 @@ class LocalController extends Controller {
/** @var ACore $activity */
$token = $this->postService->createPost($post, $activity);
- $this->accountService->cacheLocalActorDetailCount($actor);
-
return $this->success(
[
'post' => $activity->getObject(),
diff --git a/lib/Service/PostService.php b/lib/Service/PostService.php
index a1e08e3f..89c0f603 100644
--- a/lib/Service/PostService.php
+++ b/lib/Service/PostService.php
@@ -38,7 +38,6 @@ use OCA\Social\Exceptions\NoteNotFoundException;
use OCA\Social\Exceptions\RedundancyLimitException;
use OCA\Social\Exceptions\RequestContentException;
use OCA\Social\Exceptions\RequestNetworkException;
-use OCA\Social\Exceptions\RequestResultNotJsonException;
use OCA\Social\Exceptions\RequestResultSizeException;
use OCA\Social\Exceptions\RequestServerException;
use OCA\Social\Exceptions\SocialAppConfigException;
@@ -52,7 +51,7 @@ class PostService {
private $noteService;
/** @var AccountService */
- private $actorService;
+ private $accountService;
/** @var ActivityService */
private $activityService;
@@ -65,16 +64,16 @@ class PostService {
* PostService constructor.
*
* @param NoteService $noteService
- * @param AccountService $actorService
+ * @param AccountService $accountService
* @param ActivityService $activityService
* @param MiscService $miscService
*/
public function __construct(
- NoteService $noteService, AccountService $actorService, ActivityService $activityService,
+ NoteService $noteService, AccountService $accountService, ActivityService $activityService,
MiscService $miscService
) {
$this->noteService = $noteService;
- $this->actorService = $actorService;
+ $this->accountService = $accountService;
$this->activityService = $activityService;
$this->miscService = $miscService;
}
@@ -93,7 +92,6 @@ class PostService {
* @throws RedundancyLimitException
* @throws RequestContentException
* @throws RequestNetworkException
- * @throws RequestResultNotJsonException
* @throws RequestResultSizeException
* @throws RequestServerException
* @throws MalformedArrayException
@@ -107,7 +105,10 @@ class PostService {
$this->noteService->replyTo($note, $post->getReplyTo());
$this->noteService->addRecipients($note, $post->getType(), $post->getTo());
- return $this->activityService->createActivity($post->getActor(), $note, $activity);
+ $result = $this->activityService->createActivity($post->getActor(), $note, $activity);
+ $this->accountService->cacheLocalActorDetailCount($post->getActor());
+
+ return $result;
}