/** * Correct the parent folders' ETags for all users shared the file at $target * * @param string $target */ public static function correctFolders($target) { // ignore part files if (pathinfo($target, PATHINFO_EXTENSION) === 'part') { return false; } // Correct Shared folders of other users shared with $shares = \OCA\Files_Sharing\Helper::getSharesFromItem($target); foreach ($shares as $share) { if ((int) $share['share_type'] === \OCP\Share::SHARE_TYPE_USER) { self::correctUsersFolder($share['share_with'], $share['file_target']); } elseif ((int) $share['share_type'] === \OCP\Share::SHARE_TYPE_GROUP) { $users = \OC_Group::usersInGroup($share['share_with']); foreach ($users as $user) { self::correctUsersFolder($user, $share['file_target']); } } else { //unique name for group share self::correctUsersFolder($share['share_with'], $share['file_target']); } } }