}
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);
}
*/
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);
];
case self::SUBJECT_REMOTE_SHARE_ACCEPTED:
case self::SUBJECT_REMOTE_SHARE_DECLINED:
+ $fileParameter = $parameters[1];
+ if (!is_array($fileParameter)) {
+ $fileParameter = [$event->getObjectId() => $event->getObjectName()];
+ }
return [
- 'file' => $this->getFile([$event->getObjectId() => $event->getObjectName()]),
+ 'file' => $this->getFile($fileParameter),
'user' => $this->getFederatedUser($parameters[0]),
];
}