diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2019-01-02 22:31:25 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2019-02-05 15:10:24 -0100 |
commit | 01ed889984f710371e65132110fabda875a6f2ad (patch) | |
tree | 82fe5d7cc764395aa03aa6c35708706fe16f779f /lib/Command | |
parent | f5da0c0e7e9bb4bb23f390ca770036bd3f061818 (diff) |
adding hashtags on post creation
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib/Command')
-rw-r--r-- | lib/Command/NoteCreate.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Command/NoteCreate.php b/lib/Command/NoteCreate.php index 1d16de9d..96867c54 100644 --- a/lib/Command/NoteCreate.php +++ b/lib/Command/NoteCreate.php @@ -108,6 +108,10 @@ class NoteCreate extends Base { 'type', 'y', InputOption::VALUE_OPTIONAL, 'type: public (default), followers, unlisted, direct' ) + ->addOption( + 'hashtag', 'g', InputOption::VALUE_OPTIONAL, + 'hashtag, without the leading #' + ) ->addArgument('userid', InputArgument::REQUIRED, 'userId of the author') ->addArgument('content', InputArgument::REQUIRED, 'content of the post') ->setDescription('Create a new note'); @@ -125,6 +129,7 @@ class NoteCreate extends Base { $userId = $input->getArgument('userid'); $content = $input->getArgument('content'); $to = $input->getOption('to'); + $hashtag = $input->getOption('hashtag'); $replyTo = $input->getOption('replyTo'); $type = $input->getOption('type'); @@ -134,6 +139,7 @@ class NoteCreate extends Base { $post->setType(($type === null) ? '' : $type); $post->setReplyTo(($replyTo === null) ? '' : $replyTo); $post->addTo(($to === null) ? '' : $to); + $post->setHashtags(($hashtag === null) ? [] : [$hashtag]); $token = $this->postService->createPost($post, $activity); |