Compare commits
No commits in common. "e1911be63c995479c625bb3f462c12dc434882fc" and "51f769690961208a86ea3b35fa0f6b176faa89ed" have entirely different histories.
e1911be63c
...
51f7696909
1 changed files with 3 additions and 5 deletions
|
@ -40,14 +40,13 @@ impl From<ScoredChatMessage> for Markup {
|
||||||
fn from(item: ScoredChatMessage) -> Markup {
|
fn from(item: ScoredChatMessage) -> Markup {
|
||||||
if let Some(mime_type) = &item.chat_message.mime_type {
|
if let Some(mime_type) = &item.chat_message.mime_type {
|
||||||
let message_file = item.chat_message.file.expect("No sticker file");
|
let message_file = item.chat_message.file.expect("No sticker file");
|
||||||
let message_emoji = item.chat_message.sticker_emoji.unwrap_or(String::from("No emote"));
|
|
||||||
let message_date = item.last_used;
|
let message_date = item.last_used;
|
||||||
match mime_type.as_str() {
|
match mime_type.as_str() {
|
||||||
"image/webp" => {
|
"image/webp" => {
|
||||||
return html! {
|
return html! {
|
||||||
.sticker {
|
.sticker {
|
||||||
img loading="lazy" src=(message_file);
|
img loading="lazy" src=(message_file);
|
||||||
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) br; (message_emoji) }
|
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -55,7 +54,7 @@ impl From<ScoredChatMessage> for Markup {
|
||||||
return html! {
|
return html! {
|
||||||
.sticker.animated {
|
.sticker.animated {
|
||||||
video loading="lazy" autoplay loop controls src=(message_file) {}
|
video loading="lazy" autoplay loop controls src=(message_file) {}
|
||||||
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) br; (message_emoji) }
|
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +62,7 @@ impl From<ScoredChatMessage> for Markup {
|
||||||
return html! {
|
return html! {
|
||||||
.sticker.animated {
|
.sticker.animated {
|
||||||
tgs-player loading="lazy" autoplay loop controls src=(message_file) {}
|
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")) br; (message_emoji) }
|
p { "Times used: " (item.times) br; (message_date.format("%Y-%m-%d %H:%M:%S")) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +87,6 @@ struct ChatMessage {
|
||||||
pub media_type: Option<MediaType>,
|
pub media_type: Option<MediaType>,
|
||||||
pub mime_type: Option<String>,
|
pub mime_type: Option<String>,
|
||||||
pub file: Option<String>,
|
pub file: Option<String>,
|
||||||
pub sticker_emoji: Option<String>,
|
|
||||||
pub date_unixtime: String,
|
pub date_unixtime: String,
|
||||||
pub date: String
|
pub date: String
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue