File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,8 +141,9 @@ export function getFavoritesReport(): string {
141141 * ```
142142 */
143143export function getRecentSearch ( timestamp : number ) : string {
144- const capabilities = getCapabilities ( ) as { dav ?: { search_supports_upload_time ?: boolean } }
145- const supportsUploadTime = capabilities . dav ?. search_supports_upload_time
144+ const capabilities = getCapabilities ( ) as { dav ?: { search_supports_last_activity ?: boolean } }
145+ const supportsLastActivity = capabilities . dav ?. search_supports_last_activity
146+ const orderByProp = supportsLastActivity ? '<nc:last_activity/>' : '<d:getlastmodified/>'
146147
147148 return `<?xml version="1.0" encoding="UTF-8"?>
148149<d:searchrequest ${ getDavNameSpaces ( ) }
@@ -177,37 +178,12 @@ export function getRecentSearch(timestamp: number): string {
177178 <d:literal>0</d:literal>
178179 </d:eq>
179180 </d:or>
180- ${ supportsUploadTime
181- ? `
182- <d:or>
183- <d:gt>
184- <d:prop>
185- <d:getlastmodified/>
186- </d:prop>
187- <d:literal>${ timestamp } </d:literal>
188- </d:gt>
189- <d:gt>
190- <d:prop>
191- <nc:upload_time/>
192- </d:prop>
193- <d:literal>${ timestamp } </d:literal>
194- </d:gt>
195- </d:or>
196- `
197- : `
198- <d:gt>
199- <d:prop>
200- <d:getlastmodified/>
201- </d:prop>
202- <d:literal>${ timestamp } </d:literal>
203- </d:gt>
204- ` }
205181 </d:and>
206182 </d:where>
207183 <d:orderby>
208184 <d:order>
209185 <d:prop>
210- <d:getlastmodified/>
186+ ${ orderByProp }
211187 </d:prop>
212188 <d:descending/>
213189 </d:order>
You can’t perform that action at this time.
0 commit comments