From a15b03cedf5879c995a797a639148bdc8a4fba8a Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 2 Sep 2021 11:11:49 +0200 Subject: [PATCH] fix the storageid of shares --- .../owncloud/ocs/handlers/apps/sharing/shares/shares.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go index 31409e512d9..64757f37336 100644 --- a/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go +++ b/internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go @@ -56,6 +56,10 @@ import ( "github.com/pkg/errors" ) +const ( + storageIDPrefix string = "shared::" +) + // Handler implements the shares part of the ownCloud sharing API type Handler struct { gatewayAddr string @@ -732,7 +736,6 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf } s.MimeType = parsedMt // TODO STime: &types.Timestamp{Seconds: info.Mtime.Seconds, Nanos: info.Mtime.Nanos}, - s.StorageID = info.Id.StorageId + "!" + info.Id.OpaqueId // TODO Storage: int s.ItemSource = wrapResourceID(info.Id) s.FileSource = s.ItemSource @@ -742,6 +745,7 @@ func (h *Handler) addFileInfo(ctx context.Context, s *conversions.ShareData, inf s.FileTarget = path.Join(h.sharePrefix, path.Base(info.Path)) } s.Path = path.Join("/", path.Base(info.Path)) // TODO hm this might have to be relative to the users home ... depends on the webdav_namespace config + s.StorageID = storageIDPrefix + s.FileTarget // TODO FileParent: // item type s.ItemType = conversions.ResourceType(info.GetType()).String()