From af634231b92e835295398a6f968248b6e999dd35 Mon Sep 17 00:00:00 2001 From: Zed Date: Mon, 9 Nov 2020 21:20:33 +0100 Subject: [PATCH] Support card previews --- src/routes/status.nim | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/routes/status.nim b/src/routes/status.nim index 3acc28e..613573f 100644 --- a/src/routes/status.nim +++ b/src/routes/status.nim @@ -46,6 +46,12 @@ proc createStatusRouter*(cfg: Config) = elif conv.tweet.gif.isSome(): images = @[get(conv.tweet.gif).thumb] video = getPicUrl(get(conv.tweet.gif).url) + elif conv.tweet.card.isSome(): + let card = conv.tweet.card.get() + if card.image.len > 0: + images = @[card.image] + elif card.video.isSome(): + video = getVideoEmbed(cfg, parseInt(card.video.get().videoId)) let html = renderConversation(conv, prefs, getPath() & "#m") resp renderMain(html, request, cfg, prefs, title, desc, ogTitle,