summaryrefslogtreecommitdiffstats
path: root/lib/Command
diff options
context:
space:
mode:
authorMaxence Lange <maxence@artificial-owl.com>2018-10-01 14:14:23 +0200
committerMaxence Lange <maxence@artificial-owl.com>2018-10-01 14:14:23 +0200
commit4dddda0dc6db5535f4d6427c7e0bb62832e942db (patch)
tree132719cb0c6178da10fca90b23d3bc92d7dc4c57 /lib/Command
parent3e399899ed7d5d9a30e7ec60f7d5406b81299b7e (diff)
social is now an activitypub server
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Command')
-rw-r--r--lib/Command/NoteCreate.php16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/Command/NoteCreate.php b/lib/Command/NoteCreate.php
index 48c1193f..7e2b23db 100644
--- a/lib/Command/NoteCreate.php
+++ b/lib/Command/NoteCreate.php
@@ -32,6 +32,7 @@ namespace OCA\Social\Command;
use Exception;
use OC\Core\Command\Base;
+use OCA\Social\Model\InstancePath;
use OCA\Social\Service\ActivityPub\NoteService;
use OCA\Social\Service\ActivityPubService;
use OCA\Social\Service\ActorService;
@@ -66,7 +67,7 @@ class NoteCreate extends Base {
/**
- * Index constructor.
+ * NoteCreate constructor.
*
* @param ActivityPubService $activityPubService
* @param ActorService $actorService
@@ -122,21 +123,14 @@ class NoteCreate extends Base {
$to = $input->getOption('to');
$replyTo = $input->getOption('replyTo');
- $note = $this->noteService->generateNote($userId, $content, ActivityPubService::TO_PUBLIC);
+ $note = $this->noteService->generateNote($userId, $content);
if ($to !== null) {
- $note->setTo($to);
- $note->addTag(
- [
- 'type' => 'Mention',
- 'href' => $to
- ]
- );
+ $this->noteService->assignTo($note, $to, InstancePath::INBOX);
}
-
if ($replyTo !== null) {
- $note->setInReplyTo($replyTo);
+ $this->noteService->replyTo($note, $replyTo);
}
$result = $this->activityPubService->createActivity($userId, $note, $activity);