-
-
Notifications
You must be signed in to change notification settings - Fork 886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding saved_only, liked_only, and disliked_only filters to search. #5034
Changes from 4 commits
601a0da
d2995d4
57045bb
7e07ea9
5ee6893
67f4d1c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -999,6 +999,18 @@ fn limit_expire_time(expires: DateTime<Utc>) -> LemmyResult<Option<DateTime<Utc> | |
} | ||
} | ||
|
||
#[tracing::instrument(skip_all)] | ||
pub fn check_conflicting_like_filters( | ||
liked_only: Option<bool>, | ||
disliked_only: Option<bool>, | ||
) -> LemmyResult<()> { | ||
if liked_only.unwrap_or_default() && disliked_only.unwrap_or_default() { | ||
Err(LemmyErrorType::ContradictingFilters)? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the question mark needed since we're returning an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked, and its necessary to convert from the LemmyErrorType to a LemmyError.
|
||
} else { | ||
Ok(()) | ||
} | ||
} | ||
|
||
pub async fn process_markdown( | ||
text: &str, | ||
slur_regex: &Option<Regex>, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disliked_only wasnt requested and I doubt that anyone would use it.