From 2df6d9ce600afb8281542a9e0368167aec7381ea Mon Sep 17 00:00:00 2001 From: Kaitlin Date: Thu, 23 May 2024 20:13:28 -0500 Subject: [PATCH] fix: make autoexpand content warning option also expand cws that start with re: or variations --- .../android/fragments/ThreadFragment.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java index e5b5cc9e31..55bc9db894 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java @@ -230,10 +230,13 @@ private void restoreStatusStates(List newData, Map oldDa s.filterRevealed = oldStatus.filterRevealed; } if (GlobalUserPreferences.autoRevealEqualSpoilers != AutoRevealMode.NEVER && - s.spoilerText != null && - s.spoilerText.equals(mainStatus.spoilerText)) { - if (GlobalUserPreferences.autoRevealEqualSpoilers == AutoRevealMode.DISCUSSIONS || Objects.equals(mainStatus.account.id, s.account.id)) { - s.spoilerRevealed = mainStatus.spoilerRevealed; + s.spoilerText != null){ + if (s.spoilerText.equals(mainStatus.spoilerText) || + (s.spoilerText.toLowerCase().startsWith("re: ") && + s.spoilerText.substring(4).equals(mainStatus.spoilerText))){ + if (GlobalUserPreferences.autoRevealEqualSpoilers == AutoRevealMode.DISCUSSIONS || Objects.equals(mainStatus.account.id, s.account.id)) { + s.spoilerRevealed = mainStatus.spoilerRevealed; + } } } }