lemmy
lemmy copied to clipboard
Make distinction between `CommentReplies` and `PostReplies` in `/api/v3/user/unread_count`
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?
In getting the unread_counts
for a user (the endpoints returns { replies: int, mentions: int, private_messages: int }
, see https://github.com/LemmyNet/lemmy/blob/1d38aad9d3d51ef606074d5b49a8030c49dd0e9e/crates/api/src/local_user/notifications/unread_count.rs#L23-L28), there's currently no distinction made between comment replies, and post replies (and are thus counted together).
Describe the solution you'd like.
It would be helpful to add a post_replies
property to the returned object that shows the count for the amount of unread post replies a user has.
Subsequently, this would alse mean that the replies
property only counts the current user's unread comment replies.
Describe alternatives you've considered.
Currently, for Voyager we're making the distinction after the data fetch, by iterating over all unread comments and determining whether a reply is to a comment or to a post, and tallying the unread amounts that way.
It would be far simpler to simply handle this on the BE, and add an additional count (and 'fix' the current replies
count) for just 'post' replies.
Additional context
No response
What's the value, or why does it matter to differentiate them?
It would entail adding a column to the comment_reply
table, but I don't see why you'd need to distinguish between them.