diff --git a/lib/Service/NotificationService.php b/lib/Service/NotificationService.php index ef0551a5e..7430d312a 100644 --- a/lib/Service/NotificationService.php +++ b/lib/Service/NotificationService.php @@ -104,13 +104,13 @@ public function notificationInvited(Member $member): void { ); $declineAction = $notification->createAction(); - $declineUrl = $this->linkToOCS('circles.Local.circleLeave', ['circleId' => $member->getCircleId()]); + $declineUrl = $this->urlGenerator->linkToOCSRouteAbsolute('circles.Local.circleLeave', ['circleId' => $member->getCircleId()]); $declineAction->setLabel('refuse') ->setLink($declineUrl, 'PUT'); $notification->addAction($declineAction); $acceptAction = $notification->createAction(); - $acceptUrl = $this->linkToOCS('circles.Local.circleJoin', ['circleId' => $member->getCircleId()]); + $acceptUrl = $this->urlGenerator->linkToOCSRouteAbsolute('circles.Local.circleJoin', ['circleId' => $member->getCircleId()]); $acceptAction->setLabel('accept') ->setLink($acceptUrl, 'PUT'); $notification->addAction($acceptAction); @@ -149,7 +149,7 @@ public function notificationRequested(Member $member): void { ); $declineAction = $notification->createAction(); - $declineUrl = $this->linkToOCS( + $declineUrl = $this->urlGenerator->linkToOCSRouteAbsolute( 'circles.Local.memberRemove', [ 'circleId' => $member->getCircleId(), @@ -161,7 +161,7 @@ public function notificationRequested(Member $member): void { $notification->addAction($declineAction); $acceptAction = $notification->createAction(); - $acceptUrl = $this->linkToOCS( + $acceptUrl = $this->urlGenerator->linkToOCSRouteAbsolute( 'circles.Local.memberConfirm', [ 'circleId' => $member->getCircleId(), @@ -216,19 +216,6 @@ private function createMemberNotification( return $notification; } - - /** - * @param string $route - * @param array $params - * - * @return string - */ - private function linkToOCS(string $route, array $params = []): string { - $absolute = $this->urlGenerator->linkToOCSRouteAbsolute($route, $params); - - return parse_url($absolute, PHP_URL_PATH); - } - public function markInvitationAsProcessed(Member $member): void { if ($member->getUserType() !== Member::TYPE_USER || !$member->isLocal()) { return;