diff options
author | Joas Schilling <coding@schilljs.com> | 2021-05-27 16:32:17 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-08-24 17:55:33 +0300 |
commit | df185fba5f076c640e67524c5f19ee53a4a00cd9 (patch) | |
tree | 960b3ef011d4a63cd7b001b26a52b79f8b9f6156 /lib/Service | |
parent | 88934fa75b06b9806cc05e4bf21e28b412fb7d4a (diff) |
Start circle tracking support
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/ParticipantService.php | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index 673c1f157..25720ab61 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -433,7 +433,7 @@ class ParticipantService { * @param Participant[] $existingParticipants */ public function addCircle(Room $room, Circle $circle, array $existingParticipants = []): void { - $membersInCircle = $circle->getMembers(); + $membersInCircle = $circle->getMembers(); // FIXME getInheritatedMembers() if (empty($existingParticipants)) { $existingParticipants = $this->getParticipantsForRoom($room); @@ -481,22 +481,21 @@ class ParticipantService { ]; } - // No tracking of circles for now -// try { -// $this->attendeeMapper->findByActor($room->getId(), Attendee::ACTOR_CIRCLES, $circle->getSingleId()); -// } catch (DoesNotExistException $e) { -// $attendee = new Attendee(); -// $attendee->setRoomId($room->getId()); -// $attendee->setActorType(Attendee::ACTOR_CIRCLES); -// $attendee->setActorId($circle->getSingleId()); -// $attendee->setDisplayName($circle->getDisplayName()); -// $attendee->setParticipantType(Participant::USER); -// $attendee->setReadPrivacy(Participant::PRIVACY_PRIVATE); -// $this->attendeeMapper->insert($attendee); -// -// $attendeeEvent = new AttendeesAddedEvent($room, [$attendee]); -// $this->dispatcher->dispatchTyped($attendeeEvent); -// } + try { + $this->attendeeMapper->findByActor($room->getId(), Attendee::ACTOR_CIRCLES, $circle->getSingleId()); + } catch (DoesNotExistException $e) { + $attendee = new Attendee(); + $attendee->setRoomId($room->getId()); + $attendee->setActorType(Attendee::ACTOR_CIRCLES); + $attendee->setActorId($circle->getSingleId()); + $attendee->setDisplayName($circle->getDisplayName()); + $attendee->setParticipantType(Participant::USER); + $attendee->setReadPrivacy(Participant::PRIVACY_PRIVATE); + $this->attendeeMapper->insert($attendee); + + $attendeeEvent = new AttendeesAddedEvent($room, [$attendee]); + $this->dispatcher->dispatchTyped($attendeeEvent); + } $this->addUsers($room, $newParticipants); } |