diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-22 12:35:28 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-10-30 12:38:09 +0300 |
commit | 542c3792207c5a70ccdefc80f882b23c660cc9d8 (patch) | |
tree | dfb6e8e633c30772e63dd55870f03a13b114c9f9 /lib/Manager.php | |
parent | b76b92fb931748326974e95fbfd329812cd42f49 (diff) |
Further adjustments in the RoomController
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Manager.php')
-rw-r--r-- | lib/Manager.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Manager.php b/lib/Manager.php index 5b3bdbbd2..6b4c23ecc 100644 --- a/lib/Manager.php +++ b/lib/Manager.php @@ -29,6 +29,7 @@ use OCA\Talk\Exceptions\ParticipantNotFoundException; use OCA\Talk\Exceptions\RoomNotFoundException; use OCA\Talk\Model\AttendeeMapper; use OCA\Talk\Model\SessionMapper; +use OCA\Talk\Service\ParticipantService; use OCP\AppFramework\Utility\ITimeFactory; use OCP\Comments\IComment; use OCP\Comments\ICommentsManager; @@ -57,6 +58,8 @@ class Manager { private $attendeeMapper; /** @var SessionMapper */ private $sessionMapper; + /** @var ParticipantService */ + private $participantService; /** @var ISecureRandom */ private $secureRandom; /** @var IUserManager */ @@ -79,6 +82,7 @@ class Manager { Config $talkConfig, AttendeeMapper $attendeeMapper, SessionMapper $sessionMapper, + ParticipantService $participantService, ISecureRandom $secureRandom, IUserManager $userManager, CommentsManager $commentsManager, @@ -92,6 +96,7 @@ class Manager { $this->talkConfig = $talkConfig; $this->attendeeMapper = $attendeeMapper; $this->sessionMapper = $sessionMapper; + $this->participantService = $participantService; $this->secureRandom = $secureRandom; $this->userManager = $userManager; $this->commentsManager = $commentsManager; @@ -650,8 +655,12 @@ class Manager { if ($row === false) { $room = $this->createRoom(Room::CHANGELOG_CONVERSATION, $userId); - $room->addUsers(['userId' => $userId]); $room->setReadOnly(Room::READ_ONLY); + + $this->participantService->addUsers($room,[[ + 'actorType' => 'users', + 'actorId' => $userId, + ]]); return $room; } @@ -660,7 +669,10 @@ class Manager { try { $room->getParticipant($userId); } catch (ParticipantNotFoundException $e) { - $room->addUsers(['userId' => $userId]); + $this->participantService->addUsers($room,[[ + 'actorType' => 'users', + 'actorId' => $userId, + ]]); } return $room; |