Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Rudolf <github.com@daniel-rudolf.de>2020-05-21 12:14:58 +0300
committerDaniel Rudolf <github.com@daniel-rudolf.de>2020-05-21 12:14:58 +0300
commitac41ca22a310c341bbdd7ed79a6d9ea8f4b1c442 (patch)
tree3d662b35c1e4ee407f6df848abb450b490311e83 /lib
parentdd1e5c5be55eec1f43347ba065a3475cc5dd25b9 (diff)
Remove --circle options from talk:room:create and talk:room:add commands
See https://github.com/nextcloud/spreed/pull/3505#issuecomment-631969201 for a reasoning Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/Command/Room/Add.php10
-rw-r--r--lib/Command/Room/Create.php10
-rw-r--r--lib/Command/Room/TRoomCommand.php44
3 files changed, 0 insertions, 64 deletions
diff --git a/lib/Command/Room/Add.php b/lib/Command/Room/Add.php
index 0e63e7453..2b2a449b9 100644
--- a/lib/Command/Room/Add.php
+++ b/lib/Command/Room/Add.php
@@ -66,11 +66,6 @@ class Add extends Base {
null,
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
'Invites all members of the given groups to the room'
- )->addOption(
- 'circle',
- null,
- InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
- 'Invites all members of the given circles to the room'
);
}
@@ -78,7 +73,6 @@ class Add extends Base {
$token = $input->getArgument('token');
$users = $input->getOption('user');
$groups = $input->getOption('group');
- $circles = $input->getOption('circle');
try {
$room = $this->manager->getRoomByToken($token);
@@ -95,7 +89,6 @@ class Add extends Base {
try {
$this->addRoomParticipants($room, $users);
$this->addRoomParticipantsByGroup($room, $groups);
- $this->addRoomParticipantsByCircle($room, $circles);
} catch (InvalidArgumentException $e) {
$output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
return 1;
@@ -112,9 +105,6 @@ class Add extends Base {
case 'group':
return $this->completeGroupValues($context);
-
- case 'circle':
- return $this->completeCircleValues($context);
}
return parent::completeOptionValues($optionName, $context);
diff --git a/lib/Command/Room/Create.php b/lib/Command/Room/Create.php
index 2e9e3882a..c987e1211 100644
--- a/lib/Command/Room/Create.php
+++ b/lib/Command/Room/Create.php
@@ -65,11 +65,6 @@ class Create extends Base {
InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
'Invites all members of the given group to the room to create'
)->addOption(
- 'circle',
- null,
- InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY,
- 'Invites all members of the given circle to the room to create'
- )->addOption(
'public',
null,
InputOption::VALUE_NONE,
@@ -101,7 +96,6 @@ class Create extends Base {
$name = $input->getArgument('name');
$users = $input->getOption('user');
$groups = $input->getOption('group');
- $circles = $input->getOption('circle');
$public = $input->getOption('public');
$readonly = $input->getOption('readonly');
$password = $input->getOption('password');
@@ -125,7 +119,6 @@ class Create extends Base {
$this->addRoomParticipants($room, $users);
$this->addRoomParticipantsByGroup($room, $groups);
- $this->addRoomParticipantsByCircle($room, $circles);
$this->addRoomModerators($room, $moderators);
if ($owner !== null) {
@@ -150,9 +143,6 @@ class Create extends Base {
case 'group':
return $this->completeGroupValues($context);
- case 'circle':
- return $this->completeCircleValues($context);
-
case 'owner':
case 'moderator':
return $this->completeParticipantValues($context);
diff --git a/lib/Command/Room/TRoomCommand.php b/lib/Command/Room/TRoomCommand.php
index f2066a2e0..bffa4e5e6 100644
--- a/lib/Command/Room/TRoomCommand.php
+++ b/lib/Command/Room/TRoomCommand.php
@@ -26,8 +26,6 @@ declare(strict_types=1);
namespace OCA\Talk\Command\Room;
use InvalidArgumentException;
-use OCA\Circles\Api\v1\Circles;
-use OCA\Circles\Model\Member;
use OCA\Talk\Exceptions\ParticipantNotFoundException;
use OCA\Talk\Manager;
use OCA\Talk\Participant;
@@ -189,43 +187,6 @@ trait TRoomCommand {
/**
* @param Room $room
- * @param string[] $circleIds
- *
- * @throws InvalidArgumentException
- */
- protected function addRoomParticipantsByCircle(Room $room, array $circleIds): void {
- if (!$circleIds) {
- return;
- }
-
- if (!\OC::$server->getAppManager()->isEnabledForUser('circles')) {
- throw new InvalidArgumentException("App 'circles' is not enabled.");
- }
-
- $users = [];
- foreach ($circleIds as $circleId) {
- try {
- $circle = Circles::detailsCircle($circleId);
- } catch (\Exception $e) {
- throw new InvalidArgumentException(sprintf("Circle '%s' not found.", $circleId));
- }
-
- $circleUsers = array_filter($circle->getMembers(), function (Member $member) {
- if (($member->getType() !== Member::TYPE_USER) || ($member->getUserId() === '')) {
- return false;
- }
-
- return in_array($member->getStatus(), [Member::STATUS_INVITED, Member::STATUS_MEMBER], true);
- });
-
- $users = array_merge($users, $circleUsers);
- }
-
- $this->addRoomParticipants($room, $users);
- }
-
- /**
- * @param Room $room
* @param string[] $userIds
*
* @throws InvalidArgumentException
@@ -363,11 +324,6 @@ trait TRoomCommand {
}, $groupManager->search($context->getCurrentWord()));
}
- protected function completeCircleValues(CompletionContext $context): array {
- // TODO: implement me!
- return [];
- }
-
protected function completeParticipantValues(CompletionContext $context): array {
// TODO: implement me!
return [];