Create the actions with the correct ID
This commit is contained in:
parent
31cf3b8288
commit
c769f5775d
|
@ -81,6 +81,7 @@ class Server2Server {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$externalManager->addShare($remote, $token, '', $name, $owner, false, $shareWith, $remoteId);
|
$externalManager->addShare($remote, $token, '', $name, $owner, false, $shareWith, $remoteId);
|
||||||
|
$shareId = \OC::$server->getDatabaseConnection()->lastInsertId('`*PREFIX*share_external`');
|
||||||
|
|
||||||
$user = $owner . '@' . $this->cleanupRemote($remote);
|
$user = $owner . '@' . $this->cleanupRemote($remote);
|
||||||
|
|
||||||
|
@ -95,17 +96,17 @@ class Server2Server {
|
||||||
$notification->setApp('files_sharing')
|
$notification->setApp('files_sharing')
|
||||||
->setUser($shareWith)
|
->setUser($shareWith)
|
||||||
->setDateTime(new \DateTime())
|
->setDateTime(new \DateTime())
|
||||||
->setObject('remote_share', $remoteId)
|
->setObject('remote_share', $shareId)
|
||||||
->setSubject('remote_share', [$user, trim($name, '/')]);
|
->setSubject('remote_share', [$user, trim($name, '/')]);
|
||||||
|
|
||||||
$declineAction = $notification->createAction();
|
$declineAction = $notification->createAction();
|
||||||
$declineAction->setLabel('decline')
|
$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);
|
$notification->addAction($declineAction);
|
||||||
|
|
||||||
$acceptAction = $notification->createAction();
|
$acceptAction = $notification->createAction();
|
||||||
$acceptAction->setLabel('accept')
|
$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);
|
$notification->addAction($acceptAction);
|
||||||
|
|
||||||
$notificationManager->notify($notification);
|
$notificationManager->notify($notification);
|
||||||
|
|
|
@ -194,7 +194,7 @@ class Manager {
|
||||||
|
|
||||||
\OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $share['remote']]);
|
\OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $share['remote']]);
|
||||||
|
|
||||||
$this->scrapNotification($share['remote_id']);
|
$this->scrapNotification($id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ class Manager {
|
||||||
$removeShare->execute(array($id, $this->uid));
|
$removeShare->execute(array($id, $this->uid));
|
||||||
$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline');
|
$this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline');
|
||||||
|
|
||||||
$this->scrapNotification($share['remote_id']);
|
$this->scrapNotification($id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue