### Sensitive-content markers
-Currently we ignore whether a post is marked as sensitive: it doesn't
-show up at all in the UI.
-
-We should _at least_ display the sensitive-content tag, because it's
-not unheard of for people to use it as a post title, and write the
-rest of the toot in the assumption that you saw it, so that it might
-not even make sense without.
-
-Probably better to go all the way, and actually hide the post until
-told otherwise.
+Currently we display sensitive-content tags, but then display the rest
+of the post anyway. It would be better to (at least have the option
+to) hide the post and then be able to show it on demand.
+
+This will probably involve some kind of state object in File which
+maps post IDs to data about them that informs display. Once we have
+that, it could also be used to make the handling of unsubmitted poll
+results less horrible.
### Scrolling to keep the selection in view
via: Option<UsernameHeader>,
irt: Option<InReplyToLine>,
vis: Option<VisibilityLine>,
+ warning: Option<Paragraph>,
content: Html,
media: Vec<Media>,
poll: Option<Poll>,
vis => Some(VisibilityLine::new(vis)),
};
+ let warning = if st.sensitive {
+ let mut para = Paragraph::new();
+ para = para.add(&ColouredString::uniform("Content note:", 'r'));
+ para.end_word();
+ para = para.add(&ColouredString::plain(&st.spoiler_text));
+ Some(para)
+ } else {
+ None
+ };
+
let content = Html::new(&st.content);
let media = st.media_attachments.iter().map(|m| {
via,
irt,
vis,
+ warning,
content,
media,
poll,
push_fragment(&mut lines, self.vis.render(width));
push_fragment(&mut lines, self.irt.render(width));
push_fragment(&mut lines, self.blank.render(width));
+ push_fragment_opt_highlight(&mut lines, self.warning.render(width));
let rendered_content = self.content.render(width);
let content_empty = rendered_content.is_empty();
push_fragment_opt_highlight(&mut lines, rendered_content);