Skip to content

Commit

Permalink
fix listing shares to multiple groups
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
  • Loading branch information
butonic committed Mar 21, 2023
1 parent 13f8b52 commit b13d312
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-listing-shares-to-multiple-groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix listing shares to multiple groups

Users can now see the shares to all groups they are a member of.

https://github.com/cs3org/reva/pull/3741
12 changes: 8 additions & 4 deletions pkg/share/manager/jsoncs3/jsoncs3.go
Original file line number Diff line number Diff line change
Expand Up @@ -716,17 +716,21 @@ func (m *Manager) ListReceivedShares(ctx context.Context, filters []*collaborati
for ssid, spaceShareIDs := range m.GroupReceivedCache.List(group) {
// add a pending entry, the state will be updated
// when reading the received shares below if they have already been accepted or denied
rs := receivedsharecache.Space{
Mtime: spaceShareIDs.Mtime,
States: make(map[string]*receivedsharecache.State, len(spaceShareIDs.IDs)),
var rs *receivedsharecache.Space
var ok bool
if rs, ok = ssids[ssid]; !ok {
rs = &receivedsharecache.Space{
Mtime: spaceShareIDs.Mtime,
States: make(map[string]*receivedsharecache.State, len(spaceShareIDs.IDs)),
}
ssids[ssid] = rs
}

for shareid := range spaceShareIDs.IDs {
rs.States[shareid] = &receivedsharecache.State{
State: collaboration.ShareState_SHARE_STATE_PENDING,
}
}
ssids[ssid] = &rs
}
}

Expand Down

0 comments on commit b13d312

Please sign in to comment.