lemmy icon indicating copy to clipboard operation
lemmy copied to clipboard

Include creator_mod bool in PostView and CommentView

Open EricBAndrews opened this issue 1 year ago • 2 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?

I'm one of the devs on Mlem, an iOS reader for Lemmy. We want to flair moderators in the main feed, but to do so with the current API would require us to make additional calls for every post to fetch community context and parse the mod list. Including this information in the original PostView response would let us reduce the load our app puts on instances.

Describe the solution you'd like.

Include a boolean creator_mod field in PostView and CommentView to indicate whether the creator is a moderator of the community the post or comment was made in.

Describe alternatives you've considered.

Making an additional call for every post to get the community information and parsing the mod status from there. We discarded this because of the load it would add to instances.

Additional context

No response

EricBAndrews avatar Jun 26 '23 01:06 EricBAndrews

Have you considered lazily caching the list of mods app-side for each community you encounter?

PawanHegde avatar Jun 27 '23 03:06 PawanHegde

I think #3066 would be the good way to do this; to allow moderators or admins to speak as such only when they need to.

PennyJim avatar Jul 09 '23 04:07 PennyJim