Handle withheld tweets (#429)

* Handle withheld tweets

* Fix format of parser.nim
This commit is contained in:
Vítor
2021-08-21 12:13:38 -03:00
committed by GitHub
parent 739eb12bed
commit cf47c1b8ad
5 changed files with 29 additions and 1 deletions

View File

@@ -226,6 +226,8 @@ proc renderQuote(quote: Tweet; prefs: Prefs; path: string): VNode =
tdiv(class="unavailable-quote"):
if quote.tombstone.len > 0:
text quote.tombstone
elif quote.text.len > 0:
text quote.text
else:
text "This tweet is unavailable"
@@ -278,9 +280,14 @@ proc renderTweet*(tweet: Tweet; prefs: Prefs; path: string; class=""; index=0;
tdiv(class="unavailable-box"):
if tweet.tombstone.len > 0:
text tweet.tombstone
elif tweet.text.len > 0:
text tweet.text
else:
text "This tweet is unavailable"
if tweet.quote.isSome:
renderQuote(tweet.quote.get(), prefs, path)
let fullTweet = tweet
var retweet: string
var tweet = fullTweet