diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2020-05-20 16:53:19 +0300 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2020-05-20 16:53:19 +0300 |
commit | 9b3b9da9deada742dbd433e2409d03e00f6463d9 (patch) | |
tree | 9d33c93b2283c4acf251eb7eb7454234f1757f78 /lib | |
parent | 576863a3a2d27739138f79f8586f6706502e2ef1 (diff) |
generate route to payload
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AppInfo/Application.php | 1 | ||||
-rw-r--r-- | lib/Service/SharingFrameService.php | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index fd3df98b..5e0fd201 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -50,7 +50,6 @@ class Application extends App { const APP_NAME = 'circles'; - const REMOTE_URL_PAYLOAD = '/index.php/apps/circles/v1/payload'; const TEST_URL_ASYNC = '/index.php/apps/circles/admin/testAsync'; const CLIENT_TIMEOUT = 3; diff --git a/lib/Service/SharingFrameService.php b/lib/Service/SharingFrameService.php index b9201ab2..5109a87e 100644 --- a/lib/Service/SharingFrameService.php +++ b/lib/Service/SharingFrameService.php @@ -43,6 +43,7 @@ use OCA\Circles\Model\Circle; use OCA\Circles\Model\FederatedLink; use OCA\Circles\Model\SharingFrame; use OCP\Http\Client\IClientService; +use OCP\IURLGenerator; use OCP\IUserSession; @@ -54,6 +55,9 @@ class SharingFrameService { /** @var IUserSession */ private $userSession; + /** @var IURLGenerator */ + private $urlGenerator; + /** @var ConfigService */ private $configService; @@ -83,6 +87,8 @@ class SharingFrameService { * SharingFrameService constructor. * * @param string $userId + * @param IUserSession $userSession + * @param IURLGenerator $urlGenerator * @param ConfigService $configService * @param SharingFrameRequest $sharingFrameRequest * @param CirclesRequest $circlesRequest @@ -95,6 +101,7 @@ class SharingFrameService { public function __construct( $userId, IUserSession $userSession, + IURLGenerator $urlGenerator, ConfigService $configService, SharingFrameRequest $sharingFrameRequest, CirclesRequest $circlesRequest, @@ -106,6 +113,7 @@ class SharingFrameService { ) { $this->userId = $userId; $this->userSession = $userSession; + $this->urlGenerator = $urlGenerator; $this->configService = $configService; $this->sharingFrameRequest = $sharingFrameRequest; $this->circlesRequest = $circlesRequest; @@ -324,7 +332,8 @@ class SharingFrameService { * @return string */ private function generatePayloadDeliveryURL($remote) { - return $this->configService->generateRemoteHost($remote) . Application::REMOTE_URL_PAYLOAD; + return $this->configService->generateRemoteHost($remote) . + $this->urlGenerator->linkToRoute('circles.Shares.initShareDelivery'); } @@ -366,7 +375,7 @@ class SharingFrameService { 'item' => json_encode($frame) ]; - foreach ($links AS $link) { + foreach ($links as $link) { $args['token'] = $link->getToken(true); $this->deliverSharingFrameToLink($link, $args); } |