smokestack/main: format time

This commit is contained in:
Astro 2022-11-18 17:25:43 +01:00
parent f6ae6b42a2
commit dc7d208a8d
1 changed files with 8 additions and 1 deletions

View File

@ -80,8 +80,15 @@ fn language_colour(language: &str) -> Colour {
}
fn format_message(post: Post) -> Option<String> {
let time_str;
let time = if let Some(time) = post.timestamp() {
time_str = format!("{}", time.format("%H:%M:%S"));
&time_str
} else {
&post.created_at
};
let language = &post.language?;
let time = &post.created_at;
let display_name = &post.account.display_name;
let username = &post.account.username;
let host = post.account.host()?;