Skip to content

Adding ability to filter by notification creator.#6359

Merged
Nutomic merged 9 commits intomainfrom
private_messages_user_filter
Mar 2, 2026
Merged

Adding ability to filter by notification creator.#6359
Nutomic merged 9 commits intomainfrom
private_messages_user_filter

Conversation

@dessalines
Copy link
Copy Markdown
Member

- This makes a private message chat view possible, as well as showing
all notifs from a certain person.
- Fixes #6310
@dessalines dessalines marked this pull request as draft February 25, 2026 02:33
@dessalines dessalines marked this pull request as ready for review February 25, 2026 03:40
if let Some(creator_id) = self.creator_id {
query = query.filter(notification::creator_id.eq(creator_id));
}

Copy link
Copy Markdown
Member

@Nutomic Nutomic Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In ModlogView hide_mod_name() you also need to set creator_id: None.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's already handled in the map_to_enum function. The hide_mod_name function takes in the boolean and sets the moderator to None.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it sets the moderator to None, but right now you can get the moderator's PersonId from creator_id. So that also needs to be set None.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member Author

@dessalines dessalines Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That wasn't the place to do it (that function only returns Moderator, which was being set to None).

The only other place creator_id exists, is in notification.creator_id, and I think I got that now in the recent commit.

pub fn new_post(
post_id: PostId,
recipient_id: PersonId,
creator_id: PersonId,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easier to pass in &Post here then you can get both IDs out of it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same below for new_comment and new_mod_action.

@dessalines dessalines requested a review from Nutomic February 27, 2026 15:18
@Nutomic Nutomic merged commit 0e372e7 into main Mar 2, 2026
2 checks passed
@Nutomic Nutomic deleted the private_messages_user_filter branch March 2, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lemmy 1.0: Way to get private messages from a specific user

2 participants