Skip to content

Commit

Permalink
Support card previews
Browse files Browse the repository at this point in the history
  • Loading branch information
zedeus committed Nov 9, 2020
1 parent ed91133 commit af63423
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/routes/status.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit af63423

Please sign in to comment.