File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 */
55
66import { getCurrentUser } from '@nextcloud/auth'
7+ import { getCapabilities } from '@nextcloud/capabilities'
78import { scopedGlobals } from '../globalScope.ts'
89import logger from '../utils/logger.ts'
910
@@ -140,9 +141,8 @@ export function getFavoritesReport(): string {
140141 * ```
141142 */
142143export function getRecentSearch ( timestamp : number ) : string {
143- const major = Number . parseInt ( ( window . OC ?. config ?. version ?? '0' ) . split ( '.' ) [ 0 ] )
144- const patch = Number . parseInt ( ( window . OC ?. config ?. version ?? '0' ) . split ( '.' ) [ 2 ] )
145- const supportsUploadTime = major > 33 || ( major === 33 && patch > 0 )
144+ const supportsCreationTime = getCapabilities ( ) . dav ?. search_supports_creation_time
145+ const supportsUploadTime = getCapabilities ( ) . dav ?. search_supports_upload_time
146146
147147 return `<?xml version="1.0" encoding="UTF-8"?>
148148<d:searchrequest ${ getDavNameSpaces ( ) }
@@ -151,6 +151,7 @@ export function getRecentSearch(timestamp: number): string {
151151 <d:select>
152152 <d:prop>
153153 ${ getDavProperties ( ) }
154+ ${ supportsCreationTime ? '<nc:creation_time/>' : '' }
154155 </d:prop>
155156 </d:select>
156157 <d:from>
You can’t perform that action at this time.
0 commit comments