Skip to content

Commit

Permalink
Merge pull request #3741 from butonic/fix-listing-shares-to-multiple-…
Browse files Browse the repository at this point in the history
…groups

Fix listing shares to multiple groups
  • Loading branch information
aduffeck authored Mar 21, 2023
2 parents 13f8b52 + b13d312 commit 390932a
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 390932a

Please sign in to comment.