From ccb34a769116c758550a82cd0a239219ce2e05ac Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Fri, 18 Aug 2023 03:16:33 -0400 Subject: [PATCH] Enable IV even for possible sensitive --- src/embed/status.ts | 4 +++- src/render/instantview.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/embed/status.ts b/src/embed/status.ts index 9e7381e..8a88a2f 100644 --- a/src/embed/status.ts +++ b/src/embed/status.ts @@ -35,8 +35,10 @@ export const handleStatus = async ( const api = await statusAPI(status, language, event as FetchEvent, flags); const tweet = api?.tweet as APITweet; + const isTelegram = (userAgent || '').indexOf('Telegram') > -1; - const useIV = isTelegram && tweet.is_note_tweet; //!tweet.possibly_sensitive && !flags?.direct && (tweet.media?.photos || tweet.media?.videos); + /* Should sensitive posts be allowed Instant View? */ + const useIV = isTelegram /*&& !tweet.possibly_sensitive*/ && !flags?.direct && !flags?.api && (tweet.media?.mosaic || tweet.is_note_tweet); let ivbody = ''; diff --git a/src/render/instantview.ts b/src/render/instantview.ts index 1e6c2a3..2dd7da1 100644 --- a/src/render/instantview.ts +++ b/src/render/instantview.ts @@ -76,7 +76,7 @@ export const renderInstantView = (properties: RenderProperties): ResponseInstruc

${tweet.author.name} (@${tweet.author.screen_name})

-

Instant View (✨ Beta)

+

Instant View (✨ Beta) - View original