diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-09 16:33:17 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-02-10 08:40:45 +0100 |
commit | c769f5775d7356211ca461489ae7c19a0f47cf03 (patch) | |
tree | f286a4b88e260566217371d0288ee29e118591ef /apps/files_sharing/api/server2server.php | |
parent | 31cf3b8288583c8ea3f850286863070376304d54 (diff) | |
download | nextcloud-server-c769f5775d7356211ca461489ae7c19a0f47cf03.tar.gz nextcloud-server-c769f5775d7356211ca461489ae7c19a0f47cf03.zip |
Create the actions with the correct ID
Diffstat (limited to 'apps/files_sharing/api/server2server.php')
-rw-r--r-- | apps/files_sharing/api/server2server.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_sharing/api/server2server.php b/apps/files_sharing/api/server2server.php index e308c54c111..7e0505ae04a 100644 --- a/apps/files_sharing/api/server2server.php +++ b/apps/files_sharing/api/server2server.php @@ -81,6 +81,7 @@ class Server2Server { try { $externalManager->addShare($remote, $token, '', $name, $owner, false, $shareWith, $remoteId); + $shareId = \OC::$server->getDatabaseConnection()->lastInsertId('`*PREFIX*share_external`'); $user = $owner . '@' . $this->cleanupRemote($remote); @@ -95,17 +96,17 @@ class Server2Server { $notification->setApp('files_sharing') ->setUser($shareWith) ->setDateTime(new \DateTime()) - ->setObject('remote_share', $remoteId) + ->setObject('remote_share', $shareId) ->setSubject('remote_share', [$user, trim($name, '/')]); $declineAction = $notification->createAction(); $declineAction->setLabel('decline') - ->setLink($urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/' . $remoteId), 'DELETE'); + ->setLink($urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId), 'DELETE'); $notification->addAction($declineAction); $acceptAction = $notification->createAction(); $acceptAction->setLabel('accept') - ->setLink($urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/' . $remoteId), 'POST'); + ->setLink($urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId), 'POST'); $notification->addAction($acceptAction); $notificationManager->notify($notification); |