diff options
Diffstat (limited to 'lib/Command/Room')
-rw-r--r-- | lib/Command/Room/Create.php | 15 | ||||
-rw-r--r-- | lib/Command/Room/Update.php | 13 |
2 files changed, 25 insertions, 3 deletions
diff --git a/lib/Command/Room/Create.php b/lib/Command/Room/Create.php index eaaae0396..f241fe6b8 100644 --- a/lib/Command/Room/Create.php +++ b/lib/Command/Room/Create.php @@ -110,7 +110,12 @@ class Create extends Base { return 1; } - if (!in_array($listable, [null, '0', '1', '2', '3'], true)) { + if (!in_array($listable, [ + null, + (string)Room::LISTABLE_NONE, + (string)Room::LISTABLE_USERS, + (string)Room::LISTABLE_ALL, + ], true)) { $output->writeln('<error>Invalid value for option "--listable" given.</error>'); return 1; } @@ -167,6 +172,14 @@ class Create extends Base { case 'owner': case 'moderator': return $this->completeParticipantValues($context); + case 'readonly': + return ['1', '0']; + case 'listable': + return [ + (string)Room::LISTABLE_ALL, + (string)Room::LISTABLE_USERS, + (string)Room::LISTABLE_NONE, + ]; } return parent::completeOptionValues($optionName, $context); diff --git a/lib/Command/Room/Update.php b/lib/Command/Room/Update.php index af87053e5..037e7d59a 100644 --- a/lib/Command/Room/Update.php +++ b/lib/Command/Room/Update.php @@ -104,7 +104,12 @@ class Update extends Base { return 1; } - if (!in_array($listable, [null, '0', '1', '2', '3'], true)) { + if (!in_array($listable, [ + null, + (string)Room::LISTABLE_NONE, + (string)Room::LISTABLE_USERS, + (string)Room::LISTABLE_ALL, + ], true)) { $output->writeln('<error>Invalid value for option "--listable" given.</error>'); return 1; } @@ -168,7 +173,11 @@ class Update extends Base { case 'readonly': return ['1', '0']; case 'listable': - return ['2', '1', '0']; + return [ + (string)Room::LISTABLE_ALL, + (string)Room::LISTABLE_USERS, + (string)Room::LISTABLE_NONE, + ]; case 'owner': return $this->completeParticipantValues($context); |