*/ class BeforeRoomDeletedListener implements IEventListener { public function __construct( protected BackendNotifier $backendNotifier, protected ParticipantService $participantService, protected ICloudIdManager $cloudIdManager, ) { } #[\Override] public function handle(Event $event): void { if (!$event instanceof BeforeRoomDeletedEvent) { return; } $participants = $this->participantService->getParticipantsByActorType($event->getRoom(), Attendee::ACTOR_FEDERATED_USERS); foreach ($participants as $participant) { $cloudId = $this->cloudIdManager->resolveCloudId($participant->getAttendee()->getActorId()); $this->backendNotifier->sendRemoteUnShare( $cloudId->getRemote(), $participant->getAttendee()->getId(), $participant->getAttendee()->getAccessToken(), ); } } }