Browse Source

Fix adding participants to file rooms

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/4324/head
Joas Schilling 5 years ago
parent
commit
1062736f6d
No known key found for this signature in database GPG Key ID: 7076EA9751AACDDA
  1. 10
      lib/Files/Listener.php

10
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,
]]);
}
}

Loading…
Cancel
Save