|
|
|
@ -741,17 +741,18 @@ class SystemMessage implements IEventListener { |
|
|
|
if ($participant && $participant->getAttendee()->getActorType() === Attendee::ACTOR_USERS) { |
|
|
|
if ($share->getShareOwner() !== $participant->getAttendee()->getActorId()) { |
|
|
|
$userFolder = $this->rootFolder->getUserFolder($participant->getAttendee()->getActorId()); |
|
|
|
if ($userFolder instanceof Node) { |
|
|
|
$userNodes = $userFolder->getById($share->getNodeId()); |
|
|
|
if (!$userFolder instanceof Node) { |
|
|
|
throw new ShareNotFound(); |
|
|
|
} |
|
|
|
|
|
|
|
if (empty($userNodes)) { |
|
|
|
// FIXME This should be much more sensible, e.g.
|
|
|
|
// 1. Only be executed on "Waiting for new messages"
|
|
|
|
// 2. Once per request
|
|
|
|
\OC_Util::tearDownFS(); |
|
|
|
\OC_Util::setupFS($participant->getAttendee()->getActorId()); |
|
|
|
$userNodes = $userFolder->getById($share->getNodeId()); |
|
|
|
} |
|
|
|
$node = $userFolder->getFirstNodeById($share->getNodeId()); |
|
|
|
if (!$node instanceof Node) { |
|
|
|
// FIXME This should be much more sensible, e.g.
|
|
|
|
// 1. Only be executed on "Waiting for new messages"
|
|
|
|
// 2. Once per request
|
|
|
|
\OC_Util::tearDownFS(); |
|
|
|
\OC_Util::setupFS($participant->getAttendee()->getActorId()); |
|
|
|
$userNodes = $userFolder->getById($share->getNodeId()); |
|
|
|
|
|
|
|
if (empty($userNodes)) { |
|
|
|
throw new NotFoundException('File was not found'); |
|
|
|
@ -759,12 +760,13 @@ class SystemMessage implements IEventListener { |
|
|
|
|
|
|
|
/** @var Node $node */ |
|
|
|
$node = reset($userNodes); |
|
|
|
$fullPath = $node->getPath(); |
|
|
|
$pathSegments = explode('/', $fullPath, 4); |
|
|
|
$name = $node->getName(); |
|
|
|
$size = $node->getSize(); |
|
|
|
$path = $pathSegments[3] ?? $name; |
|
|
|
} |
|
|
|
|
|
|
|
$fullPath = $node->getPath(); |
|
|
|
$pathSegments = explode('/', $fullPath, 4); |
|
|
|
$name = $node->getName(); |
|
|
|
$size = $node->getSize(); |
|
|
|
$path = $pathSegments[3] ?? $name; |
|
|
|
} else { |
|
|
|
$node = $share->getNode(); |
|
|
|
$name = $node->getName(); |
|
|
|
|