From 32bb3fac694a2ce6a0ec894988b1b9124b7384b6 Mon Sep 17 00:00:00 2001 From: Thiago 'Jedi' Abreu Date: Mon, 9 Jan 2023 06:23:14 -0300 Subject: [PATCH] Filter all status, even if filters are empty (#255) --- .../android/fragments/HomeTimelineFragment.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java index c002eebba..28910f192 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeTimelineFragment.java @@ -188,10 +188,8 @@ public class HomeTimelineFragment extends StatusListFragment{ result.get(result.size()-1).hasGapAfter=true; toAdd=result; } - List filters=AccountSessionManager.getInstance().getAccount(accountID).wordFilters.stream().filter(f->f.context.contains(Filter.FilterContext.HOME)).collect(Collectors.toList()); - if(!filters.isEmpty()){ - toAdd=toAdd.stream().filter(new StatusFilterPredicate(filters)).collect(Collectors.toList()); - } + StatusFilterPredicate filterPredicate=new StatusFilterPredicate(accountID, Filter.FilterContext.HOME); + toAdd=toAdd.stream().filter(filterPredicate).collect(Collectors.toList()); if(!toAdd.isEmpty()){ prependItems(toAdd, true); showNewPostsButton();