From 7b3b0a9a0c9fec39aa31f3885bd082340a51ecc3 Mon Sep 17 00:00:00 2001 From: Thomas Date: Wed, 29 Jun 2022 18:53:39 +0200 Subject: [PATCH] Fix #206 - Home cache not filtered --- .../app/fedilab/android/viewmodel/mastodon/TimelinesVM.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/TimelinesVM.java b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/TimelinesVM.java index a877e57ae..bf4fa1e62 100644 --- a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/TimelinesVM.java +++ b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/TimelinesVM.java @@ -451,8 +451,10 @@ public class TimelinesVM extends AndroidViewModel { Statuses statuses = null; try { statuses = statusCacheDAO.geStatuses(StatusCache.CacheEnum.HOME, instance, user_id, maxId, minId, sinceId); + if (statuses != null) { - statuses.statuses = SpannableHelper.convertStatus(getApplication().getApplicationContext(), statuses.statuses); + List filteredStatuses = TimelineHelper.filterStatus(getApplication().getApplicationContext(), statuses.statuses, TimelineHelper.FilterTimeLineType.HOME); + statuses.statuses = SpannableHelper.convertStatus(getApplication().getApplicationContext(), filteredStatuses); if (statuses.statuses != null && statuses.statuses.size() > 0) { statuses.pagination = new Pagination(); statuses.pagination.min_id = statuses.statuses.get(0).id;