From 2e7977fc62567a8f358ab1404944c99ed6e726cd Mon Sep 17 00:00:00 2001 From: Gianmaria Del Monte Date: Fri, 1 Dec 2023 14:30:32 +0100 Subject: [PATCH] filter out rejected shares from spaces --- internal/http/services/owncloud/ocgraph/drives.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/http/services/owncloud/ocgraph/drives.go b/internal/http/services/owncloud/ocgraph/drives.go index c72ee3f6937..a37f58bfe71 100644 --- a/internal/http/services/owncloud/ocgraph/drives.go +++ b/internal/http/services/owncloud/ocgraph/drives.go @@ -132,6 +132,9 @@ func getDrivesForShares(ctx context.Context, gw gateway.GatewayAPIClient) ([]*li spacesRes := make([]*libregraph.Drive, 0, len(res.Shares)) for _, s := range res.Shares { + if s.State == collaborationv1beta1.ShareState_SHARE_STATE_REJECTED || s.State == collaborationv1beta1.ShareState_SHARE_STATE_INVALID { + continue + } share := s.Share stat, err := gw.Stat(ctx, &providerpb.StatRequest{ Ref: &providerpb.Reference{ @@ -149,7 +152,7 @@ func getDrivesForShares(ctx context.Context, gw gateway.GatewayAPIClient) ([]*li // TODO (gdelmont): filter out the rejected shares // the prefix of the remote_item.id and rootid - idPrefix := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s", stat.Info.Path))) + idPrefix := base64.StdEncoding.EncodeToString([]byte(stat.Info.Path)) resourceIdEnc := base64.StdEncoding.EncodeToString([]byte(resourceid.OwnCloudResourceIDWrap(stat.Info.Id))) space := &libregraph.Drive{