Skip to content

Commit

Permalink
filter out rejected shares from spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
gmgigi96 committed Dec 1, 2023
1 parent b74479e commit 4b066a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/http/services/owncloud/ocgraph/drives.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand Down

0 comments on commit 4b066a7

Please sign in to comment.