From 56a83e66cde5060aa1c344691b65acbc66d6e433 Mon Sep 17 00:00:00 2001 From: LucasGGamerM Date: Thu, 28 Sep 2023 08:31:21 -0300 Subject: [PATCH] feat(notifications): readd account card for follow notifications --- .../fragments/NotificationsListFragment.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java index fb4f12d3f..5c735c540 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java @@ -38,6 +38,7 @@ import org.parceler.Parcels; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -93,7 +94,7 @@ public class NotificationsListFragment extends BaseStatusListFragment items = new ArrayList<>(); items.add(titleItem); items.add(new AccountCardStatusDisplayItem(n.id, this, accountID, n.account, n)); @@ -134,6 +135,13 @@ public class NotificationsListFragment extends BaseStatusListFragment> result){ if(getActivity()==null) return; + + Set needRelationships=result.items.stream() + .filter(ntf->ntf.status==null && !relationships.containsKey(ntf.account.id)) + .map(ntf->ntf.account.id) + .collect(Collectors.toSet()); + loadRelationships(needRelationships); + maxID=result.maxID; onDataLoaded(result.items.stream().filter(n->n.type!=null).collect(Collectors.toList()), !result.items.isEmpty()); reloadingFromCache=false; @@ -143,6 +151,17 @@ public class NotificationsListFragment extends BaseStatusListFragment