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 <crichter@owncloud.com>
  • Loading branch information
dragonchaser committed Sep 25, 2023
1 parent c9a314f commit 042db3e
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"))

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

Check failure on line 866 in internal/http/services/owncloud/ocs/handlers/apps/sharing/shares/shares.go

View workflow job for this annotation

GitHub Actions / lint

var-naming: don't use underscores in Go names; var show_hidden should be showHidden (revive)

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 && !show_hidden {
continue
}
if stateFilter != ocsStateUnknown && rs.GetState() != stateFilter {
continue
}
Expand Down

0 comments on commit 042db3e

Please sign in to comment.