diff --git a/src/main.rs b/src/main.rs index 808fec4..b9dad17 100644 --- a/src/main.rs +++ b/src/main.rs @@ -40,13 +40,14 @@ impl From for Markup { fn from(item: ScoredChatMessage) -> Markup { if let Some(mime_type) = &item.chat_message.mime_type { let message_file = item.chat_message.file.expect("No sticker file"); + let message_emoji = item.chat_message.sticker_emoji.expect("No sticker emoji"); let message_date = item.last_used; match mime_type.as_str() { "image/webp" => { return html! { .sticker { img loading="lazy" src=(message_file); - p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) } + p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) br; (message_emoji) } } }; } @@ -54,7 +55,7 @@ impl From for Markup { return html! { .sticker.animated { video loading="lazy" autoplay loop controls src=(message_file) {} - p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) } + p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) br; (message_emoji) } } } } @@ -62,7 +63,7 @@ impl From for Markup { return html! { .sticker.animated { tgs-player loading="lazy" autoplay loop controls src=(message_file) {} - p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) } + p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) br; (message_emoji) } } } } @@ -87,6 +88,7 @@ struct ChatMessage { pub media_type: Option, pub mime_type: Option, pub file: Option, + pub sticker_emoji: Option, pub date_unixtime: String, pub date: String }