fix "show replies/boosts" filter not applied
closes sk22#566
This commit is contained in:
@@ -48,11 +48,13 @@ public class HomeTimelineFragment extends StatusListFragment {
|
|||||||
loadData();
|
loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean typeFilterPredicate(Status s) {
|
||||||
|
return (GlobalUserPreferences.showReplies || s.inReplyToId == null) &&
|
||||||
|
(GlobalUserPreferences.showBoosts || s.reblog == null);
|
||||||
|
}
|
||||||
|
|
||||||
private List<Status> filterPosts(List<Status> items) {
|
private List<Status> filterPosts(List<Status> items) {
|
||||||
return items.stream().filter(i ->
|
return items.stream().filter(this::typeFilterPredicate).collect(Collectors.toList());
|
||||||
(GlobalUserPreferences.showReplies || i.inReplyToId == null) &&
|
|
||||||
(GlobalUserPreferences.showBoosts || i.reblog == null)
|
|
||||||
).collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -232,7 +234,7 @@ public class HomeTimelineFragment extends StatusListFragment {
|
|||||||
for(Status s:result){
|
for(Status s:result){
|
||||||
if(idsBelowGap.contains(s.id))
|
if(idsBelowGap.contains(s.id))
|
||||||
break;
|
break;
|
||||||
if(filterPredicate.test(s)){
|
if(typeFilterPredicate(s) && filterPredicate.test(s)){
|
||||||
targetList.addAll(buildDisplayItems(s));
|
targetList.addAll(buildDisplayItems(s));
|
||||||
insertedPosts.add(s);
|
insertedPosts.add(s);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user