Merge pull request #677 from tinsukE/gap-local-filter

When loading gap posts, apply filters before building display items.
This commit is contained in:
Gregory K 2023-08-31 15:06:07 +03:00 committed by GitHub
commit 5f6f3c94c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -270,6 +270,7 @@ public class HomeTimelineFragment extends StatusListFragment{
}else{
result=result.subList(0, endIndex);
}
AccountSessionManager.get(accountID).filterStatuses(result, FilterContext.HOME);
List<StatusDisplayItem> targetList=displayItems.subList(gapPos, gapPos+1);
targetList.clear();
List<Status> insertedPosts=data.subList(gapPostIndex+1, gapPostIndex+1);
@ -279,7 +280,6 @@ public class HomeTimelineFragment extends StatusListFragment{
targetList.addAll(buildDisplayItems(s));
insertedPosts.add(s);
}
AccountSessionManager.get(accountID).filterStatuses(insertedPosts, FilterContext.HOME);
if(targetList.isEmpty()){
// oops. We didn't add new posts, but at least we know there are none.
adapter.notifyItemRemoved(getMainAdapterOffset()+gapPos);