I forgot this yesterday in discussions of a maths problem, and posted
an answer in cleartext. Happily, it wasn't a very hard problem. But it
would have been better if the default had been to repeat the spoiler
text from the parent post; I could always change it manually, but if I
don't want to think very hard, this would more likely be right.
let text = userids.map(|acct| format!("@{} ", acct)).collect();
+ // Set a default content warning of the same as the post we're
+ // replying to.
+ let content_warning = if !st.sensitive {
+ None
+ } else {
+ Some(st.spoiler_text.clone())
+ };
+
Ok(Post {
text,
m: PostMetadata {
in_reply_to_id: Some(id.to_owned()),
visibility: st.visibility, // match the existing vis
- content_warning: None,
+ content_warning,
language: default_language(&ac),
},
})