summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-07-10 12:10:36 +0200
committerJoas Schilling <coding@schilljs.com>2017-07-10 12:10:36 +0200
commitb69ddfba8be6938d85f4932cf9691f955105c4c5 (patch)
tree00d7b269b11d7d27f24cb41c2f64222d38e35758 /apps/federatedfilesharing
parentc7b28064e3c8335312a644b94ced602a9f0fea0f (diff)
downloadnextcloud-server-b69ddfba8be6938d85f4932cf9691f955105c4c5.tar.gz
nextcloud-server-b69ddfba8be6938d85f4932cf9691f955105c4c5.zip
Fix activity emails for accept/decline of remote shares
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/federatedfilesharing')
-rw-r--r--apps/federatedfilesharing/lib/Controller/RequestHandlerController.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
index 8a7a1188c28..09704047c7b 100644
--- a/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
+++ b/apps/federatedfilesharing/lib/Controller/RequestHandlerController.php
@@ -318,14 +318,15 @@ class RequestHandlerController extends OCSController {
}
protected function executeAcceptShare(Share\IShare $share) {
- list($file, $link) = $this->getFile($this->getCorrectUid($share), $share->getNode()->getId());
+ $fileId = (int) $share->getNode()->getId();
+ list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId);
$event = \OC::$server->getActivityManager()->generateEvent();
$event->setApp('files_sharing')
->setType('remote_share')
->setAffectedUser($this->getCorrectUid($share))
- ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_ACCEPTED, [$share->getSharedWith(), $file])
- ->setObject('files', (int)$share->getNode()->getId(), $file)
+ ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_ACCEPTED, [$share->getSharedWith(), [$fileId => $file]])
+ ->setObject('files', $fileId, $file)
->setLink($link);
\OC::$server->getActivityManager()->publish($event);
}
@@ -373,14 +374,15 @@ class RequestHandlerController extends OCSController {
*/
protected function executeDeclineShare(Share\IShare $share) {
$this->federatedShareProvider->removeShareFromTable($share);
- list($file, $link) = $this->getFile($this->getCorrectUid($share), $share->getNode()->getId());
+ $fileId = (int) $share->getNode()->getId();
+ list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId);
$event = \OC::$server->getActivityManager()->generateEvent();
$event->setApp('files_sharing')
->setType('remote_share')
->setAffectedUser($this->getCorrectUid($share))
- ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_DECLINED, [$share->getSharedWith(), $file])
- ->setObject('files', (int)$share->getNode()->getId(), $file)
+ ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_DECLINED, [$share->getSharedWith(), [$fileId => $file]])
+ ->setObject('files', $fileId, $file)
->setLink($link);
\OC::$server->getActivityManager()->publish($event);