From: Simon Tatham Date: Sat, 20 Jan 2024 15:34:58 +0000 (+0000) Subject: Fix failure to update fave/boost flags on boosts. X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=d7e2f5121d9a2ebd67854cd6e934e8471bda7383;p=mastodonochrome.git Fix failure to update fave/boost flags on boosts. 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. --- diff --git a/TODO.md b/TODO.md index e555280..ed3e261 100644 --- 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` diff --git a/src/client.rs b/src/client.rs index 1444eae..8a9c9de 100644 --- a/src/client.rs +++ b/src/client.rs @@ -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); }