chiark / gitweb /
Fix failure to update fave/boost flags on boosts.
authorSimon Tatham <anakin@pobox.com>
Sat, 20 Jan 2024 15:34:58 +0000 (15:34 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 20 Jan 2024 15:34:58 +0000 (15:34 +0000)
When you faved/unfaved or boosted/unboosted a status that you yourself
saw via a boost, the actual operation was happening successfully, and
the updated version of the _boosted_ status was going into our
Client's cache - but re-retrieving the _boost itself_ didn't include
the updated copy of the contained original post.

TODO.md
src/client.rs

diff --git a/TODO.md b/TODO.md
index e555280d6f29cd75469a639e16270e5e90845ab8..ed3e261dc6b87b337de03b7d71bf96093b656553 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -1,9 +1,5 @@
 # Bugs
 
-When you favourite a post that you saw via a boost, the [F] doesn't
-appear. Presumably some confusion between the original status and the
-boosting status.
-
 Some state fails to be retained if you temporarily leave an activity
 via [ESC] and then return to it (say via [RET]). In the post-compose
 menu, the client panics because `TuiLogicalState::new_activity_state`
index 1444eae7d29e3feb78fc48f690798a75a49c510f..8a9c9de4fa0cb7ba296dd84048bc49286584d001 100644 (file)
@@ -747,6 +747,12 @@ impl Client {
                 // Ditto with the poll, if any
                 st.poll = Some(poll.clone());
             }
+            if let Some(reblog_id) = st.reblog.clone().map(|st| st.id) {
+                if let Ok(reblog_st) = self.status_by_id(&reblog_id) {
+                    // Update the reblogged status with the latest version too
+                    st.reblog = Some(Box::new(reblog_st));
+                }
+            }
             return Ok(st);
         }