diff --git a/lib/FilesHooks.php b/lib/FilesHooks.php index d51aa1ff9..5a550988f 100755 --- a/lib/FilesHooks.php +++ b/lib/FilesHooks.php @@ -353,7 +353,16 @@ public function fileMove($oldPath, $newPath) { $this->moveCase = false; return; } - $this->oldAccessList = $this->getUserPathsFromPath($this->oldParentPath, $this->oldParentOwner); + + $oldAccessList = $this->getUserPathsFromPath($this->oldParentPath, $this->oldParentOwner); + + // file can be shared using GroupFolders, including ACL check + if ($this->config->getSystemValueBool('activity_use_cached_mountpoints', false)) { + [, , $oldFileId] = $this->getSourcePathAndOwner($oldPath); + $oldAccessList['users'] = array_merge($oldAccessList['users'], $this->getAffectedUsersFromCachedMounts($oldFileId)); + } + + $this->oldAccessList = $oldAccessList; } @@ -414,6 +423,12 @@ protected function fileRenaming($oldPath, $newPath) { $this->generateRemoteActivity($renameRemotes, Files::TYPE_FILE_CHANGED, time(), $this->currentUser->getCloudId()); $affectedUsers = $accessList['users']; + + // file can be shared using GroupFolders, including ACL check + if ($this->config->getSystemValueBool('activity_use_cached_mountpoints', false)) { + $affectedUsers = array_merge($affectedUsers, $this->getAffectedUsersFromCachedMounts($fileId)); + } + [$filteredEmailUsers, $filteredNotificationUsers] = $this->getFileChangeActivitySettings($fileId, array_keys($affectedUsers)); foreach ($affectedUsers as $user => $path) { @@ -463,6 +478,12 @@ protected function fileMoving($oldPath, $newPath) { $affectedUsers = $accessList['users']; $oldUsers = $this->oldAccessList['users']; + // file can be shared using GroupFolders, including ACL check + if ($this->config->getSystemValueBool('activity_use_cached_mountpoints', false)) { + $this->userMountCache->clear(); // clear cache for new data + $affectedUsers = array_merge($affectedUsers, $this->getAffectedUsersFromCachedMounts($fileId)); + } + $beforeUsers = array_keys($oldUsers); $afterUsers = array_keys($affectedUsers);