feat(pref): add ability to hide NSFW content
This commit is contained in:
@@ -23,6 +23,7 @@ proc parseUser(js: JsonNode; id=""): User =
|
||||
media: js{"media_count"}.getInt,
|
||||
verifiedType: parseEnum[VerifiedType](js{"verified_type"}.getStr("None")),
|
||||
protected: js{"protected"}.getBool,
|
||||
sensitive: "sensitive" in js{"profile_interstitial_type"}.getStr("") or js{"possibly_sensitive"}.getBool,
|
||||
joinDate: js{"created_at"}.getTime
|
||||
)
|
||||
|
||||
@@ -225,6 +226,7 @@ proc parseTweet(js: JsonNode; jsCard: JsonNode = newJNull()): Tweet =
|
||||
text: js{"full_text"}.getStr,
|
||||
time: js{"created_at"}.getTime,
|
||||
hasThread: js{"self_thread"}.notNull,
|
||||
sensitive: js{"possibly_sensitive"}.getBool,
|
||||
available: true,
|
||||
user: User(id: js{"user_id_str"}.getStr),
|
||||
stats: TweetStats(
|
||||
|
||||
Reference in New Issue
Block a user