From e8c9253a7628ac3d2941b48343e9e88531cbc7d4 Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 26 Oct 2023 18:32:46 +0200 Subject: [PATCH] don't remove gap when removing status re: sk22#898 --- .../java/org/joinmastodon/android/api/CacheController.java | 1 + .../org/joinmastodon/android/fragments/StatusListFragment.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java b/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java index 12725fe0c..6fd6478da 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java @@ -273,6 +273,7 @@ public class CacheController{ public void deleteStatus(String id){ runOnDbThread((db)->{ + // TODO: set previous status's hasGapAfter flag if the deleted status hasGapAfter db.delete("home_timeline", "`id`=?", new String[]{id}); }); } diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java index 2175c9abe..7bb00c27f 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/StatusListFragment.java @@ -25,6 +25,7 @@ import org.joinmastodon.android.model.Status; import org.joinmastodon.android.ui.displayitems.EmojiReactionsStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.ExtendedFooterStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.FooterStatusDisplayItem; +import org.joinmastodon.android.ui.displayitems.GapStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.StatusDisplayItem; import org.joinmastodon.android.ui.displayitems.TextStatusDisplayItem; import org.parceler.Parcels; @@ -216,7 +217,7 @@ public abstract class StatusListFragment extends BaseStatusListFragment StatusDisplayItem item=displayItems.get(i); // we found a status that the to-be-removed status replies to! // storing indices to maybe update its display items - if(item.parentID.equals(status.inReplyToId)){ + if(item.parentID.equals(status.inReplyToId) && !(item instanceof GapStatusDisplayItem)){ if(ancestorFirstIndex==-1) ancestorFirstIndex=i; ancestorLastIndex=i; }