From 4b066a769f097be21ed783b0d1d93e454cbfeaa6 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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/http/services/owncloud/ocgraph/drives.go b/internal/http/services/owncloud/ocgraph/drives.go index c72ee3f693..3af162c12d 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{ @@ -146,10 +149,8 @@ func getDrivesForShares(ctx context.Context, gw gateway.GatewayAPIClient) ([]*li continue } - // 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{