lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Ignore user filters per request

Open aeharding opened this issue 2 years ago • 1 comments

Requirements

  • [X] Is this a feature request? For questions or discussions use https://lemmy.ml/c/lemmy_support
  • [X] Did you check to see if this issue already exists?
  • [X] Is this only a feature request? Do not put multiple feature requests in one issue.
  • [X] Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.

Is your proposal related to a problem?

  • Apps may have their own implementations of "hide read posts" (for example, Voyager). These client side implementations may conflict with lemmy's implementation baked into the API based on user settings, confusing users
  • Apps may want to retrieve all posts ignoring any backend filters such as "hide read posts" setting for arbitrary requests: for example, to fetch posts in moderated sub, on users' profiles, for special apps, integrations and filters, etc.

Describe the solution you'd like.

Every endpoint where posts are retrieved, for example, getPosts, getPersonDetails etc, has a request parameter show.

  • (not present on request) - use user default, hide posts according to show_read_posts user setting etc - maintain current behavior
  • show: "all" Return all posts. Don't hide posts based on user settings.

This would be a backward compatible change. It would also be forward compatible, in case Lemmy adds additional backend user filters, for example "hide posts I've voted on".

Describe alternatives you've considered.

afaik there's not currently a good way around this.

  • You could fetch posts without being authenticated, but then you don't get my_vote, etc.
  • You could quickly turn the user setting off, make request for posts, then turn back on, but that's not ideal for obvious reasons
  • Apps could message user to turn the setting off for their account. But, they might prefer it to be on for using other clients like lemmy-ui.

Additional context

Reddit has something similar to overcome this problem-

https://www.reddit.com/dev/api/#listings

show - optional parameter; if all is passed, filters such as "hide links that I have voted on" will be disabled.

aeharding avatar Nov 01 '23 22:11 aeharding

Post view still has no per-request nsfw filter option

dullbananas avatar Jun 21 '24 21:06 dullbananas

Gotcha, in that case I'll add an override for that one.

dessalines avatar Jul 07 '24 15:07 dessalines