diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-17 16:26:02 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-06-29 15:50:19 +0200 |
commit | 31c20949b4132e0024446a30f0f3a423bf145906 (patch) | |
tree | 6ca750e4f06fcdf81c44a1eed49ade14556bbead /lib/Controller/PublicShareAuthController.php | |
parent | 49921c0ac1f03f500341cef48f13857e44bfd180 (diff) |
Introduce a RoomService to handle creation of Rooms
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller/PublicShareAuthController.php')
-rw-r--r-- | lib/Controller/PublicShareAuthController.php | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/Controller/PublicShareAuthController.php b/lib/Controller/PublicShareAuthController.php index ac89f226d..6b239e73d 100644 --- a/lib/Controller/PublicShareAuthController.php +++ b/lib/Controller/PublicShareAuthController.php @@ -24,8 +24,8 @@ declare(strict_types=1); namespace OCA\Talk\Controller; -use OCA\Talk\Manager; -use OCA\Talk\Participant; +use OCA\Talk\Room; +use OCA\Talk\Service\RoomService; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataResponse; use OCP\AppFramework\OCSController; @@ -45,8 +45,8 @@ class PublicShareAuthController extends OCSController { private $shareManager; /** @var IUserSession */ private $userSession; - /** @var Manager */ - private $manager; + /** @var RoomService */ + private $roomService; public function __construct( string $appName, @@ -54,13 +54,13 @@ class PublicShareAuthController extends OCSController { IUserManager $userManager, IShareManager $shareManager, IUserSession $userSession, - Manager $manager + RoomService $roomService ) { parent::__construct($appName, $request); $this->userManager = $userManager; $this->shareManager = $shareManager; $this->userSession = $userSession; - $this->manager = $manager; + $this->roomService = $roomService; } /** @@ -106,11 +106,7 @@ class PublicShareAuthController extends OCSController { } // Create the room - $room = $this->manager->createPublicRoom($roomName, 'share:password', $shareToken); - $room->addUsers([ - 'userId' => $sharerUser->getUID(), - 'participantType' => Participant::OWNER, - ]); + $room = $this->roomService->createConversation(Room::PUBLIC_CALL, $roomName, $sharerUser, 'share:password', $shareToken); $user = $this->userSession->getUser(); $userId = $user instanceof IUser ? $user->getUID() : ''; |