Skip to content

Commit

Permalink
add option to filter out hidden in list shares
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <[email protected]>
  • Loading branch information
dragonchaser committed Sep 25, 2023
1 parent c9a314f commit 10a931c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,8 @@ func (h *Handler) listSharesWithMe(w http.ResponseWriter, r *http.Request) {
// which pending state to list
stateFilter := getStateFilter(r.FormValue("state"))

showHidden, _ := strconv.ParseBool(r.URL.Query().Get("show_hidden"))

ctx := r.Context()
p := r.URL.Query().Get("path")
shareRef := r.URL.Query().Get("share_ref")
Expand Down Expand Up @@ -950,6 +952,9 @@ func (h *Handler) listSharesWithMe(w http.ResponseWriter, r *http.Request) {

// TODO(refs) filter out "invalid" shares
for _, rs := range lrsRes.GetShares() {
if rs.Share.Hide && !showHidden {
continue
}
if stateFilter != ocsStateUnknown && rs.GetState() != stateFilter {
continue
}
Expand Down

0 comments on commit 10a931c

Please sign in to comment.