diff --git a/lib/dav/davProperties.ts b/lib/dav/davProperties.ts index 61918567..ac7b830e 100644 --- a/lib/dav/davProperties.ts +++ b/lib/dav/davProperties.ts @@ -3,6 +3,7 @@ * SPDX-License-Identifier: AGPL-3.0-or-later */ import { getCurrentUser } from '@nextcloud/auth' +import { getCapabilities } from '@nextcloud/capabilities' import logger from '../utils/logger' export type DavProperty = { [key: string]: string } @@ -147,6 +148,9 @@ export const getFavoritesReport = function(): string { * ``` */ export const getRecentSearch = function(lastModified: number, limit: number = 100): string { + const capabilities = getCapabilities() as { dav?: { search_supports_upload_time?: boolean } } + const supportsUploadTime = capabilities.dav?.search_supports_upload_time + return ` @@ -180,12 +184,31 @@ export const getRecentSearch = function(lastModified: number, limit: number = 10 0 - - - - - ${lastModified} - + ${supportsUploadTime + ? ` + + + + + + ${lastModified} + + + + + + ${lastModified} + + + ` + : ` + + + + + ${lastModified} + + `}