diff options
author | Joas Schilling <coding@schilljs.com> | 2020-10-22 16:26:44 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-10-30 12:38:49 +0300 |
commit | 1062736f6d0cd35869d9844f5e7ada5c0cc10a1c (patch) | |
tree | eacdfcce3d9bb846fe9c2b0015a7ad78572030a8 /lib/Files | |
parent | c41b57ba60f8b4478c90fab618bf65d37cfc0492 (diff) |
Fix adding participants to file rooms
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Files')
-rw-r--r-- | lib/Files/Listener.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Files/Listener.php b/lib/Files/Listener.php index bcec71a98..64b2a82f2 100644 --- a/lib/Files/Listener.php +++ b/lib/Files/Listener.php @@ -29,6 +29,7 @@ use OCA\Talk\Events\JoinRoomUserEvent; use OCA\Talk\Exceptions\ParticipantNotFoundException; use OCA\Talk\Exceptions\UnauthorizedException; use OCA\Talk\Room; +use OCA\Talk\Service\ParticipantService; use OCA\Talk\TalkSession; use OCP\EventDispatcher\IEventDispatcher; @@ -52,12 +53,16 @@ class Listener { /** @var Util */ protected $util; + /** @var ParticipantService */ + protected $participantService; /** @var TalkSession */ protected $talkSession; public function __construct(Util $util, + ParticipantService $participantService, TalkSession $talkSession) { $this->util = $util; + $this->participantService = $participantService; $this->talkSession = $talkSession; } @@ -148,7 +153,10 @@ class Listener { try { $room->getParticipant($userId); } catch (ParticipantNotFoundException $e) { - $room->addUsers(['userId' => $userId]); + $this->participantService->addUsers($room, [[ + 'actorType' => 'users', + 'actorId' => $userId, + ]]); } } |