mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-04-23 20:49:13 -05:00
feat: add remote item id to search report responses
Adds the remote item id to search `REPORT` responses for shared resources and resources that are part of such. This id represents the id of the original resource that has been shared (= the remote item) and is needed for clients to correctly resolve their locations.
This commit is contained in:
@@ -185,6 +185,11 @@ func matchToPropResponse(ctx context.Context, match *searchmsg.Match) (*propfind
|
||||
if match.Entity.Ref.ResourceId.StorageId == utils.ShareStorageProviderID {
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:shareid", match.Entity.Ref.ResourceId.OpaqueId))
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:shareroot", match.Entity.ShareRootName))
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:remote-item-id", storagespace.FormatResourceID(provider.ResourceId{
|
||||
StorageId: match.Entity.RemoteItemId.StorageId,
|
||||
SpaceId: match.Entity.RemoteItemId.SpaceId,
|
||||
OpaqueId: match.Entity.RemoteItemId.OpaqueId,
|
||||
})))
|
||||
}
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("oc:name", match.Entity.Name))
|
||||
propstatOK.Prop = append(propstatOK.Prop, prop.Escaped("d:getlastmodified", match.Entity.LastModifiedTime.AsTime().Format(time.RFC3339)))
|
||||
|
||||
Reference in New Issue
Block a user