diff --git a/.env.example b/.env.example index fe6101d..852f23d 100644 --- a/.env.example +++ b/.env.example @@ -4,7 +4,7 @@ DIRECT_MEDIA_DOMAINS = "d.fxtwitter.com,dl.fxtwitter.com,d.twittpr.com,dl.twittp TEXT_ONLY_DOMAINS = "t.fxtwitter.com,t.twittpr.com,t.fixupx.com" INSTANT_VIEW_DOMAINS = "i.fxtwitter.com,i.twittpr.com,i.fixupx.com" GALLERY_DOMAINS = "g.fxtwitter.com,g.twittpr.com,g.fixupx.com" -FORCE_MOSAIC_DOMAINS = "m.fxtwitter.com,m.twittpr.com,m.fixupx.com" +NATIVE_MULTI_IMAGE_DOMAINS = "m.fxtwitter.com,m.twittpr.com,m.fixupx.com" MOSAIC_DOMAIN_LIST = "mosaic.fxtwitter.com" API_HOST_LIST = "api.fxtwitter.com,api-canary.fxtwitter.com" HOST_URL = "https://fxtwitter.com" diff --git a/esbuild.config.mjs b/esbuild.config.mjs index e8aab80..f169fe1 100644 --- a/esbuild.config.mjs +++ b/esbuild.config.mjs @@ -38,7 +38,7 @@ let envVariables = [ 'TEXT_ONLY_DOMAINS', 'INSTANT_VIEW_DOMAINS', 'GALLERY_DOMAINS', - 'FORCE_MOSAIC_DOMAINS', + 'NATIVE_MULTI_IMAGE_DOMAINS', 'HOST_URL', 'REDIRECT_URL', 'EMBED_URL', diff --git a/jestconfig.json b/jestconfig.json index 259c532..3e44124 100644 --- a/jestconfig.json +++ b/jestconfig.json @@ -8,7 +8,7 @@ "TEXT_ONLY_DOMAINS": "t.fxtwitter.com,t.twittpr.com,t.fixupx.com", "INSTANT_VIEW_DOMAINS": "i.fxtwitter.com,i.twittpr.com,i.fixupx.com", "GALLERY_DOMAINS": "g.fxtwitter.com,g.twittpr.com,g.fixupx.com", - "FORCE_MOSAIC_DOMAINS": "m.fxtwitter.com,m.twittpr.com,m.fixupx.com", + "NATIVE_MULTI_IMAGE_DOMAINS": "m.fxtwitter.com,m.twittpr.com,m.fixupx.com", "STANDARD_DOMAIN_LIST": "fxtwitter.com,fixupx.com,twittpr.com", "DIRECT_MEDIA_DOMAINS": "d.fxtwitter.com,dl.fxtwitter.com,d.fixupx.com,dl.fixupx.com", "MOSAIC_DOMAIN_LIST": "mosaic.fxtwitter.com", diff --git a/src/constants.ts b/src/constants.ts index b2aab2c..b157260 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -6,7 +6,7 @@ export const Constants = { TEXT_ONLY_DOMAINS: TEXT_ONLY_DOMAINS.split(','), INSTANT_VIEW_DOMAINS: INSTANT_VIEW_DOMAINS.split(','), GALLERY_DOMAINS: GALLERY_DOMAINS.split(','), - FORCE_MOSAIC_DOMAINS: FORCE_MOSAIC_DOMAINS.split(','), + NATIVE_MULTI_IMAGE_DOMAINS: NATIVE_MULTI_IMAGE_DOMAINS.split(','), MOSAIC_DOMAIN_LIST: MOSAIC_DOMAIN_LIST.split(','), API_HOST_LIST: API_HOST_LIST.split(','), HOST_URL: HOST_URL, diff --git a/src/embed/status.ts b/src/embed/status.ts index b8e3a75..b896ca4 100644 --- a/src/embed/status.ts +++ b/src/embed/status.ts @@ -291,7 +291,7 @@ export const handleStatus = async ( siteName = instructions.siteName; } } else if (media?.mosaic) { - if (experimentCheck(Experiment.DISCORD_NATIVE_MULTI_IMAGE, isDiscord) && !flags.forceMosaic) { + if (experimentCheck(Experiment.DISCORD_NATIVE_MULTI_IMAGE, isDiscord) && flags.nativeMultiImage) { const photos = status.media?.photos || []; photos.forEach(photo => { diff --git a/src/realms/twitter/routes/status.ts b/src/realms/twitter/routes/status.ts index d37818e..5fa6992 100644 --- a/src/realms/twitter/routes/status.ts +++ b/src/realms/twitter/routes/status.ts @@ -58,9 +58,9 @@ export const statusRequest = async (c: Context) => { } else if (Constants.GALLERY_DOMAINS.includes(url.hostname)) { console.log('Gallery embed request'); flags.gallery = true; - } else if (Constants.FORCE_MOSAIC_DOMAINS.includes(url.hostname)) { + } else if (Constants.NATIVE_MULTI_IMAGE_DOMAINS.includes(url.hostname)) { console.log('Force mosaic request'); - flags.forceMosaic = true; + flags.nativeMultiImage = true; } else if (prefix === 'dl' || prefix === 'dir') { console.log('Direct media request by path prefix'); flags.direct = true; diff --git a/src/types/env.d.ts b/src/types/env.d.ts index 38ef12c..b371448 100644 --- a/src/types/env.d.ts +++ b/src/types/env.d.ts @@ -4,7 +4,7 @@ declare const DIRECT_MEDIA_DOMAINS: string; declare const TEXT_ONLY_DOMAINS: string; declare const INSTANT_VIEW_DOMAINS: string; declare const GALLERY_DOMAINS: string; -declare const FORCE_MOSAIC_DOMAINS: string; +declare const NATIVE_MULTI_IMAGE_DOMAINS: string; declare const HOST_URL: string; declare const EMBED_URL: string; declare const REDIRECT_URL: string; diff --git a/src/types/types.d.ts b/src/types/types.d.ts index f7dc79f..10dec52 100644 --- a/src/types/types.d.ts +++ b/src/types/types.d.ts @@ -10,7 +10,7 @@ type InputFlags = { forceInstantView?: boolean; archive?: boolean; gallery?: boolean; - forceMosaic?: boolean; + nativeMultiImage?: boolean; }; interface StatusResponse {