Minor fix to comment filters

This commit is contained in:
Balazs Toldi 2023-11-10 11:01:35 +01:00
parent 0b1171c5b2
commit ff3ccca3eb
No known key found for this signature in database
GPG Key ID: 6C7D440036F99D58

View File

@ -52,10 +52,11 @@ public class CommentFilter implements Parcelable {
};
public static boolean isCommentAllowed(Comment comment, CommentFilter commentFilter) {
if (commentFilter.maxVote > 0 && comment.getVoteType() + comment.getScore() > commentFilter.maxVote) {
int score = comment.getScore() + comment.getVoteType();
if (commentFilter.maxVote >= 0 && score > commentFilter.maxVote) {
return false;
}
if (commentFilter.minVote > 0 && comment.getVoteType() + comment.getScore() < commentFilter.minVote) {
if (commentFilter.minVote >= 0 && score < commentFilter.minVote) {
return false;
}
if (commentFilter.excludeStrings != null && !commentFilter.excludeStrings.equals("")) {