From b32fa07f9ca0c486379c2a493aac850d503fc698 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 21 Nov 2022 15:48:39 -0100 Subject: status creation from mastodon client Signed-off-by: Maxence Lange --- lib/Command/Timeline.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/Command') diff --git a/lib/Command/Timeline.php b/lib/Command/Timeline.php index b85f91ab..433118c2 100644 --- a/lib/Command/Timeline.php +++ b/lib/Command/Timeline.php @@ -91,6 +91,7 @@ class Timeline extends ExtendedBase { $this->setName('social:stream') ->addArgument('userId', InputArgument::REQUIRED, 'viewer') ->addArgument('timeline', InputArgument::REQUIRED, 'timeline') + ->addOption('local', '', InputOption::VALUE_NONE, 'public') ->addOption('count', '', InputOption::VALUE_REQUIRED, 'number of elements', '5') ->addOption('min_id', '', InputOption::VALUE_REQUIRED, 'min_id', 0) ->addOption('max_id', '', InputOption::VALUE_REQUIRED, 'max_id', 0) @@ -133,10 +134,12 @@ class Timeline extends ExtendedBase { ->setMaxId(intval($input->getOption('max_id'))); try { - $options->setTimeline($input->getArgument('timeline')); + if ($input->getOption('local')) { + $options->setLocal(true); + } + $options->setTimeline($timeline = $input->getArgument('timeline')); $this->outputStreams($this->streamRequest->getTimeline($options)); } catch (UnknownTimelineException $e) { - echo $input->getArgument('timeline'); $this->displayUnsupportedStream($options); } -- cgit v1.2.3 From 33080573fc555fd0b3410ef03e33191f2c65a9fa Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Mon, 21 Nov 2022 19:03:59 -0100 Subject: cs:fix Signed-off-by: Maxence Lange --- lib/Command/Fediverse.php | 4 ++-- lib/Command/MigrateAlpha3.php | 4 ++-- lib/Command/NoteCreate.php | 12 ++++++------ lib/Command/QueueStatus.php | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/Command') diff --git a/lib/Command/Fediverse.php b/lib/Command/Fediverse.php index 0a9e7535..e2801bbd 100644 --- a/lib/Command/Fediverse.php +++ b/lib/Command/Fediverse.php @@ -58,8 +58,8 @@ class Fediverse extends Base { parent::configure(); $this->setName('social:fediverse') ->addOption( - 'type', 't', InputArgument::OPTIONAL, - 'Change the type of access management', '' + 'type', 't', InputArgument::OPTIONAL, + 'Change the type of access management', '' ) ->addArgument('action', InputArgument::OPTIONAL, 'add/remove/test address', '') ->addArgument('address', InputArgument::OPTIONAL, 'address/host', '') diff --git a/lib/Command/MigrateAlpha3.php b/lib/Command/MigrateAlpha3.php index e8f9cbac..05774920 100644 --- a/lib/Command/MigrateAlpha3.php +++ b/lib/Command/MigrateAlpha3.php @@ -119,10 +119,10 @@ class MigrateAlpha3 extends Base { $this->setName('social:migrate:alpha3') ->setDescription('Trying to migrate old data to Alpha3') ->addOption( - 'remove-migrated-tables', '', InputOption::VALUE_NONE, 'Remove old table once copy is done' + 'remove-migrated-tables', '', InputOption::VALUE_NONE, 'Remove old table once copy is done' ) ->addOption( - 'force-remove-old-tables', '', InputOption::VALUE_NONE, 'Force remove old tables' + 'force-remove-old-tables', '', InputOption::VALUE_NONE, 'Force remove old tables' ); } diff --git a/lib/Command/NoteCreate.php b/lib/Command/NoteCreate.php index 2aed76e4..d5ea7827 100644 --- a/lib/Command/NoteCreate.php +++ b/lib/Command/NoteCreate.php @@ -96,18 +96,18 @@ class NoteCreate extends Base { parent::configure(); $this->setName('social:note:create') ->addOption( - 'replyTo', 'r', InputOption::VALUE_OPTIONAL, 'in reply to an existing thread' + 'replyTo', 'r', InputOption::VALUE_OPTIONAL, 'in reply to an existing thread' ) ->addOption( - 'to', 't', InputOption::VALUE_OPTIONAL, 'mentioning people' + 'to', 't', InputOption::VALUE_OPTIONAL, 'mentioning people' ) ->addOption( - 'type', 'y', InputOption::VALUE_OPTIONAL, - 'type: public (default), followers, unlisted, direct' + 'type', 'y', InputOption::VALUE_OPTIONAL, + 'type: public (default), followers, unlisted, direct' ) ->addOption( - 'hashtag', 'g', InputOption::VALUE_OPTIONAL, - 'hashtag, without the leading #' + 'hashtag', 'g', InputOption::VALUE_OPTIONAL, + 'hashtag, without the leading #' ) ->addArgument('user_id', InputArgument::REQUIRED, 'userId of the author') ->addArgument('content', InputArgument::REQUIRED, 'content of the post') diff --git a/lib/Command/QueueStatus.php b/lib/Command/QueueStatus.php index 3de1e7ba..2e2bbbc3 100644 --- a/lib/Command/QueueStatus.php +++ b/lib/Command/QueueStatus.php @@ -73,7 +73,7 @@ class QueueStatus extends Base { parent::configure(); $this->setName('social:queue:status') ->addOption( - 'token', 't', InputOption::VALUE_OPTIONAL, 'token of a request' + 'token', 't', InputOption::VALUE_OPTIONAL, 'token of a request' ) ->setDescription('Return status on the request queue'); } -- cgit v1.2.3