feat: add Misskey (misskey.io) fetch support

Fourth site adapter: POST /api/notes/show, renote-aware caption and
media normalization, DriveFile type → Illustration/Animated/Video.
Empty thumbnailUrl strings filtered out in thumbnail_for.
This commit is contained in:
2026-09-07 21:25:52 +08:00
parent 2f741e5f4b
commit 11c04b66dc
6 changed files with 441 additions and 9 deletions
+6 -1
View File
@@ -135,7 +135,12 @@ pub fn extract_urls(message: &Message) -> Vec<String> {
fn thumbnail_for(media: &Media) -> Option<String> {
let url = media.url();
if url.starts_with("http://") || url.starts_with("https://") {
media.thumbnail_url().map(str::to_string)
// An empty thumbnail string (misskey video/gif files without a
// thumbnailUrl) must not reach Telegram; let it generate its own.
media
.thumbnail_url()
.map(str::to_string)
.filter(|t| !t.is_empty())
} else {
None
}