A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.
fix(attachments): refresh signed links and limit custom CSS (#3761)
Hampuse58e750671c3
diff --git a/fluxer_admin/src/templates/pages/instance_branding.rs b/fluxer_admin/src/templates/pages/instance_branding.rsindex f42aef615..491660613 100644--- a/fluxer_admin/src/templates/pages/instance_branding.rs+++ b/fluxer_admin/src/templates/pages/instance_branding.rs@@ -116,7 +116,7 @@ pub(super) fn branding_section(div class="flex flex-col gap-2 border-t border-neutral-200 pt-6" {(custom_css_field(app_public.branding.custom_css.as_deref().unwrap_or("")))p class="text-xs leading-5 text-neutral-500" {- "Applies to every page of the web and desktop app, the sign-in pages included, for everyone on this instance. Each person's own theme and custom CSS load after it and can override it. Class names can change between releases, so prefer the color variables on :root."+ "Applies to the web and desktop app for everyone on this instance, except on sign-in pages and in security dialogs. The desktop app loads images and fonts for it only from this instance, Google Fonts and coolLabs Fonts. Each person's own theme and custom CSS load after it and can override it. Use the color variables on :root where you can, because class names can change between releases."}}div class="flex flex-col gap-2 border-t border-neutral-200 pt-6" {diff --git a/fluxer_admin/src/templates/pages/report_detail.rs b/fluxer_admin/src/templates/pages/report_detail.rsindex 0e0e92ff6..a86bbe81f 100644--- a/fluxer_admin/src/templates/pages/report_detail.rs+++ b/fluxer_admin/src/templates/pages/report_detail.rs@@ -1132,6 +1132,9 @@ fn message_context_section(div class="overflow-hidden rounded-lg border border-neutral-200 bg-white" {div class="px-4 pt-4 pb-2 sm:px-6 sm:pt-6" {h2 class="font-semibold text-base text-neutral-900" { "Message Context" }+ p class="mt-1 text-neutral-500 text-sm" {+ "Attachment links expire after 5 minutes. Reload the page for new ones."+ }}div class="py-2" {(message_list(diff --git a/fluxer_api/src/api/openapi/openapi.json b/fluxer_api/src/api/openapi/openapi.jsonindex 8bc4e4b58..ce0dcc201 100644--- a/fluxer_api/src/api/openapi/openapi.json+++ b/fluxer_api/src/api/openapi/openapi.json@@ -38321,7 +38321,7 @@"type": ["string", "null"]},"custom_css": {- "description": "Optional stylesheet a self-hosted instance applies to every page of its web and desktop app",+ "description": "Optional stylesheet a self-hosted instance applies to its web and desktop app, except on sign-in pages","type": ["string", "null"]},"upload_limit_message": {diff --git a/fluxer_api/src/api/rate_limit_configs/ChannelRateLimitConfig.ts b/fluxer_api/src/api/rate_limit_configs/ChannelRateLimitConfig.tsindex 9e5300a39..260db71e4 100644--- a/fluxer_api/src/api/rate_limit_configs/ChannelRateLimitConfig.ts+++ b/fluxer_api/src/api/rate_limit_configs/ChannelRateLimitConfig.ts@@ -70,7 +70,7 @@ export const ChannelRateLimitConfigs = {} as RouteRateLimitConfig,ATTACHMENT_URLS_REFRESH: {bucket: 'attachment:refresh_urls',- config: {limit: 20, windowMs: ms('10 seconds')},+ config: {limit: 60, windowMs: ms('10 seconds')},} as RouteRateLimitConfig,CHANNEL_TYPING: {bucket: 'channel:typing::channel_id',diff --git a/fluxer_api/src/api/unfurl/UnfurlController.ts b/fluxer_api/src/api/unfurl/UnfurlController.tsindex a860b49f6..01c773722 100644--- a/fluxer_api/src/api/unfurl/UnfurlController.ts+++ b/fluxer_api/src/api/unfurl/UnfurlController.ts@@ -1,5 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later+import {signAttachmentUrl} from '@app/api/attachment/AttachmentUrls';import {DefaultUserOnly, LoginRequired} from '@app/api/middleware/AuthMiddleware';import {RateLimitMiddleware} from '@app/api/middleware/RateLimitMiddleware';import {OpenAPI} from '@app/api/middleware/ResponseTypeMiddleware';@@ -7,8 +8,49 @@ import {getUnfurlerService} from '@app/api/middleware/ServiceSingletons';import {RateLimitConfigs} from '@app/api/RateLimitConfig';import type {HonoApp} from '@app/api/types/HonoEnv';import {Validator} from '@app/api/Validator';+import type {+ EmbedMediaResponse,+ MessageEmbedChildResponse,+ MessageEmbedResponse,+} from '@fluxer/schema/src/domains/message/EmbedSchemas';import {UnfurlRequest, UnfurlResponse} from '@fluxer/schema/src/domains/unfurl/UnfurlSchemas';+function signIfSet<T extends string | null | undefined>(url: T): T | string {+ return url ? signAttachmentUrl(url) : url;+}++function signMedia(media: EmbedMediaResponse | null | undefined) {+ return media && {...media, url: signAttachmentUrl(media.url), proxy_url: signIfSet(media.proxy_url)};+}++function signEmbedUrls(embed: MessageEmbedChildResponse): MessageEmbedChildResponse {+ const {author, provider, footer} = embed;+ return {+ ...embed,+ url: signIfSet(embed.url),+ author: author && {+ ...author,+ url: signIfSet(author.url),+ icon_url: signIfSet(author.icon_url),+ proxy_icon_url: signIfSet(author.proxy_icon_url),+ },+ provider: provider && {...provider, url: signIfSet(provider.url)},+ footer: footer && {+ ...footer,+ icon_url: signIfSet(footer.icon_url),+ proxy_icon_url: signIfSet(footer.proxy_icon_url),+ },+ image: signMedia(embed.image),+ thumbnail: signMedia(embed.thumbnail),+ video: signMedia(embed.video),+ audio: signMedia(embed.audio),+ };+}++function signEmbedTree(embed: MessageEmbedResponse): MessageEmbedResponse {+ return {...signEmbedUrls(embed), children: embed.children?.map(signEmbedUrls)};+}+export function UnfurlController(app: HonoApp) {app.post('/unfurl',@@ -28,7 +70,7 @@ export function UnfurlController(app: HonoApp) {async (ctx) => {const {url} = ctx.req.valid('json');const result = await getUnfurlerService().unfurlWithCachePolicy(url, 'block', {bypassCache: true});- return ctx.json(result.embeds);+ return ctx.json(result.embeds.map(signEmbedTree));},);}diff --git a/fluxer_app/package.json b/fluxer_app/package.jsonindex 329748ffb..5c7677755 100644--- a/fluxer_app/package.json+++ b/fluxer_app/package.json@@ -165,6 +165,7 @@"@codemirror/search": "^6.7.2","@codemirror/state": "^6.7.6","@codemirror/view": "^6.43.15",+ "@csstools/css-tokenizer": "4.0.2","@floating-ui/react": "catalog:","@floating-ui/react-dom": "catalog:","@fluxer/constants": "workspace:*",diff --git a/fluxer_app/src/app/App.tsx b/fluxer_app/src/app/App.tsxindex 9b33ca44c..ed4465562 100644--- a/fluxer_app/src/app/App.tsx+++ b/fluxer_app/src/app/App.tsx@@ -28,6 +28,7 @@ import {showMyselfTypingHelper} from '@app/features/devtools/utils/ShowMyselfTypimport GatewaySessions from '@app/features/gateway/transport/GatewaySessionPool';import {AppI18nProvider} from '@app/features/i18n/components/AppI18nProvider';import MemberSidebar from '@app/features/member/state/MemberSidebar';+import {parseEndpoint} from '@app/features/messaging/utils/AttachmentCdnUrl';import {attachExternalLinkInterceptor} from '@app/features/messaging/utils/ExternalLinkUtils';import {startDeepLinkHandling} from '@app/features/navigation/utils/DeepLinkUtils';import {Outlet, RouterProvider} from '@app/features/platform/components/router/RouterReact';@@ -41,6 +42,7 @@ import {QUICK_SWITCHER_PORTAL_ID} from '@app/features/search/components/quick_swimport {useCustomThemeStyle, useInstanceCustomCss} from '@app/features/theme/hooks/useCustomThemeStyle';import {useRemScaleTracking} from '@app/features/theme/hooks/useRemScaleTracking';import {useThemeCssVariables} from '@app/features/theme/hooks/useThemeCssVariables';+import CustomCssSuspension from '@app/features/theme/state/CustomCssSuspension';import Theme from '@app/features/theme/state/Theme';import ThemeLibrary from '@app/features/theme/state/ThemeLibrary';import ThemeProfile from '@app/features/theme/state/ThemeProfile';@@ -112,6 +114,19 @@ function getInstanceBrandStyle(): InstanceBrandStyle {return {themeColor: snapshot.appPublic.branding.theme_color, customCss: snapshot.appPublic.branding.custom_css};}+function getInstanceCssOrigins(): ReadonlyArray<string> | null {+ if (!isDesktop()) return null;+ const snapshot = RuntimeConfig.getSnapshotOrNull();+ if (snapshot === null) return [];+ const endpoints = [+ snapshot.mediaEndpoint,+ snapshot.staticCdnEndpoint,+ snapshot.apiPublicEndpoint,+ snapshot.webAppEndpoint,+ ];+ return endpoints.flatMap((endpoint) => parseEndpoint(endpoint)?.origin ?? []);+}+export const AppWrapper = observer(({children}: AppWrapperProps) => {const {i18n} = useLingui();const reducedMotion = Accessibility.useReducedMotion;@@ -211,16 +226,19 @@ export const AppWrapper = observer(({children}: AppWrapperProps) => {hdrDisplayMode: Accessibility.hdrDisplayMode,instanceThemeColor: instanceBrandStyle.themeColor,});- useInstanceCustomCss(instanceBrandStyle.customCss);- const userCssApplied = !isAuthLayout && !ThemeSettingsState.customCssOff;+ const customCssSuspended = isAuthLayout || CustomCssSuspension.active;+ useInstanceCustomCss(customCssSuspended ? null : instanceBrandStyle.customCss, getInstanceCssOrigins());+ const userCssApplied = !customCssSuspended && !ThemeSettingsState.customCssOff;useCustomThemeStyle({enabledThemeCss: userCssApplied ? ThemeProfile.activeThemeCss : null,customThemeCss: userCssApplied ? ThemeProfile.customThemeCss : null,themeLibraryAssets: ThemeLibrary.assets,themeLibraryLocalFiles: ThemeLibrary.localFiles,themeLibraryRevision: ThemeLibrary.revision,+ mediaEndpoint: RuntimeConfig.getSnapshotOrNull()?.mediaEndpoint ?? '',onMissingReferences: ThemeSettingsState.setMissingReferences,onBlockedUrl: ThemeSettingsState.recordBlockedUrl,+ onCssRejected: ThemeSettingsState.setCssRejected,});return (<LayoutVariantProvider value={layoutVariantContextValue} data-flx="app.app.app-wrapper.layout-variant-provider">diff --git a/fluxer_app/src/features/auth/components/accounts/account_switcher_modal/AccountSwitcherAuthFlow.tsx b/fluxer_app/src/features/auth/components/accounts/account_switcher_modal/AccountSwitcherAuthFlow.tsxindex 4675f95bb..b2cb04365 100644--- a/fluxer_app/src/features/auth/components/accounts/account_switcher_modal/AccountSwitcherAuthFlow.tsx+++ b/fluxer_app/src/features/auth/components/accounts/account_switcher_modal/AccountSwitcherAuthFlow.tsx@@ -34,6 +34,7 @@ import {CANCEL_DESCRIPTOR,SIGN_IN_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';+import {useCustomCssSuspension} from '@app/features/theme/state/CustomCssSuspension';import {flxElementClassName} from '@app/lib/react';import type {GuildSplashCardAlignmentValue} from '@fluxer/constants/src/GuildConstants';import {GuildSplashCardAlignment} from '@fluxer/constants/src/GuildConstants';@@ -134,6 +135,7 @@ export const AccountSwitcherAuthFlow = observer(function AccountSwitcherAuthFlowonExit,onLoginComplete,}: AccountSwitcherAuthFlowProps): React.ReactElement {+ useCustomCssSuspension();const {i18n} = useLingui();const [selectedAuthStep, setSelectedAuthStep] = useState<AccountSwitcherAuthStep>(AccountSwitcherAuthStep.LOGIN);const [, setCardVariant] = useState<AuthCardVariant>(AuthCardVariant.STANDARD);diff --git a/fluxer_app/src/features/auth/components/modals/BackupCodesViewModal.tsx b/fluxer_app/src/features/auth/components/modals/BackupCodesViewModal.tsxindex ab199667d..ef58829e1 100644--- a/fluxer_app/src/features/auth/components/modals/BackupCodesViewModal.tsx+++ b/fluxer_app/src/features/auth/components/modals/BackupCodesViewModal.tsx@@ -193,6 +193,7 @@ export const BackupCodesViewModal = observer(({user}: BackupCodesViewModalProps)label={i18n._(VERIFICATION_CODE_DESCRIPTOR)}placeholder="XXXX-XXXX"required={true}+ sensitiveerror={codeError ?? undefined}data-flx="auth.backup-codes-view-modal.input.set-code"/>diff --git a/fluxer_app/src/features/auth/components/modals/MfaTotpDisableModal.tsx b/fluxer_app/src/features/auth/components/modals/MfaTotpDisableModal.tsxindex e4a9c3d7b..a93d00ab0 100644--- a/fluxer_app/src/features/auth/components/modals/MfaTotpDisableModal.tsx+++ b/fluxer_app/src/features/auth/components/modals/MfaTotpDisableModal.tsx@@ -9,6 +9,7 @@ import {CODE_DESCRIPTOR,CONTINUE_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';+import {useCustomCssSuspension} from '@app/features/theme/state/CustomCssSuspension';import {Button} from '@app/features/ui/button/Button';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import * as ToastCommands from '@app/features/ui/commands/ToastCommands';@@ -41,6 +42,7 @@ interface FormInputs {}export const MfaTotpDisableModal = observer(() => {+ useCustomCssSuspension();const {i18n} = useLingui();const form = useForm<FormInputs>();const onSubmit = async (data: FormInputs) => {diff --git a/fluxer_app/src/features/auth/components/modals/MfaTotpEnableModal.tsx b/fluxer_app/src/features/auth/components/modals/MfaTotpEnableModal.tsxindex 85c705781..d84f67e87 100644--- a/fluxer_app/src/features/auth/components/modals/MfaTotpEnableModal.tsx+++ b/fluxer_app/src/features/auth/components/modals/MfaTotpEnableModal.tsx@@ -12,6 +12,7 @@ import {CODE_DESCRIPTOR,CONTINUE_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';+import {useCustomCssSuspension} from '@app/features/theme/state/CustomCssSuspension';import {Button} from '@app/features/ui/button/Button';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import {modal} from '@app/features/ui/commands/ModalCommands';@@ -63,6 +64,7 @@ interface MfaTotpEnableModalProps {}export const MfaTotpEnableModal = observer(({user}: MfaTotpEnableModalProps) => {+ useCustomCssSuspension();const {i18n} = useLingui();const form = useForm<FormInputs>();const [secret] = useState(() => MfaUtils.generateTotpSecret());diff --git a/fluxer_app/src/features/auth/components/modals/OAuthAuthorizeModal.tsx b/fluxer_app/src/features/auth/components/modals/OAuthAuthorizeModal.tsxindex 3a25b2863..535dbc9bc 100644--- a/fluxer_app/src/features/auth/components/modals/OAuthAuthorizeModal.tsx+++ b/fluxer_app/src/features/auth/components/modals/OAuthAuthorizeModal.tsx@@ -7,6 +7,7 @@ import {OAuthAuthorizeFlowPanel,} from '@app/features/auth/components/pages/oauth_authorize_page/OAuthAuthorizeFlowPanel';import {useAuthorizeFlow} from '@app/features/auth/components/pages/oauth_authorize_page/state/useAuthorizeFlow';+import {useCustomCssSuspension} from '@app/features/theme/state/CustomCssSuspension';import * as ModalCommands from '@app/features/ui/commands/ModalCommands';import {useLingui} from '@lingui/react/macro';import {observer} from 'mobx-react-lite';@@ -18,6 +19,7 @@ interface OAuthAuthorizeModalProps {}export const OAuthAuthorizeModal: React.FC<OAuthAuthorizeModalProps> = observer(({search}) => {+ useCustomCssSuspension();const {i18n} = useLingui();const flow = useAuthorizeFlow({search,diff --git a/fluxer_app/src/features/auth/components/modals/SudoVerificationModal.tsx b/fluxer_app/src/features/auth/components/modals/SudoVerificationModal.tsxindex 57fe363cf..b5d87cc8f 100644--- a/fluxer_app/src/features/auth/components/modals/SudoVerificationModal.tsx+++ b/fluxer_app/src/features/auth/components/modals/SudoVerificationModal.tsx@@ -29,6 +29,7 @@ import {import {http} from '@app/features/platform/transport/RestTransport';import {Platform} from '@app/features/platform/types/Platform';import {Logger} from '@app/features/platform/utils/AppLogger';+import {useCustomCssSuspension} from '@app/features/theme/state/CustomCssSuspension';import {Button} from '@app/features/ui/button/Button';import buttonStyles from '@app/features/ui/button/Button.module.css';import {Form} from '@app/features/ui/components/form/Form';@@ -129,6 +130,7 @@ const holdsPasskeyFor = (matches: (rpId: string) => boolean): boolean =>const holdsMigratedPasskey = (): boolean => holdsPasskeyFor((rpId) => rpId === PASSKEY_MIGRATION_RP_ID);const holdsLegacyPasskey = (): boolean => holdsPasskeyFor((rpId) => rpId !== PASSKEY_MIGRATION_RP_ID);const SudoVerificationModal: React.FC = observer(() => {+ useCustomCssSuspension();const {i18n} = useLingui();const {availableMethods, isVerifying, verificationFailed, rawError, lastUsedMfaMethod} = SudoPrompt;const form = useForm<FormInputs>({defaultValues: {password: '', totp: ''}});diff --git a/fluxer_app/src/features/channel/components/AutocompleteMemePreview.tsx b/fluxer_app/src/features/channel/components/AutocompleteMemePreview.tsxindex fc7f90f45..21d0fcda1 100644--- a/fluxer_app/src/features/channel/components/AutocompleteMemePreview.tsx+++ b/fluxer_app/src/features/channel/components/AutocompleteMemePreview.tsx@@ -22,7 +22,7 @@ const AutocompleteMemeVideo = ({src}: {src: string}) => {loopplaysInlinepreload="auto"- src={src}+ src={src || undefined}data-flx="channel.autocomplete-meme-preview.meme-video"/>);@@ -33,7 +33,7 @@ export const AutocompleteMemePreview = observer(({meme}: {meme: FavoriteMeme}) =const isVideoMeme = contentType.startsWith('video/');const isAnimatedImageMeme = !isVideoMeme && !isAudioMeme && contentType.includes('gif');const motionAllowed = useShouldAnimate({kind: 'gif', isAnimated: isVideoMeme || isAnimatedImageMeme});- const memeUrl = AttachmentUrlRefresher.fresh(meme.url, {refreshUnsigned: true});+ const memeUrl = AttachmentUrlRefresher.freshWhenReady(meme.url, {refreshUnsigned: true}) ?? '';if (isAudioMeme) {return (<div className={styles.audioIconWrapper} data-flx="channel.autocomplete-meme-preview.audio-icon-wrapper">@@ -53,7 +53,7 @@ export const AutocompleteMemePreview = observer(({meme}: {meme: FavoriteMeme}) =<imgdraggable={false}className={styles.memeIcon}- src={needsStillFrame ? buildStaticGifPreviewURL(memeUrl) : memeUrl}+ src={(needsStillFrame && memeUrl ? buildStaticGifPreviewURL(memeUrl) : memeUrl) || undefined}alt={meme.name}aria-hidden={true}data-flx="channel.autocomplete-meme-preview.meme-icon"diff --git a/fluxer_app/src/features/channel/components/MessageActionBottomSheet.tsx b/fluxer_app/src/features/channel/components/MessageActionBottomSheet.tsxindex 780c67226..6400b908d 100644--- a/fluxer_app/src/features/channel/components/MessageActionBottomSheet.tsx+++ b/fluxer_app/src/features/channel/components/MessageActionBottomSheet.tsx@@ -15,6 +15,7 @@ import {ExpressionPickerSheet} from '@app/features/expressions/components/modalsimport {COPY_LINK_DESCRIPTOR, OPEN_LINK_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';import {useMessageReactions as useMessageReactionsSnapshot} from '@app/features/messaging/hooks/useMessageReactionStore';import type {Message} from '@app/features/messaging/models/MessagingMessage';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import {getEmojiNameWithColons, toReactionEmoji} from '@app/features/messaging/utils/ReactionUtils';import {remFromPx} from '@app/features/theme/layout/RemFromPx';import {CopyLinkIcon, OpenLinkIcon} from '@app/features/ui/action_menu/ContextMenuIcons';@@ -56,7 +57,7 @@ export const MessageActionBottomSheet: React.FC<MessageActionBottomSheetProps> =}, [linkUrl, onClose]);const handleCopyLink = useCallback(async () => {if (!linkUrl) return;- await TextCopyCommands.copy(i18n, linkUrl);+ await TextCopyCommands.copy(i18n, await AttachmentUrlRefresher.refresh(linkUrl));onClose();}, [i18n, linkUrl, onClose]);const handleAddReaction = useCallback(() => {diff --git a/fluxer_app/src/features/channel/components/MessageActionUtils.tsx b/fluxer_app/src/features/channel/components/MessageActionUtils.tsxindex b14126eef..01c28991d 100644--- a/fluxer_app/src/features/channel/components/MessageActionUtils.tsx+++ b/fluxer_app/src/features/channel/components/MessageActionUtils.tsx@@ -22,6 +22,7 @@ import MessageEdit from '@app/features/messaging/state/MessageEdit';import MessageReply from '@app/features/messaging/state/MessageReply';import Messages from '@app/features/messaging/state/MessagingMessages';import SavedMessages from '@app/features/messaging/state/SavedMessages';+import {refreshAttachmentUrlsInText} from '@app/features/messaging/utils/MessageCopyTextUtils';import {buildMessageJumpLink} from '@app/features/messaging/utils/MessageLinkUtils';import {retryFailedMessage} from '@app/features/messaging/utils/MessageRetryUtils';import {type ReactionEmoji, toReactionEmoji} from '@app/features/messaging/utils/ReactionUtils';@@ -353,7 +354,7 @@ export function createMessageActionHandlers(const handleCopyMessage = () => {const content = getEffectiveContent(message);if (content) {- TextCopyCommands.copy(i18n, content);+ requestCopyMessageText(message, i18n);onClose?.();}};@@ -662,7 +663,7 @@ export function requestMessageForward(export function requestCopyMessageText(message: Message, i18n: I18n): void {const content = getEffectiveContent(message);if (!content) return;- void TextCopyCommands.copy(i18n, content);+ void refreshAttachmentUrlsInText(content).then((text) => TextCopyCommands.copy(i18n, text));}export function requestMarkMessageUnread(message: Message): void {diff --git a/fluxer_app/src/features/channel/components/MobileMemesPicker.tsx b/fluxer_app/src/features/channel/components/MobileMemesPicker.tsxindex ea5834ef6..eca3a2061 100644--- a/fluxer_app/src/features/channel/components/MobileMemesPicker.tsx+++ b/fluxer_app/src/features/channel/components/MobileMemesPicker.tsx@@ -307,8 +307,9 @@ const GridItem = observer(const isAudio = contentType.startsWith('audio/');const isGifImage = !isVideo && contentType.toLowerCase().includes('gif');const shouldAnimateGif = useShouldAnimate({kind: 'gif', isAnimated: !isAudio && (isVideo || isGifImage)});- const memeUrl = AttachmentUrlRefresher.fresh(url, {refreshUnsigned: true});- const thumbnailSrc = isGifImage && !shouldAnimateGif ? buildStaticGifPreviewURL(memeUrl) : memeUrl;+ const memeUrl = AttachmentUrlRefresher.freshWhenReady(url, {refreshUnsigned: true});+ const thumbnailSrc =+ memeUrl !== null && isGifImage && !shouldAnimateGif ? buildStaticGifPreviewURL(memeUrl) : memeUrl;const videoPlaybackAllowed = useAnimatedMediaVideoPlayback(videoRef, {enabled: isVisible && !isAudio && isVideo,shouldPlay: shouldAnimateGif,@@ -351,14 +352,14 @@ const GridItem = observer(disablePictureInPicture={true}disableRemotePlayback={true}preload={shouldAnimateGif ? 'auto' : 'metadata'}- src={memeUrl}+ src={memeUrl ?? undefined}data-flx="channel.mobile-memes-picker.grid-item.gif"/>)}{isVisible && !isAudio && !isVideo && (<imgclassName={styles.gif}- src={thumbnailSrc}+ src={thumbnailSrc ?? undefined}alt={title}data-flx="channel.mobile-memes-picker.grid-item.gif--2"/>diff --git a/fluxer_app/src/features/channel/components/embeds/ChannelEmbed.tsx b/fluxer_app/src/features/channel/components/embeds/ChannelEmbed.tsxindex c8bf5d357..b1cc0d739 100644--- a/fluxer_app/src/features/channel/components/embeds/ChannelEmbed.tsx+++ b/fluxer_app/src/features/channel/components/embeds/ChannelEmbed.tsx@@ -12,6 +12,7 @@ import {isDuplicateEmbedAtIndex,isMediaMatureContent,isValidMedia,+ withFreshEmbedMediaUrls,} from '@app/features/channel/components/embeds/channel_embed/ChannelEmbedShared';import {SuppressEmbedsConfirmModal} from '@app/features/channel/components/embeds/channel_embed/EmbedLink';import {RichEmbed} from '@app/features/channel/components/embeds/channel_embed/RichEmbed';@@ -40,7 +41,7 @@ import FocusRing from '@app/features/ui/focus_ring/FocusRing';import MobileLayout from '@app/features/ui/state/MobileLayout';import {MessageAttachmentFlags, MessageEmbedTypes, Permissions} from '@fluxer/constants/src/ChannelConstants';import {GuildOperations} from '@fluxer/constants/src/GuildConstants';-import type {EmbedMedia, MessageEmbed} from '@fluxer/schema/src/domains/message/EmbedSchemas';+import type {MessageEmbed} from '@fluxer/schema/src/domains/message/EmbedSchemas';import {useLingui} from '@lingui/react/macro';import {XIcon} from '@phosphor-icons/react';import {clsx} from 'clsx';@@ -50,23 +51,32 @@ import {type FC, useCallback, useMemo} from 'react';const mediaFocusRingClass = messageStyles.mediaFocusRing;-function withFreshEmbedMediaUrls(media: EmbedMedia | undefined): EmbedMedia | undefined {- if (!media) return media;- const url = AttachmentUrlRefresher.fresh(media.url);- const proxyUrl = media.proxy_url === undefined ? undefined : AttachmentUrlRefresher.fresh(media.proxy_url);- if (url === media.url && proxyUrl === media.proxy_url) return media;- return {...media, url, proxy_url: proxyUrl};+function withFreshIconUrl<T extends {proxy_icon_url?: string | null}>(part: T | undefined): T | undefined {+ if (!part?.proxy_icon_url) return part;+ const proxyIconUrl = AttachmentUrlRefresher.fresh(part.proxy_icon_url);+ return proxyIconUrl === part.proxy_icon_url ? part : {...part, proxy_icon_url: proxyIconUrl};}function withFreshEmbedUrls(embed: MessageEmbed): MessageEmbed {+ const url = embed.url ? AttachmentUrlRefresher.fresh(embed.url) : embed.url;const image = withFreshEmbedMediaUrls(embed.image);const thumbnail = withFreshEmbedMediaUrls(embed.thumbnail);const video = withFreshEmbedMediaUrls(embed.video);const audio = withFreshEmbedMediaUrls(embed.audio);- if (image === embed.image && thumbnail === embed.thumbnail && video === embed.video && audio === embed.audio) {+ const author = withFreshIconUrl(embed.author);+ const footer = withFreshIconUrl(embed.footer);+ if (+ url === embed.url &&+ image === embed.image &&+ thumbnail === embed.thumbnail &&+ video === embed.video &&+ audio === embed.audio &&+ author === embed.author &&+ footer === embed.footer+ ) {return embed;}- return {...embed, image, thumbnail, video, audio};+ return {...embed, url, image, thumbnail, video, audio, author, footer};}export const Embed: FC<EmbedProps> = observer((props: EmbedProps) => {diff --git a/fluxer_app/src/features/channel/components/embeds/channel_embed/BlueskyEmbed.tsx b/fluxer_app/src/features/channel/components/embeds/channel_embed/BlueskyEmbed.tsxindex 1ac35c88e..99bf4b47e 100644--- a/fluxer_app/src/features/channel/components/embeds/channel_embed/BlueskyEmbed.tsx+++ b/fluxer_app/src/features/channel/components/embeds/channel_embed/BlueskyEmbed.tsx@@ -10,6 +10,7 @@ import {type EmbedProps,getBorderColor,isValidMedia,+ useFreshGalleryImages,} from '@app/features/channel/components/embeds/channel_embed/ChannelEmbedShared';import {EmbedMediaRenderer} from '@app/features/channel/components/embeds/channel_embed/EmbedMediaRenderer';import {@@ -117,9 +118,10 @@ export const BlueskyEmbed: FC<BlueskyEmbedProps> = observer(const hasImage = isValidMedia(embed.image);const hasThumbnail = isValidMedia(embed.thumbnail);const hasAnyMedia = hasVideo || hasImage || hasThumbnail;- const galleryImages = useMemo<Array<Required<EmbedMedia>>>(() => {+ const rawGalleryImages = useMemo<Array<Required<EmbedMedia>>>(() => {return collectGalleryImages({embed, embedIndex, embedList});}, [embed, embedIndex, embedList]);+ const galleryImages = useFreshGalleryImages(rawGalleryImages);const showGallery = galleryImages.length > 1 || (!hasAnyMedia && galleryImages.length > 0);const galleryAttachments = useMemo(() => (showGallery ? buildGalleryAttachments(galleryImages, embed, embedIndex) : undefined),diff --git a/fluxer_app/src/features/channel/components/embeds/channel_embed/ChannelEmbedShared.ts b/fluxer_app/src/features/channel/components/embeds/channel_embed/ChannelEmbedShared.tsindex 249d6cf58..df8c752dc 100644--- a/fluxer_app/src/features/channel/components/embeds/channel_embed/ChannelEmbedShared.ts+++ b/fluxer_app/src/features/channel/components/embeds/channel_embed/ChannelEmbedShared.ts@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport type {Message} from '@app/features/messaging/models/MessagingMessage';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import {getEmbedMediaDimensions} from '@app/features/messaging/utils/MediaDimensionConfig';import {buildAnimatedImageProxyURL,@@ -16,6 +17,7 @@ import {MessageAttachmentFlags} from '@fluxer/constants/src/ChannelConstants';import type {EmbedMedia, MessageEmbed} from '@fluxer/schema/src/domains/message/EmbedSchemas';import type {MessageAttachment} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';import type React from 'react';+import {useMemo} from 'react';export const logger = new Logger('Embed');export const THUMBNAIL_SIZE = 80;@@ -242,6 +244,20 @@ export const buildGalleryAttachments = (}));};+export function withFreshEmbedMediaUrls<T extends EmbedMedia | undefined>(media: T): T {+ if (!media) return media;+ const url = AttachmentUrlRefresher.fresh(media.url);+ const proxyUrl = media.proxy_url == null ? media.proxy_url : AttachmentUrlRefresher.fresh(media.proxy_url);+ if (url === media.url && proxyUrl === media.proxy_url) return media;+ return {...media, url, proxy_url: proxyUrl};+}++export function useFreshGalleryImages(images: Array<Required<EmbedMedia>>): Array<Required<EmbedMedia>> {+ const freshImages = images.map(withFreshEmbedMediaUrls);+ const freshUrls = freshImages.map((image) => `${image.url}\n${image.proxy_url}`).join('\n');+ return useMemo(() => freshImages, [freshUrls, images]);+}+interface EmbedListRenderMetadata {normalizedUrls: Array<string | null>;firstIndexByNormalizedUrl: Map<string, number>;diff --git a/fluxer_app/src/features/channel/components/embeds/channel_embed/EmbedLink.tsx b/fluxer_app/src/features/channel/components/embeds/channel_embed/EmbedLink.tsxindex eb8ed3dce..34115f325 100644--- a/fluxer_app/src/features/channel/components/embeds/channel_embed/EmbedLink.tsx+++ b/fluxer_app/src/features/channel/components/embeds/channel_embed/EmbedLink.tsx@@ -11,9 +11,12 @@ import * as MessageCommands from '@app/features/messaging/commands/MessageCommanimport {LinkDestinationTooltip} from '@app/features/messaging/components/LinkDestinationTooltip';import {useOpenInBrowserOnMiddleClick} from '@app/features/messaging/hooks/useOpenInBrowserOnMiddleClick';import type {Message} from '@app/features/messaging/models/MessagingMessage';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';+import {attachmentUrlMayNeedRefresh} from '@app/features/messaging/utils/AttachmentCdnUrl';import {isTrustedExternalUrl, openExternalUrlWithWarning} from '@app/features/messaging/utils/ExternalLinkUtils';import TrustedDomain from '@app/features/trusted_domain/state/TrustedDomain';import FocusRing from '@app/features/ui/focus_ring/FocusRing';+import {openExternalUrl} from '@app/features/ui/utils/NativeUtils';import {Trans, useLingui} from '@lingui/react/macro';import {clsx} from 'clsx';import {observer} from 'mobx-react-lite';@@ -21,6 +24,8 @@ import type React from 'react';import type {FC} from 'react';export const EmbedLink: FC<LinkComponentProps> = observer(({url, children, className}) => {+ const href = AttachmentUrlRefresher.fresh(url);+ const warmAttachmentUrl = () => AttachmentUrlRefresher.warm(url);const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {e.stopPropagation();try {@@ -28,6 +33,11 @@ export const EmbedLink: FC<LinkComponentProps> = observer(({url, children, classif (!TrustedDomain.isTrustedDomain(parsed.hostname)) {e.preventDefault();openExternalUrlWithWarning(url);+ return;+ }+ if (attachmentUrlMayNeedRefresh(href, Date.now())) {+ e.preventDefault();+ void openExternalUrl(href);}} catch (_error) {logger.warn('Invalid URL in embed link:', url);@@ -43,10 +53,12 @@ export const EmbedLink: FC<LinkComponentProps> = observer(({url, children, class<FocusRing data-flx="channel.embeds.embed.link-component.focus-ring"><aclassName={clsx(styles.embedLink, className)}- href={url}+ href={href}rel="noopener noreferrer"target="_blank"onClick={handleClick}+ onPointerEnter={warmAttachmentUrl}+ onFocus={warmAttachmentUrl}onAuxClick={openInBrowser.onAuxClick}data-flx="channel.embeds.embed.link-component.a">diff --git a/fluxer_app/src/features/channel/components/embeds/channel_embed/RichEmbed.tsx b/fluxer_app/src/features/channel/components/embeds/channel_embed/RichEmbed.tsxindex 8867d2827..b3fd07a96 100644--- a/fluxer_app/src/features/channel/components/embeds/channel_embed/RichEmbed.tsx+++ b/fluxer_app/src/features/channel/components/embeds/channel_embed/RichEmbed.tsx@@ -10,6 +10,7 @@ import {getBorderColor,getUrlHostname,isValidMedia,+ useFreshGalleryImages,} from '@app/features/channel/components/embeds/channel_embed/ChannelEmbedShared';import {EmbedMediaRenderer,@@ -43,9 +44,10 @@ export const RichEmbed: FC<EmbedProps> = observer(const hasImage = isValidMedia(embed.image);const hasThumbnail = isValidMedia(embed.thumbnail);const hasAnyMedia = hasVideo || hasImage || hasThumbnail;- const galleryImages = useMemo<Array<Required<EmbedMedia>>>(() => {+ const rawGalleryImages = useMemo<Array<Required<EmbedMedia>>>(() => {return collectGalleryImages({embed, embedIndex, embedList});}, [embed, embedIndex, embedList]);+ const galleryImages = useFreshGalleryImages(rawGalleryImages);const showGallery = galleryImages.length > 1 || (!hasAnyMedia && galleryImages.length > 0);const galleryAttachments = useMemo(() => (showGallery ? buildGalleryAttachments(galleryImages, embed, embedIndex) : undefined),diff --git a/fluxer_app/src/features/channel/components/embeds/media/EmbedGifv.tsx b/fluxer_app/src/features/channel/components/embeds/media/EmbedGifv.tsxindex 1cdc8c612..12a236183 100644--- a/fluxer_app/src/features/channel/components/embeds/media/EmbedGifv.tsx+++ b/fluxer_app/src/features/channel/components/embeds/media/EmbedGifv.tsx@@ -146,6 +146,7 @@ interface ThumbHashCurtainState {curtainLifted: boolean;fastFade: boolean;posterRevealed: boolean;+ onPosterError: () => void;}function useThumbHashCurtain(source: string, enabled: boolean): ThumbHashCurtainState {@@ -153,18 +154,28 @@ function useThumbHashCurtain(source: string, enabled: boolean): ThumbHashCurtainconst [cachedAtMount] = useState(() => ImageCacheUtils.hasImage(source));const [curtainLifted, setCurtainLifted] = useState(false);const [fastFade, setFastFade] = useState(false);+ const [failedSource, setFailedSource] = useState<string | null>(null);+ const onPosterError = useAttachmentRefreshOnError(source);useLayoutEffect(() => {if (!enabled || source.length === 0) return;- return ImageCacheUtils.loadImage(source, () => {- setFastFade(Date.now() - mountedAt < PLACEHOLDER_FAST_FADE_WINDOW_MS);- setCurtainLifted(true);- });- }, [enabled, mountedAt, source]);+ return ImageCacheUtils.loadImage(+ source,+ () => {+ setFastFade(Date.now() - mountedAt < PLACEHOLDER_FAST_FADE_WINDOW_MS);+ setCurtainLifted(true);+ },+ () => {+ onPosterError();+ setFailedSource(source);+ },+ );+ }, [enabled, mountedAt, onPosterError, source]);return {shouldMount: !cachedAtMount,curtainLifted,fastFade,- posterRevealed: source.length === 0 || cachedAtMount || curtainLifted,+ posterRevealed: source.length === 0 || cachedAtMount || curtainLifted || failedSource === source,+ onPosterError,};}@@ -767,6 +778,7 @@ export const EmbedGifv: FC<height={dimensions.height}loading="eager"tabIndex={-1}+ onError={thumbHashCurtain.onPosterError}data-embed-media="gifv-still"data-flx="channel.embeds.media.embed-gifv.still-element"/>diff --git a/fluxer_app/src/features/channel/components/embeds/media/EmbedVideo.tsx b/fluxer_app/src/features/channel/components/embeds/media/EmbedVideo.tsxindex 0e2166152..e9afcd649 100644--- a/fluxer_app/src/features/channel/components/embeds/media/EmbedVideo.tsx+++ b/fluxer_app/src/features/channel/components/embeds/media/EmbedVideo.tsx@@ -17,6 +17,7 @@ import {} from '@app/features/channel/components/embeds/media/VideoDimensionUtils';import {useMaybeMessageViewContext} from '@app/features/channel/components/MessageViewContext';import {isKeyboardActivationKey} from '@app/features/input/utils/KeyboardUtils';+import {useAttachmentRefreshOnError} from '@app/features/messaging/hooks/useAttachmentRefreshOnError';import {useDeleteAttachment} from '@app/features/messaging/hooks/useDeleteAttachment';import {useMatureMedia} from '@app/features/messaging/hooks/useMatureMedia';import {useMediaFavorite} from '@app/features/messaging/hooks/useMediaFavorite';@@ -37,6 +38,7 @@ import {VideoPlayer,type VideoPlayerMetadata,} from '@app/features/voice/components/media_player/components/VideoPlayer';+import {useMediaSourceResume} from '@app/features/voice/components/media_player/hooks/useMediaSourceResume';import {useInAppMediaSoundCapture} from '@app/features/voice/hooks/useInAppMediaSoundCapture';import VideoVolume from '@app/features/voice/state/VideoVolume';import type {MessageAttachment} from '@fluxer/schema/src/domains/message/MessageResponseSchemas';@@ -217,6 +219,7 @@ const EmbedVideo: FC<EmbedVideoProps> = observer(const messageViewContext = useMaybeMessageViewContext();const effectiveSrc = buildMediaProxyURL(src);const isBlob = src.startsWith('blob:');+ const handleVideoError = useAttachmentRefreshOnError(src);const declaredLayout = resolveVideoLayout(getEffectiveVideoLayoutDimensions({width, height}, null), {maxWidth,maxHeight,@@ -243,6 +246,7 @@ const EmbedVideo: FC<EmbedVideoProps> = observer(const [metadataProbeArmed, setMetadataProbeArmed] = useState(false);const inlineVideoRef = useRef<HTMLVideoElement>(null);useInAppMediaSoundCapture(inlineVideoRef);+ useMediaSourceResume(inlineVideoRef, isPlayingInline);useLayoutEffect(() => {if (!isPlayingInline) return;const inlineVideo = inlineVideoRef.current;@@ -385,6 +389,7 @@ const EmbedVideo: FC<EmbedVideoProps> = observer(}},() => {+ handleVideoError();if (active) setLoadedPosterSrc((currentSource) => (currentSource === posterSrc ? null : currentSource));},);@@ -392,7 +397,7 @@ const EmbedVideo: FC<EmbedVideoProps> = observer(active = false;cleanup();};- }, [loadedPosterSrc, posterSrc, shouldLoadMedia]);+ }, [handleVideoError, loadedPosterSrc, posterSrc, shouldLoadMedia]);const handleMobileTap = useCallback(() => {const videoItems = attachmentsToViewerItems(mediaAttachments, {filterType: 'video'});if (videoItems.length > 0) {@@ -572,6 +577,7 @@ const EmbedVideo: FC<EmbedVideoProps> = observer(src={resolveDesktopCrossOriginMediaURL(effectiveSrc)}tabIndex={-1}onLoadedMetadata={handleMetadataProbeLoaded}+ onError={handleVideoError}data-flx="channel.embeds.media.embed-video.metadata-probe"><track kind="captions" data-flx="channel.embeds.media.embed-video.track" />@@ -612,6 +618,7 @@ const EmbedVideo: FC<EmbedVideoProps> = observer(onClick={handleInlineVideoTap}onEnded={handleInlineVideoEnded}onLoadedMetadata={handleMetadataProbeLoaded}+ onError={handleVideoError}data-flx="channel.embeds.media.embed-video.inline-video"/><buttondiff --git a/fluxer_app/src/features/channel/components/embeds/media/VoiceMessagePlayer.tsx b/fluxer_app/src/features/channel/components/embeds/media/VoiceMessagePlayer.tsxindex 3cae481f1..98dfad1aa 100644--- a/fluxer_app/src/features/channel/components/embeds/media/VoiceMessagePlayer.tsx+++ b/fluxer_app/src/features/channel/components/embeds/media/VoiceMessagePlayer.tsx@@ -6,7 +6,6 @@ import styles from '@app/features/channel/components/embeds/media/VoiceMessagePlimport {useMaybeMessageViewContext} from '@app/features/channel/components/MessageViewContext';import {PAUSE_DESCRIPTOR, PLAY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';import {getCachedNumberFormat} from '@app/features/i18n/utils/IntlCache';-import {useAttachmentRefreshOnError} from '@app/features/messaging/hooks/useAttachmentRefreshOnError';import {resolveDesktopCrossOriginMediaURL} from '@app/features/messaging/utils/DesktopResourceUrl';import {buildMediaProxyURL} from '@app/features/messaging/utils/MediaProxyUtils';import {Logger} from '@app/features/platform/utils/AppLogger';@@ -121,7 +120,6 @@ const VoiceMessagePlayer: React.FC<VoiceMessagePlayerProps> = observer(const {i18n} = useLingui();const messageViewContext = useMaybeMessageViewContext();const effectiveSrc = buildMediaProxyURL(src);- const handleMediaError = useAttachmentRefreshOnError(effectiveSrc);const [hasStarted, setHasStarted] = useState(false);const [wantsMetadata, setWantsMetadata] = useState(false);const [prePlayCurrentTime, setPrePlayCurrentTime] = useState(0);@@ -327,7 +325,6 @@ const VoiceMessagePlayer: React.FC<VoiceMessagePlayerProps> = observer(ref={mediaRef as React.RefObject<HTMLAudioElement>}src={hasStarted || wantsMetadata ? resolveDesktopCrossOriginMediaURL(effectiveSrc) : undefined}preload={wantsMetadata ? 'metadata' : 'none'}- onError={handleMediaError}data-flx="channel.embeds.media.voice-message-player.audio"><track kind="captions" data-flx="channel.embeds.media.voice-message-player.track" />diff --git a/fluxer_app/src/features/channel/components/pickers/gif/FavoriteGifTypes.ts b/fluxer_app/src/features/channel/components/pickers/gif/FavoriteGifTypes.tsindex fe88e9d92..ea84f37e0 100644--- a/fluxer_app/src/features/channel/components/pickers/gif/FavoriteGifTypes.ts+++ b/fluxer_app/src/features/channel/components/pickers/gif/FavoriteGifTypes.ts@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import {stripAttachmentSignature} from '@app/features/messaging/utils/AttachmentCdnUrl';+import RuntimeConfig from '@app/features/app/state/RuntimeConfig';+import {isAttachmentCdnUrl, stripAttachmentSignature} from '@app/features/messaging/utils/AttachmentCdnUrl';import {inferFormatContentType, PREVIEW_FORMAT_PRIORITY} from '@fluxer/schema/src/domains/gif/GifMediaFormatKeys';export interface FavoriteGifMediaFormat {@@ -108,14 +109,18 @@ export function pickCanonicalPreviewFormat(const STORED_PREVIEW_DEVICE_PIXEL_RATIO = 2;+export function stripOwnAttachmentSignature(url: string): string {+ return isAttachmentCdnUrl(url, RuntimeConfig.mediaEndpoint) ? stripAttachmentSignature(url) : url;+}+export function stripFavoriteGifEntrySignatures(entry: FavoriteGifEntry): FavoriteGifEntry {- const url = stripAttachmentSignature(entry.url);- const proxyUrl = stripAttachmentSignature(entry.proxy_url);+ const url = stripOwnAttachmentSignature(entry.url);+ const proxyUrl = stripOwnAttachmentSignature(entry.proxy_url);const media: Record<string, FavoriteGifMediaFormat> = {};let mediaChanged = false;for (const [key, format] of Object.entries(entry.media)) {- const src = stripAttachmentSignature(format.src);- const proxySrc = stripAttachmentSignature(format.proxy_src);+ const src = stripOwnAttachmentSignature(format.src);+ const proxySrc = stripOwnAttachmentSignature(format.proxy_src);if (src === format.src && proxySrc === format.proxy_src) {media[key] = format;continue;diff --git a/fluxer_app/src/features/channel/components/pickers/gif/GifPickerGridData.ts b/fluxer_app/src/features/channel/components/pickers/gif/GifPickerGridData.tsindex 95179daea..1fe37a9c7 100644--- a/fluxer_app/src/features/channel/components/pickers/gif/GifPickerGridData.ts+++ b/fluxer_app/src/features/channel/components/pickers/gif/GifPickerGridData.ts@@ -36,7 +36,7 @@ export interface BuildGifPickerGridDataInput {}function freshStoredUrl(url: string): string {- return AttachmentUrlRefresher.fresh(url, {refreshUnsigned: true});+ return AttachmentUrlRefresher.freshWhenReady(url, {refreshUnsigned: true}) ?? '';}function buildSkeletonGifPickerItems(count: number): Array<GifPickerGridItemData> {diff --git a/fluxer_app/src/features/channel/components/pickers/memes/MemeGridItem.tsx b/fluxer_app/src/features/channel/components/pickers/memes/MemeGridItem.tsxindex 22b793686..1602361d6 100644--- a/fluxer_app/src/features/channel/components/pickers/memes/MemeGridItem.tsx+++ b/fluxer_app/src/features/channel/components/pickers/memes/MemeGridItem.tsx@@ -61,7 +61,7 @@ const GifIndicator = observer(() => (const VideoPoster = ({src, placeholder}: {src: string; placeholder: string | null}) => {return (<PickerThumbnail- src={buildMediaProxyURL(src, {format: 'webp'})}+ src={src && buildMediaProxyURL(src, {format: 'webp'})}alt=""className={gifStyles.gif}placeholder={placeholder}@@ -104,10 +104,10 @@ export const MemeGridItem = observer(isHovering: isVideoPreviewActive,});const shouldRenderVideoPreview = !isAudio && isVideo && isVideoPreviewActive && shouldAnimateGif;- const memeUrl = AttachmentUrlRefresher.fresh(meme.url, {refreshUnsigned: true});+ const memeUrl = AttachmentUrlRefresher.freshWhenReady(meme.url, {refreshUnsigned: true}) ?? '';const thumbnailSrc =isGifImage && !shouldAnimateGif- ? AttachmentUrlRefresher.fresh(buildStaticGifPreviewURL(meme.url), {refreshUnsigned: true})+ ? (AttachmentUrlRefresher.freshWhenReady(buildStaticGifPreviewURL(meme.url), {refreshUnsigned: true}) ?? ''): memeUrl;const videoPreviewStartTime = meme.duration && meme.duration > 0 ? meme.duration / 2 : null;usePooledVideo({diff --git a/fluxer_app/src/features/channel/components/pickers/shared/PickerThumbnail.tsx b/fluxer_app/src/features/channel/components/pickers/shared/PickerThumbnail.tsxindex b25676995..afa3073f3 100644--- a/fluxer_app/src/features/channel/components/pickers/shared/PickerThumbnail.tsx+++ b/fluxer_app/src/features/channel/components/pickers/shared/PickerThumbnail.tsx@@ -22,7 +22,7 @@ export const PickerThumbnail: FC<PickerThumbnailProps> = observer(({src, alt, cl<>{!error && (<img- src={src}+ src={src || undefined}ref={ref}alt={alt}className={className}diff --git a/fluxer_app/src/features/channel/components/pickers/shared/usePooledVideo.ts b/fluxer_app/src/features/channel/components/pickers/shared/usePooledVideo.tsindex da5144be4..0f22566f0 100644--- a/fluxer_app/src/features/channel/components/pickers/shared/usePooledVideo.ts+++ b/fluxer_app/src/features/channel/components/pickers/shared/usePooledVideo.ts@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport {safePause, safePlay} from '@app/features/channel/components/GifVideoPool';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import {useEffect, useRef} from 'react';const HAVE_METADATA_READY_STATE = 1;@@ -41,10 +42,15 @@ export function usePooledVideo({videoRef.current = video;video.autoplay = false;video.preload = effectivePreload;+ const refreshOnError = () => {+ void AttachmentUrlRefresher.refresh(src, {force: true});+ };+ video.addEventListener('error', refreshOnError, {once: true});video.src = src;container.appendChild(video);videoPool.registerActive(video);return () => {+ video.removeEventListener('error', refreshOnError);videoPool.unregisterActive(video);videoPool.returnElement(video);if (videoRef.current === video) {diff --git a/fluxer_app/src/features/expressions/state/FavoriteGif.ts b/fluxer_app/src/features/expressions/state/FavoriteGif.tsindex 7cf2f5002..76b7e2ae0 100644--- a/fluxer_app/src/features/expressions/state/FavoriteGif.ts+++ b/fluxer_app/src/features/expressions/state/FavoriteGif.ts@@ -5,8 +5,8 @@ import {type FavoriteGifMediaFormat,slimFavoriteGifEntry,stripFavoriteGifEntrySignatures,+ stripOwnAttachmentSignature,} from '@app/features/channel/components/pickers/gif/FavoriteGifTypes';-import {stripAttachmentSignature} from '@app/features/messaging/utils/AttachmentCdnUrl';import {unwrapDesktopLocalResourceURL} from '@app/features/messaging/utils/DesktopResourceUrl';import {initializeStore} from '@app/features/platform/utils/StoreInitialization';import {makeSyncedField} from '@app/features/user/state/SyncedField';@@ -168,13 +168,13 @@ class FavoriteGif {}hasUrl(url: string): boolean {- const target = stripAttachmentSignature(url);- return this.favoriteGifs.some((entry) => stripAttachmentSignature(entry.url) === target);+ const target = stripOwnAttachmentSignature(url);+ return this.favoriteGifs.some((entry) => stripOwnAttachmentSignature(entry.url) === target);}findByUrl(url: string): FavoriteGifEntry | null {- const target = stripAttachmentSignature(url);- return this.favoriteGifs.find((entry) => stripAttachmentSignature(entry.url) === target) ?? null;+ const target = stripOwnAttachmentSignature(url);+ return this.favoriteGifs.find((entry) => stripOwnAttachmentSignature(entry.url) === target) ?? null;}addEntry(entry: FavoriteGifEntry): void {@@ -185,8 +185,8 @@ class FavoriteGif {removeByUrl(url: string): void {if (!this.hasUrl(url)) return;- const target = stripAttachmentSignature(url);- this.favoriteGifs = this.favoriteGifs.filter((entry) => stripAttachmentSignature(entry.url) !== target);+ const target = stripOwnAttachmentSignature(url);+ this.favoriteGifs = this.favoriteGifs.filter((entry) => stripOwnAttachmentSignature(entry.url) !== target);}replaceAll(entries: ReadonlyArray<FavoriteGifEntry>): void {diff --git a/fluxer_app/src/features/forum/components/ForumPostCard.tsx b/fluxer_app/src/features/forum/components/ForumPostCard.tsxindex 34e212398..74954602b 100644--- a/fluxer_app/src/features/forum/components/ForumPostCard.tsx+++ b/fluxer_app/src/features/forum/components/ForumPostCard.tsx@@ -12,7 +12,9 @@ import * as D from '@app/features/forum/utils/ForumMessageDescriptors';import {isPinnedPost} from '@app/features/forum/utils/ForumPostList';import {MESSAGE_COUNT_DESCRIPTOR as D_POST_COUNT_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';import * as ReactionCommands from '@app/features/messaging/commands/ReactionCommands';+import {useAttachmentRefreshOnError} from '@app/features/messaging/hooks/useAttachmentRefreshOnError';import {Message} from '@app/features/messaging/models/MessagingMessage';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import {buildFitInsideMediaProxyURL, resolvePreferredImageFormat} from '@app/features/messaging/utils/MediaProxyUtils';import Navigation from '@app/features/navigation/state/Navigation';import {buildMessageNotificationBody} from '@app/features/notification/utils/MessageNotificationPreview';@@ -59,7 +61,9 @@ function firstMedia(message: WireMessage | null | undefined): {src: string; videconst attachment = message?.attachments?.find(isVisualAttachment);const source = attachment?.proxy_url ?? attachment?.url;if (!attachment || !source) return null;- return {src: source, video: (attachment.content_type ?? '').startsWith('video/')};+ const src = AttachmentUrlRefresher.freshWhenReady(source);+ if (src === null) return null;+ return {src, video: (attachment.content_type ?? '').startsWith('video/')};}function defaultReactionState(@@ -159,6 +163,7 @@ export const ForumPostCard = observer(({forum, post, grid}: ForumPostCardProps)height: grid ? GRID_THUMBNAIL_SIZE : LIST_THUMBNAIL_SIZE,}): null;+ const handleThumbnailError = useAttachmentRefreshOnError(media?.src);return (<><FocusRing offset={-2} data-flx="forum.forum-post-card.focus-ring">@@ -186,6 +191,7 @@ export const ForumPostCard = observer(({forum, post, grid}: ForumPostCardProps)className={styles.cardMediaImage}loading="lazy"draggable={false}+ onError={handleThumbnailError}data-flx="forum.forum-post-card.card-media-image"/>) : (@@ -276,6 +282,7 @@ export const ForumPostCard = observer(({forum, post, grid}: ForumPostCardProps)className={styles.cardMediaImage}loading="lazy"draggable={false}+ onError={handleThumbnailError}data-flx="forum.forum-post-card.card-media-image--2"/>{media?.video && (diff --git a/fluxer_app/src/features/i18n/locales/ar/messages.po b/fluxer_app/src/features/i18n/locales/ar/messages.poindex a189ac5b8..689bfa8ea 100644--- a/fluxer_app/src/features/i18n/locales/ar/messages.po+++ b/fluxer_app/src/features/i18n/locales/ar/messages.po@@ -16791,10 +16791,10 @@ msgstr "فلوريدا"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "يضيف Fluxer رقمًا عشوائيًا إلى كل اسم مستخدم، مثل alex#4821، ليتمكن كثيرون من استخدام الاسم نفسه."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer منع تحميل {url}. قم برفعه كأصل."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "حظر Fluxer تحميل {url}. ارفع الملف كأصل، أو استخدم رابط مرفق للصور."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "لا يمكن لـ Fluxer فتح هذا المجلد. استورده مmsgid "Fluxer can't read this folder."msgstr "لا يمكن لـ Fluxer قراءة هذا المجلد."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "تعذّر على Fluxer تطبيق CSS هذا. تحقق من وجود تعليق أو نص أو قوس غير سليم."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "تعذّر على Fluxer الوصول إلى {instanceName} للتحققmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "توقف Fluxer عن التحقق مما إذا كان المتصفح قد وافق على تسجيل الدخول هذا. لم يفقد رمزك."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "لن يحمّل Fluxer {count, plural, zero {# ملف} one {ملفًا واحدًا} two {ملفين} few {# ملفات} many {# ملفًا} other {# ملف}} تشير إليها هذه السمة على مواقع أخرى."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/bg/messages.po b/fluxer_app/src/features/i18n/locales/bg/messages.poindex 145f5cfd8..83013afcb 100644--- a/fluxer_app/src/features/i18n/locales/bg/messages.po+++ b/fluxer_app/src/features/i18n/locales/bg/messages.po@@ -16791,10 +16791,10 @@ msgstr "Флорида"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer добавя случаен номер към всяко потребителско име, например alex#4821, за да могат много хора да ползват едно и също име."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer блокира зареждането на {url}. Качете го като ресурс."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer блокира зареждането на {url}. Качете файла като ресурс или използвайте връзка към прикачен файл за изображение."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer не може да отвори тази папка. Импортmsgid "Fluxer can't read this folder."msgstr "Fluxer не може да прочете тази папка."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer не можа да приложи този CSS. Проверете за счупен коментар, низ или скоба."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer не успя да се свърже с {instanceName}, за даmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer спря да проверява дали браузърът е одобрил влизането. Кодът ви не е изгубен."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer няма да зареди {count, plural, one {# файл} other {# файла}} от други сайтове, към които води тази тема."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/cs/messages.po b/fluxer_app/src/features/i18n/locales/cs/messages.poindex ee1c9e4ff..2286fea96 100644--- a/fluxer_app/src/features/i18n/locales/cs/messages.po+++ b/fluxer_app/src/features/i18n/locales/cs/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer ke každému uživatelskému jménu přidá náhodné číslo, například alex#4821, aby mohlo stejné jméno používat více lidí."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer zablokoval načtení {url}. Nahrajte ho jako prostředek."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer zablokoval načtení {url}. Nahrajte soubor jako prostředek, nebo pro obrázek použijte odkaz na přílohu."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer nemůže tuto složku otevřít. Znovu ji importujte, abyste ji mmsgid "Fluxer can't read this folder."msgstr "Fluxer nemůže tuto složku přečíst."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer nemohl tento CSS použít. Zkontrolujte, zda v něm není poškozený komentář, řetězec nebo závorka."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer se nemohl spojit s {instanceName} a ověřit, zda prohlížeč scmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer přestal kontrolovat, zda prohlížeč schválil toto přihlášení. Váš kód neztratil."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer nenačte {count, plural, one {# soubor} few {# soubory} many {# souboru} other {# souborů}} z jiných webů, na které tento motiv odkazuje."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/da/messages.po b/fluxer_app/src/features/i18n/locales/da/messages.poindex 92c845304..dd518f1df 100644--- a/fluxer_app/src/features/i18n/locales/da/messages.po+++ b/fluxer_app/src/features/i18n/locales/da/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer tilføjer et tilfældigt nummer til hvert brugernavn, som alex#4821, så mange kan bruge det samme navn."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer blokerede indlæsning af {url}. Upload den som en ressource."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer blokerede indlæsning af {url}. Upload filen som en ressource, eller brug et link til en vedhæftet fil til et billede."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer kan ikke åbne denne mappe. Importer den igen for at fortsætte omsgid "Fluxer can't read this folder."msgstr "Fluxer kan ikke læse denne mappe."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer kunne ikke anvende denne CSS. Tjek den for en ødelagt kommentar, streng eller parentes."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer kunne ikke nå {instanceName} for at tjekke, om din browser godkemsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer stoppede med at tjekke, om browseren godkendte dette login. Den mistede ikke din kode."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer indlæser ikke {count, plural, one {# fil} other {# filer}} på andre websteder, som dette tema linker til."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/de/messages.po b/fluxer_app/src/features/i18n/locales/de/messages.poindex c7a24cd39..2a5c1831a 100644--- a/fluxer_app/src/features/i18n/locales/de/messages.po+++ b/fluxer_app/src/features/i18n/locales/de/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer hängt an jeden Benutzernamen eine zufällige Nummer an, etwa alex#4821, damit viele Leute denselben Namen nutzen können."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer hat das Laden von {url} blockiert. Lade es als Inhalt hoch."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer hat das Laden von {url} blockiert. Lade die Datei als Inhalt hoch oder verwende für ein Bild einen Anhang-Link."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer kann diesen Ordner nicht öffnen. Importiere ihn erneut, um ihn wmsgid "Fluxer can't read this folder."msgstr "Fluxer kann diesen Ordner nicht lesen."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer konnte dieses CSS nicht anwenden. Prüfe es auf einen fehlerhaften Kommentar, String oder eine fehlerhafte Klammer."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer konnte {instanceName} nicht erreichen, um zu prüfen, ob dein Bromsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer hat die Überprüfung, ob der Browser die Anmeldung genehmigt hat, beendet. Dein Code ist nicht verloren gegangen."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer lädt {count, plural, one {# Datei} other {# Dateien}} auf anderen Websites nicht, auf die dieses Design verlinkt."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/el/messages.po b/fluxer_app/src/features/i18n/locales/el/messages.poindex 7d42ecb53..161e8f44b 100644--- a/fluxer_app/src/features/i18n/locales/el/messages.po+++ b/fluxer_app/src/features/i18n/locales/el/messages.po@@ -16791,10 +16791,10 @@ msgstr "Φλόριντα"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Το Fluxer προσθέτει έναν τυχαίο αριθμό σε κάθε όνομα χρήστη, όπως alex#4821, ώστε πολλοί να μπορούν να χρησιμοποιούν το ίδιο όνομα."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Το Fluxer μπλόκαρε τη φόρτωση του {url}. Ανέβασέ το ως στοιχείο."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Το Fluxer μπλόκαρε τη φόρτωση του {url}. Ανέβασε το αρχείο ως στοιχείο ή χρησιμοποίησε σύνδεσμο συνημμένου για μια εικόνα."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Το Fluxer δεν μπορεί να ανοίξει αυτόν τον φmsgid "Fluxer can't read this folder."msgstr "Το Fluxer δεν μπορεί να διαβάσει αυτόν τον φάκελο."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Το Fluxer δεν μπόρεσε να εφαρμόσει αυτό το CSS. Έλεγξέ το για χαλασμένο σχόλιο, συμβολοσειρά ή αγκύλη."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Το Fluxer δεν μπόρεσε να συνδεθεί με το {instamsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Το Fluxer σταμάτησε να ελέγχει αν ο περιηγητής ενέκρινε αυτήν τη σύνδεση. Δεν έχασε τον κωδικό σας."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Το Fluxer δεν θα φορτώσει {count, plural, one {# αρχείο} other {# αρχεία}} σε άλλους ιστότοπους στους οποίους παραπέμπει αυτό το θέμα."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/en-GB/messages.po b/fluxer_app/src/features/i18n/locales/en-GB/messages.poindex ae548acc1..0cc459fdf 100644--- a/fluxer_app/src/features/i18n/locales/en-GB/messages.po+++ b/fluxer_app/src/features/i18n/locales/en-GB/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer blocked loading {url}. Upload it as an asset."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer can't open this folder. Import it again to keep watching it."msgid "Fluxer can't read this folder."msgstr "Fluxer can't read this folder."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer couldn't reach {instanceName} to check whether your browser appromsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/en-US/messages.po b/fluxer_app/src/features/i18n/locales/en-US/messages.poindex 71adae1cc..81510f613 100644--- a/fluxer_app/src/features/i18n/locales/en-US/messages.po+++ b/fluxer_app/src/features/i18n/locales/en-US/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer blocked loading {url}. Upload it as an asset."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer can't open this folder. Import it again to keep watching it."msgid "Fluxer can't read this folder."msgstr "Fluxer can't read this folder."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer couldn't reach {instanceName} to check whether your browser appromsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/es-419/messages.po b/fluxer_app/src/features/i18n/locales/es-419/messages.poindex d3ca7ad24..26b48a0b7 100644--- a/fluxer_app/src/features/i18n/locales/es-419/messages.po+++ b/fluxer_app/src/features/i18n/locales/es-419/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer agrega un número aleatorio a cada nombre de usuario, como alex#4821, para que muchas personas puedan usar el mismo nombre."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer bloqueó la carga de {url}. Súbelo como recurso."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer bloqueó la carga de {url}. Sube el archivo como recurso o usa un enlace de archivo adjunto para una imagen."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer no puede abrir esta carpeta. Impórtala de nuevo para seguir viémsgid "Fluxer can't read this folder."msgstr "Fluxer no puede leer esta carpeta."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer no pudo aplicar este CSS. Revisa si hay un comentario, una cadena o un paréntesis roto."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer no pudo conectarse con {instanceName} para verificar si tu navegamsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer dejó de verificar si el navegador aprobó este inicio de sesión. No perdió tu código."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer no cargará {count, plural, one {# archivo} other {# archivos}} de otros sitios a los que enlaza este tema."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/es-ES/messages.po b/fluxer_app/src/features/i18n/locales/es-ES/messages.poindex 285fad3e1..8cb101bdb 100644--- a/fluxer_app/src/features/i18n/locales/es-ES/messages.po+++ b/fluxer_app/src/features/i18n/locales/es-ES/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer añade un número aleatorio a cada nombre de usuario, como alex#4821, para que muchas personas puedan usar el mismo nombre."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer bloqueó la carga de {url}. Súbelo como recurso."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer bloqueó la carga de {url}. Sube el archivo como recurso o usa un enlace de archivo adjunto para una imagen."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer no puede abrir esta carpeta. Impórtala de nuevo para seguir obsemsgid "Fluxer can't read this folder."msgstr "Fluxer no puede leer esta carpeta."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer no ha podido aplicar este CSS. Comprueba si hay un comentario, una cadena o un paréntesis roto."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer no ha podido conectar con {instanceName} para comprobar si tu navmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer dejó de comprobar si el navegador aprobaba este inicio de sesión. No perdió tu código."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer no cargará {count, plural, one {# archivo} other {# archivos}} de otros sitios a los que enlaza este tema."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/fi/messages.po b/fluxer_app/src/features/i18n/locales/fi/messages.poindex c0098b513..e8adb62fc 100644--- a/fluxer_app/src/features/i18n/locales/fi/messages.po+++ b/fluxer_app/src/features/i18n/locales/fi/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer lisää jokaiseen käyttäjänimeen satunnaisen numeron, kuten alex#4821, jotta moni voi käyttää samaa nimeä."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer esti lataamasta {url}. Lataa se resurssiksi."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer esti lataamasta {url}. Lataa tiedosto resurssiksi tai käytä kuvalle liitelinkkiä."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer ei voi avata tätä kansiota. Tuo se uudelleen, jotta seuranta jamsgid "Fluxer can't read this folder."msgstr "Fluxer ei voi lukea tätä kansiota."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer ei voinut ottaa tätä CSS:ää käyttöön. Tarkista, onko siinä rikkinäinen kommentti, merkkijono tai sulje."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer ei saanut yhteyttä palveluun {instanceName} tarkistaakseen, hyvmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer lopetti selaimen hyväksynnän tarkistamisen tälle kirjautumiselle. Se ei kadottanut koodiasi."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer ei lataa {count, plural, one {# tiedostoa} other {# tiedostoa}} muilta sivustoilta, joille tämä teema linkittää."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/fr/messages.po b/fluxer_app/src/features/i18n/locales/fr/messages.poindex 66d09e142..7ba3185b1 100644--- a/fluxer_app/src/features/i18n/locales/fr/messages.po+++ b/fluxer_app/src/features/i18n/locales/fr/messages.po@@ -16791,10 +16791,10 @@ msgstr "Floride"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer ajoute un numéro aléatoire à chaque nom d'utilisateur, comme alex#4821, pour que plusieurs personnes puissent utiliser le même nom."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer a bloqué le chargement de {url}. Importez-le comme ressource."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer a bloqué le chargement de {url}. Importez le fichier comme ressource ou utilisez un lien de pièce jointe pour une image."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer ne peut pas ouvrir ce dossier. Réimportez-le pour continuer à lmsgid "Fluxer can't read this folder."msgstr "Fluxer ne peut pas lire ce dossier."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer n'a pas pu appliquer ce CSS. Vérifiez qu'il ne contient pas de commentaire, de chaîne ou de parenthèse cassés."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer n'a pas pu joindre {instanceName} pour vérifier si votre navigatmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer a arrêté de vérifier si le navigateur a approuvé cette connexion. Il n'a pas perdu votre code."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer ne chargera pas {count, plural, one {# fichier} other {# fichiers}} sur d'autres sites vers lesquels ce thème renvoie."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/he/messages.po b/fluxer_app/src/features/i18n/locales/he/messages.poindex c217de6b3..d6eb89756 100644--- a/fluxer_app/src/features/i18n/locales/he/messages.po+++ b/fluxer_app/src/features/i18n/locales/he/messages.po@@ -16791,10 +16791,10 @@ msgstr "פלורידה"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer מוסיף מספר אקראי לכל שם משתמש, כמו alex#4821, כדי שאנשים רבים יוכלו להשתמש באותו שם."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer חסם טעינת {url}. העלה אותו כקובץ נכס."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer חסם טעינת {url}. העלה את הקובץ כקובץ נכס, או השתמש בקישור לקובץ מצורף עבור תמונה."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer לא יכול לפתוח את התיקייה הזו. ייבmsgid "Fluxer can't read this folder."msgstr "Fluxer לא מצליח לקרוא את התיקייה הזו."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer לא הצליח להחיל את ה-CSS הזה. בדוק אם יש בו הערה, מחרוזת או סוגר פגומים."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer לא הצליח להתחבר אל {instanceName} כדי לבדוmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer הפסיק לבדוק אם הדפדפן אישר את הכניסה הזו. הוא לא איבד את הקוד שלך."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer לא יטען {count, plural, one {קובץ אחד} two {# קבצים} other {# קבצים}} מאתרים אחרים שערכת הנושא הזו מקשרת אליהם."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/hi/messages.po b/fluxer_app/src/features/i18n/locales/hi/messages.poindex 15886c9f4..afca3bc9a 100644--- a/fluxer_app/src/features/i18n/locales/hi/messages.po+++ b/fluxer_app/src/features/i18n/locales/hi/messages.po@@ -16791,10 +16791,10 @@ msgstr "फ़्लोरिडा"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer हर यूज़रनेम में एक रैंडम नंबर जोड़ता है, जैसे alex#4821, ताकि कई लोग एक ही नाम इस्तेमाल कर सकें।"-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "फ्लक्सर ने {url} लोड होने से रोका। इसे एसेट के रूप में अपलोड करें।"+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "फ्लक्सर ने {url} लोड होने से रोका। फ़ाइल को एसेट के रूप में अपलोड करें, या इमेज के लिए अटैचमेंट लिंक का उपयोग करें।"#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer इस फ़ोल्डर को नहीं खोल सकmsgid "Fluxer can't read this folder."msgstr "Fluxer इस फ़ोल्डर को नहीं पढ़ सकता।"+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "फ्लक्सर यह CSS लागू नहीं कर सका। देखें कि कोई टिप्पणी, स्ट्रिंग या ब्रैकेट टूटा हुआ तो नहीं है।"+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer यह जांचने के लिए {instanceName} तकmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer ने यह जांचना बंद कर दिया कि ब्राउज़र ने इस साइन-इन को मंजूरी दी है या नहीं। इसने आपका कोड नहीं खोया है।"+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "फ्लक्सर अन्य साइटों की {count, plural, one {# फ़ाइल} other {# फ़ाइलें}} लोड नहीं करेगा जिनसे यह थीम लिंक करती है।"+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/hr/messages.po b/fluxer_app/src/features/i18n/locales/hr/messages.poindex 860b9ba35..04ecda555 100644--- a/fluxer_app/src/features/i18n/locales/hr/messages.po+++ b/fluxer_app/src/features/i18n/locales/hr/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer svakom korisničkom imenu dodaje nasumični broj, npr. alex#4821, kako bi više ljudi moglo koristiti isto ime."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer je blokirao učitavanje {url}. Učitaj ga kao resurs."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer je blokirao učitavanje {url}. Učitaj datoteku kao resurs ili za sliku upotrijebi poveznicu na privitak."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer ne može otvoriti ovu mapu. Uvezi je ponovno da bi nastavio pratimsgid "Fluxer can't read this folder."msgstr "Fluxer ne može pročitati ovu mapu."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer nije mogao primijeniti ovaj CSS. Provjeri ima li neispravan komentar, niz ili zagradu."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer nije mogao doći do {instanceName} kako bi provjerio je li tvoj pmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer je prestao provjeravati je li preglednik odobrio ovu prijavu. Nije izgubio vaš kod."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer neće učitati {count, plural, one {# datoteku} few {# datoteke} other {# datoteka}} s drugih web-mjesta na koja ova tema vodi."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/hu/messages.po b/fluxer_app/src/features/i18n/locales/hu/messages.poindex 0c0bdc1ea..db1fcb7aa 100644--- a/fluxer_app/src/features/i18n/locales/hu/messages.po+++ b/fluxer_app/src/features/i18n/locales/hu/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "A Fluxer minden felhasználónévhez véletlen számot fűz, például alex#4821, így többen is használhatják ugyanazt a nevet."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "A Fluxer blokkolta a(z) {url} betöltését. Töltsd fel erőforrásként."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "A Fluxer blokkolta a(z) {url} betöltését. Töltsd fel a fájlt erőforrásként, vagy képhez használj mellékletlinket."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "A Fluxer nem tudja megnyitni ezt a mappát. Importáld újra, hogy továmsgid "Fluxer can't read this folder."msgstr "A Fluxer nem tudja olvasni ezt a mappát."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "A Fluxer nem tudta alkalmazni ezt a CSS-t. Ellenőrizd, nincs-e benne hibás megjegyzés, karakterlánc vagy zárójel."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "A Fluxer nem érte el a(z) {instanceName} szervert, hogy ellenőrizze, jmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "A Fluxer abbahagyta annak ellenőrzését, hogy a böngésző jóváhagyta-e ezt a bejelentkezést. Nem veszítette el a kódodat."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "A Fluxer nem tölt be {count, plural, one {# fájlt} other {# fájlt}} más webhelyekről, amelyekre ez a téma hivatkozik."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/id/messages.po b/fluxer_app/src/features/i18n/locales/id/messages.poindex 48d9395b2..b3da19b45 100644--- a/fluxer_app/src/features/i18n/locales/id/messages.po+++ b/fluxer_app/src/features/i18n/locales/id/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer menambahkan nomor acak ke setiap nama pengguna, seperti alex#4821, sehingga banyak orang bisa memakai nama yang sama."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer memblokir pemuatan {url}. Unggah sebagai aset."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer memblokir pemuatan {url}. Unggah file sebagai aset, atau gunakan tautan lampiran untuk gambar."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer tidak bisa membuka folder ini. Impor lagi untuk terus memantau."msgid "Fluxer can't read this folder."msgstr "Fluxer tidak bisa membaca folder ini."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer tidak dapat menerapkan CSS ini. Periksa apakah ada komentar, string, atau tanda kurung yang rusak."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer tidak dapat menjangkau {instanceName} untuk memeriksa apakah browmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer berhenti memeriksa apakah browser menyetujui login ini. Kode Anda tidak hilang."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer tidak akan memuat {count, plural, other {# file}} di situs lain yang ditautkan oleh tema ini."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/it/messages.po b/fluxer_app/src/features/i18n/locales/it/messages.poindex f4f5d310a..f37dff7c8 100644--- a/fluxer_app/src/features/i18n/locales/it/messages.po+++ b/fluxer_app/src/features/i18n/locales/it/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer aggiunge un numero casuale a ogni nome utente, come alex#4821, così più persone possono usare lo stesso nome."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer ha bloccato il caricamento di {url}. Caricalo come risorsa."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer ha bloccato il caricamento di {url}. Carica il file come risorsa o usa un link a un allegato per un'immagine."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer non può aprire questa cartella. Importala di nuovo per continuarmsgid "Fluxer can't read this folder."msgstr "Fluxer non può leggere questa cartella."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer non ha potuto applicare questo CSS. Controlla che non ci siano commenti, stringhe o parentesi danneggiati."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer non è riuscito a raggiungere {instanceName} per controllare se imsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer ha smesso di controllare se il browser ha approvato l'accesso. Non ha perso il tuo codice."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer non caricherà {count, plural, one {# file} other {# file}} su altri siti a cui rimanda questo tema."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/ja/messages.po b/fluxer_app/src/features/i18n/locales/ja/messages.poindex 483141cba..cc3b86a9f 100644--- a/fluxer_app/src/features/i18n/locales/ja/messages.po+++ b/fluxer_app/src/features/i18n/locales/ja/messages.po@@ -16791,10 +16791,10 @@ msgstr "フロリダ州"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxerは各ユーザー名にalex#4821のようなランダムな番号を付けるので、多くの人が同じ名前を使えます。"-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxerは{url}の読み込みをブロックしました。アセットとしてアップロードしてください。"+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxerは{url}の読み込みをブロックしました。ファイルをアセットとしてアップロードするか、画像の場合は添付ファイルのリンクを使ってください。"#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxerはこのフォルダーを開けません。もう一度インポmsgid "Fluxer can't read this folder."msgstr "Fluxerはこのフォルダーを読み込めません。"+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "FluxerはこのCSSを適用できませんでした。コメント、文字列、括弧が壊れていないか確認してください。"+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "ブラウザでこのサインインが承認されたか確認するたmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer はブラウザでのサインイン承認の確認を停止しました。コードは失われていません。"+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxerは、このテーマがリンクしている他のサイト上の{count, plural, other {#個のファイル}}を読み込みません。"+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/ko/messages.po b/fluxer_app/src/features/i18n/locales/ko/messages.poindex 0a7bd30fd..480b47ab9 100644--- a/fluxer_app/src/features/i18n/locales/ko/messages.po+++ b/fluxer_app/src/features/i18n/locales/ko/messages.po@@ -16791,10 +16791,10 @@ msgstr "플로리다"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer가 alex#4821처럼 사용자 이름마다 임의의 번호를 붙이므로 여러 사람이 같은 이름을 사용할 수 있습니다."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer가 {url} 불러오기를 차단했어요. 에셋으로 업로드하세요."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer가 {url} 불러오기를 차단했어요. 파일을 에셋으로 업로드하거나 이미지라면 첨부 파일 링크를 사용하세요."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer에서 이 폴더를 열 수 없습니다. 계속 감시하려면msgid "Fluxer can't read this folder."msgstr "Fluxer가 이 폴더를 읽을 수 없습니다."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer가 이 CSS를 적용할 수 없었어요. 주석, 문자열, 괄호가 깨지지 않았는지 확인하세요."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer가 브라우저에서 이 로그인을 승인했는지 확인하msgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer가 브라우저에서 이 로그인을 승인했는지 확인을 중단했습니다. 코드는 잃지 않았습니다."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer는 이 테마가 링크한 다른 사이트의 파일 {count, plural, other {#개}}를 불러오지 않아요."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/lt/messages.po b/fluxer_app/src/features/i18n/locales/lt/messages.poindex 78f71d1f4..5efb6de61 100644--- a/fluxer_app/src/features/i18n/locales/lt/messages.po+++ b/fluxer_app/src/features/i18n/locales/lt/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer prie kiekvieno naudotojo vardo prideda atsitiktinį numerį, pvz., alex#4821, kad tą patį vardą galėtų naudoti daug žmonių."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer užblokavo {url} įkėlimą. Įkelk kaip išteklį."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer užblokavo {url} įkėlimą. Įkelk failą kaip išteklį arba paveikslėliui naudok priedo nuorodą."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer negali atidaryti šio aplanko. Importuokite jį dar kartą, kad gmsgid "Fluxer can't read this folder."msgstr "Fluxer negali perskaityti šio aplanko."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer nepavyko pritaikyti šio CSS. Patikrink, ar nėra sugadinto komentaro, eilutės ar skliausto."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer nepavyko pasiekti {instanceName} ir patikrinti, ar naršyklė patmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer nustojo tikrinti, ar naršyklė patvirtino šį prisijungimą. Ji neprarado jūsų kodo."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer neįkels {count, plural, one {# failo} few {# failų} other {# failų}} iš kitų svetainių, į kurias nukreipia ši tema."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/nl/messages.po b/fluxer_app/src/features/i18n/locales/nl/messages.poindex 946583b08..9d209752a 100644--- a/fluxer_app/src/features/i18n/locales/nl/messages.po+++ b/fluxer_app/src/features/i18n/locales/nl/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer zet een willekeurig nummer achter elke gebruikersnaam, zoals alex#4821, zodat veel mensen dezelfde naam kunnen gebruiken."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer blokkeerde het laden van {url}. Upload het als bestand."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer blokkeerde het laden van {url}. Upload het als bestand of gebruik voor een afbeelding een bijlagelink."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer kan deze map niet openen. Importeer hem opnieuw om hem te blijvenmsgid "Fluxer can't read this folder."msgstr "Fluxer kan deze map niet lezen."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer kon deze CSS niet toepassen. Controleer op een kapotte opmerking, tekenreeks of haak."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer kon {instanceName} niet bereiken om te controleren of je browsermsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer is gestopt met controleren of de browser deze aanmelding goedkeurde. Je code is niet verloren gegaan."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer laadt {count, plural, one {# bestand} other {# bestanden}} niet op andere sites waarnaar dit thema linkt."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/no/messages.po b/fluxer_app/src/features/i18n/locales/no/messages.poindex 312f3038b..0d07433f6 100644--- a/fluxer_app/src/features/i18n/locales/no/messages.po+++ b/fluxer_app/src/features/i18n/locales/no/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer legger til et tilfeldig nummer på hvert brukernavn, som alex#4821, slik at mange kan bruke samme navn."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer blokkerte lasting av {url}. Last den opp som en ressurs."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer blokkerte lasting av {url}. Last opp filen som en ressurs, eller bruk en vedleggslenke for et bilde."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer kan ikke åpne denne mappen. Importer den på nytt for å fortsetmsgid "Fluxer can't read this folder."msgstr "Fluxer kan ikke lese denne mappen."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer kunne ikke bruke denne CSS-en. Sjekk den for en ødelagt kommentar, streng eller parentes."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer fikk ikke kontakt med {instanceName} for å sjekke om nettleserenmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer sluttet å sjekke om nettleseren godkjente denne påloggingen. Den mistet ikke koden din."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer laster ikke {count, plural, one {# fil} other {# filer}} på andre nettsteder som dette temaet lenker til."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/pl/messages.po b/fluxer_app/src/features/i18n/locales/pl/messages.poindex 0ed8edfaa..2aaba792b 100644--- a/fluxer_app/src/features/i18n/locales/pl/messages.po+++ b/fluxer_app/src/features/i18n/locales/pl/messages.po@@ -16791,10 +16791,10 @@ msgstr "Floryda"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer dodaje losowy numer do każdej nazwy użytkownika, np. alex#4821, aby wiele osób mogło używać tej samej nazwy."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer zablokował ładowanie {url}. Prześlij to jako zasób."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer zablokował ładowanie {url}. Prześlij plik jako zasób lub użyj linku do załącznika w przypadku obrazu."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer nie może otworzyć tego folderu. Zaimportuj go ponownie, aby dalmsgid "Fluxer can't read this folder."msgstr "Fluxer nie może odczytać tego folderu."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer nie mógł zastosować tego CSS. Sprawdź, czy nie ma w nim uszkodzonego komentarza, ciągu znaków lub nawiasu."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer nie mógł połączyć się z {instanceName}, aby sprawdzić, czymsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer przestał sprawdzać, czy przeglądarka zatwierdziła to logowanie. Nie stracił Twojego kodu."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer nie wczyta {count, plural, one {# pliku} few {# plików} many {# plików} other {# pliku}} z innych witryn, do których prowadzi ten motyw."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po b/fluxer_app/src/features/i18n/locales/pt-BR/messages.poindex 6a1103f2c..fbb87453c 100644--- a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po+++ b/fluxer_app/src/features/i18n/locales/pt-BR/messages.po@@ -16791,10 +16791,10 @@ msgstr "Flórida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "O Fluxer adiciona um número aleatório a cada nome de usuário, como alex#4821, para que muitas pessoas possam usar o mesmo nome."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "O Fluxer bloqueou o carregamento de {url}. Envie como um recurso."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "O Fluxer bloqueou o carregamento de {url}. Envie o arquivo como um recurso ou use um link de anexo para uma imagem."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "O Fluxer não pode abrir esta pasta. Importe novamente para continuar acmsgid "Fluxer can't read this folder."msgstr "O Fluxer não consegue ler esta pasta."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "O Fluxer não conseguiu aplicar este CSS. Verifique se há um comentário, uma string ou um colchete quebrado."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "O Fluxer não conseguiu acessar {instanceName} para verificar se o navegmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "O Fluxer parou de verificar se o navegador aprovou este login. Ele não perdeu seu código."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "O Fluxer não vai carregar {count, plural, one {# arquivo} other {# arquivos}} em outros sites para os quais este tema aponta."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/ro/messages.po b/fluxer_app/src/features/i18n/locales/ro/messages.poindex ac1967e18..9526cc661 100644--- a/fluxer_app/src/features/i18n/locales/ro/messages.po+++ b/fluxer_app/src/features/i18n/locales/ro/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer adaugă un număr aleatoriu la fiecare nume de utilizator, de exemplu alex#4821, ca mai mulți oameni să poată folosi același nume."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer a blocat încărcarea {url}. Încarcă-l ca resursă."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer a blocat încărcarea {url}. Încarcă fișierul ca resursă sau folosește un link de atașament pentru o imagine."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer nu poate deschide acest dosar. Importă-l din nou ca să continuemsgid "Fluxer can't read this folder."msgstr "Fluxer nu poate citi acest dosar."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer nu a putut aplica acest CSS. Verifică dacă există un comentariu, un șir sau o paranteză defectă."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer nu a putut contacta {instanceName} pentru a verifica dacă browsemsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer a încetat să mai verifice dacă browserul a aprobat această autentificare. Nu și-a pierdut codul."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer nu va încărca {count, plural, one {# fișier} few {# fișiere} other {# de fișiere}} de pe alte site-uri către care trimite această temă."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/ru/messages.po b/fluxer_app/src/features/i18n/locales/ru/messages.poindex 80b3e311a..2d2be380d 100644--- a/fluxer_app/src/features/i18n/locales/ru/messages.po+++ b/fluxer_app/src/features/i18n/locales/ru/messages.po@@ -16791,10 +16791,10 @@ msgstr "Флорида"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer добавляет к каждому имени пользователя случайный номер, например alex#4821, чтобы одно имя могли использовать многие."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer заблокировал загрузку {url}. Загрузите это как ресурс."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer заблокировал загрузку {url}. Загрузите файл как ресурс или используйте ссылку на вложение для изображения."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer не может открыть эту папку. Импортиmsgid "Fluxer can't read this folder."msgstr "Fluxer не может прочитать эту папку."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer не удалось применить этот CSS. Проверьте, нет ли в нём повреждённого комментария, строки или скобки."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer не смог связаться с {instanceName}, чтобы пmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer перестал проверять, одобрил ли браузер этот вход. Ваш код не потерян."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer не загрузит {count, plural, one {# файл} few {# файла} many {# файлов} other {# файла}} с других сайтов, на которые ссылается эта тема."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po b/fluxer_app/src/features/i18n/locales/sv-SE/messages.poindex 5b351dd73..913314efb 100644--- a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po+++ b/fluxer_app/src/features/i18n/locales/sv-SE/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer lägger till ett slumpat nummer på varje användarnamn, som alex#4821, så att många kan använda samma namn."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer blockerade laddning av {url}. Ladda upp den som en resurs."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer blockerade laddning av {url}. Ladda upp filen som en resurs eller använd en bilagelänk för en bild."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer kan inte öppna den här mappen. Importera den igen för att fortmsgid "Fluxer can't read this folder."msgstr "Fluxer kan inte läsa den här mappen."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer kunde inte använda den här CSS-koden. Kontrollera om en kommentar, sträng eller parentes är trasig."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer kunde inte nå {instanceName} för att kontrollera om webbläsaremsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer slutade kontrollera om webbläsaren godkände inloggningen. Den tappade inte bort din kod."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer laddar inte {count, plural, one {# fil} other {# filer}} på andra webbplatser som det här temat länkar till."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/th/messages.po b/fluxer_app/src/features/i18n/locales/th/messages.poindex af24e23f4..c46557b02 100644--- a/fluxer_app/src/features/i18n/locales/th/messages.po+++ b/fluxer_app/src/features/i18n/locales/th/messages.po@@ -16791,10 +16791,10 @@ msgstr "ฟลอริดา"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer จะเพิ่มตัวเลขสุ่มต่อท้ายชื่อผู้ใช้แต่ละชื่อ เช่น alex#4821 เพื่อให้หลายคนใช้ชื่อเดียวกันได้"-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer บล็อกการโหลด {url} ให้อัปโหลดเป็นไฟล์ประกอบ"+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer บล็อกการโหลด {url} ให้อัปโหลดไฟล์เป็นไฟล์ประกอบ หรือใช้ลิงก์ไฟล์แนบสำหรับรูปภาพ"#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer ไม่สามารถเปิดโฟลเดอร์msgid "Fluxer can't read this folder."msgstr "Fluxer ไม่สามารถอ่านโฟลเดอร์นี้ได้"+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer ใช้ CSS นี้ไม่ได้ ให้ตรวจสอบว่ามีคอมเมนต์ สตริง หรือวงเล็บที่เสียหายหรือไม่"+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer ไม่สามารถเชื่อมต่อกับ {msgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer หยุดตรวจสอบว่าเบราว์เซอร์อนุมัติการลงชื่อเข้านี้หรือไม่ ไม่ได้ลบโค้ดของคุณไป"+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer จะไม่โหลด {count, plural, other {# ไฟล์}} บนเว็บไซต์อื่นที่ธีมนี้ลิงก์ไป"+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/tr/messages.po b/fluxer_app/src/features/i18n/locales/tr/messages.poindex db1a34a6b..6b2b54f51 100644--- a/fluxer_app/src/features/i18n/locales/tr/messages.po+++ b/fluxer_app/src/features/i18n/locales/tr/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer her kullanıcı adına alex#4821 gibi rastgele bir numara ekler, böylece birçok kişi aynı adı kullanabilir."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer {url} yüklenmesini engelledi. Onu bir öğe olarak yükle."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer {url} yüklenmesini engelledi. Dosyayı bir öğe olarak yükle veya bir görsel için ek bağlantısı kullan."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer bu klasörü açamıyor. İzlemeye devam etmek için tekrar içemsgid "Fluxer can't read this folder."msgstr "Fluxer bu klasörü okuyamıyor."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer bu CSS'i uygulayamadı. Bozuk bir yorum, dize veya parantez olup olmadığını kontrol et."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer, tarayıcınızın bu oturum açmayı onaylayıp onaylamadığınmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer, tarayıcının bu oturum açma işlemini onaylayıp onaylamadığını kontrol etmeyi bıraktı. Kodunuzu kaybetmedi."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer, bu temanın bağlantı verdiği diğer sitelerdeki {count, plural, one {# dosyayı} other {# dosyayı}} yüklemeyecek."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/uk/messages.po b/fluxer_app/src/features/i18n/locales/uk/messages.poindex f747f7912..e7fad3440 100644--- a/fluxer_app/src/features/i18n/locales/uk/messages.po+++ b/fluxer_app/src/features/i18n/locales/uk/messages.po@@ -16791,10 +16791,10 @@ msgstr "Флорида"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer додає до кожного імені користувача випадковий номер, наприклад alex#4821, щоб одне ім'я могли використовувати багато людей."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer заблокував завантаження {url}. Завантажте це як ресурс."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer заблокував завантаження {url}. Завантажте файл як ресурс або скористайтеся посиланням на вкладення для зображення."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer не може відкрити цю папку. Імпортуйmsgid "Fluxer can't read this folder."msgstr "Fluxer не може прочитати цю папку."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer не вдалося застосувати цей CSS. Перевірте, чи немає в ньому пошкодженого коментаря, рядка або дужки."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer не зміг зв’язатися з {instanceName}, щоб пmsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer припинив перевіряти, чи браузер схвалив цей вхід. Ваш код не втрачено."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer не завантажить {count, plural, one {# файл} few {# файли} many {# файлів} other {# файла}} з інших сайтів, на які посилається ця тема."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/vi/messages.po b/fluxer_app/src/features/i18n/locales/vi/messages.poindex 9f6b33992..8809ef145 100644--- a/fluxer_app/src/features/i18n/locales/vi/messages.po+++ b/fluxer_app/src/features/i18n/locales/vi/messages.po@@ -16791,10 +16791,10 @@ msgstr "Florida"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer thêm một số ngẫu nhiên vào mỗi tên người dùng, như alex#4821, để nhiều người có thể dùng cùng một tên."-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer đã chặn tải {url}. Hãy tải lên như một tài nguyên."+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer đã chặn tải {url}. Hãy tải tệp lên như một tài nguyên hoặc dùng liên kết tệp đính kèm cho hình ảnh."#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer không thể mở thư mục này. Nhập lại để tiếp tụmsgid "Fluxer can't read this folder."msgstr "Fluxer không thể đọc thư mục này."+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer không thể áp dụng CSS này. Hãy kiểm tra xem có chú thích, chuỗi hoặc dấu ngoặc nào bị hỏng không."+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer không thể kết nối với {instanceName} để kiểm tra xemsgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer đã ngừng kiểm tra xem trình duyệt có phê duyệt đăng nhập này không. Mã của bạn vẫn còn nguyên."+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer sẽ không tải {count, plural, other {# tệp}} trên các trang khác mà chủ đề này liên kết tới."+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po b/fluxer_app/src/features/i18n/locales/zh-CN/messages.poindex e41d553f9..38a72537c 100644--- a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po+++ b/fluxer_app/src/features/i18n/locales/zh-CN/messages.po@@ -16791,10 +16791,10 @@ msgstr "佛罗里达州"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer 会在每个用户名后加上一个随机编号,例如 alex#4821,这样很多人可以使用同一个名字。"-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer 阻止加载 {url}。请作为素材上传。"+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer 阻止加载 {url}。请将文件作为素材上传,图片也可以使用附件链接。"#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer 无法打开此文件夹。请重新导入以继续监视。"msgid "Fluxer can't read this folder."msgstr "Fluxer 无法读取此文件夹。"+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer 无法应用此 CSS。请检查是否有损坏的注释、字符串或括号。"+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer 无法连接到 {instanceName} 来检查浏览器是否已批准msgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer 停止检查浏览器是否已批准此登录。您的代码未丢失。"+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer 不会加载此主题链接到其他网站上的 {count, plural, other {# 个文件}}。"+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po b/fluxer_app/src/features/i18n/locales/zh-TW/messages.poindex 1c9d51a97..9e8fa5e58 100644--- a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po+++ b/fluxer_app/src/features/i18n/locales/zh-TW/messages.po@@ -16791,10 +16791,10 @@ msgstr "佛羅里達州"msgid "Fluxer adds a random number to each username, like alex#4821, so many people can use the same name."msgstr "Fluxer 會在每個使用者名稱後加上一組隨機編號,例如 alex#4821,讓許多人可以使用相同名稱。"-#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".+#. Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".#: src/features/theme_settings/editor/CssLint.ts-msgid "Fluxer blocked loading {url}. Upload it as an asset."-msgstr "Fluxer 已封鎖載入 {url}。請將其上傳為素材。"+msgid "Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image."+msgstr "Fluxer 已封鎖載入 {url}。請將檔案上傳為素材,圖片也可以使用附件連結。"#. Problem shown in the quick CSS editor on a reference to an uploaded theme asset that does not exist.#: src/features/theme_settings/editor/CssLint.ts@@ -16821,6 +16821,11 @@ msgstr "Fluxer 無法開啟這個資料夾。請重新匯入以繼續監控。"msgid "Fluxer can't read this folder."msgstr "Fluxer 無法讀取這個資料夾。"+#. Problem shown at the top of the quick CSS editor when the whole sheet was left out.+#: src/features/theme_settings/editor/CssLint.ts+msgid "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket."+msgstr "Fluxer 無法套用此 CSS。請檢查是否有損壞的註解、字串或括號。"+#. Alert when the SMTP check fails and the mail server sent no reply. host is the mail server address.#: src/features/app/components/setup/SetupEmailSteps.tsxmsgid "Fluxer couldn't connect to {host}."@@ -16841,6 +16846,11 @@ msgstr "Fluxer 無法連線到 {instanceName} 來檢查瀏覽器是否已核准msgid "Fluxer stopped checking whether the browser approved this sign-in. It didn't lose your code."msgstr "Fluxer 已停止檢查瀏覽器是否核准此登入。您的驗證碼並未遺失。"+#. Shown in the modal that applies a shared theme when the theme points at files the app will not load.+#: src/features/theme/components/modals/ThemeAcceptModal.tsx+msgid "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites."+msgstr "Fluxer 不會載入此主題連結到其他網站上的 {count, plural, other {# 個檔案}}。"+#. Settings search synonym. Used to match this term when the user types it in the settings search bar.#: src/features/user/components/settings_utils/section_registry/AccessibilitySections.tsmsgid "Focus"diff --git a/fluxer_app/src/features/messaging/components/markdown/renderers/LinkRenderer.tsx b/fluxer_app/src/features/messaging/components/markdown/renderers/LinkRenderer.tsxindex 89a7bf85c..209ef61ef 100644--- a/fluxer_app/src/features/messaging/components/markdown/renderers/LinkRenderer.tsx+++ b/fluxer_app/src/features/messaging/components/markdown/renderers/LinkRenderer.tsx@@ -1076,7 +1076,7 @@ export const LinkRenderer = observer(function LinkRenderer({logger.warn('Invalid URL in link:', url);}}- const href = AttachmentUrlRefresher.fresh(url);+ const href = AttachmentUrlRefresher.fresh(url, {refreshUnsigned: true});const warmAttachmentUrl = () => AttachmentUrlRefresher.warm(url);const showDestinationTooltip = text != null;const linkElement = (diff --git a/fluxer_app/src/features/messaging/components/modals/ExternalLinkWarningModal.tsx b/fluxer_app/src/features/messaging/components/modals/ExternalLinkWarningModal.tsxindex 180988bed..9f579bbd4 100644--- a/fluxer_app/src/features/messaging/components/modals/ExternalLinkWarningModal.tsx+++ b/fluxer_app/src/features/messaging/components/modals/ExternalLinkWarningModal.tsx@@ -4,6 +4,7 @@ import * as Modal from '@app/features/app/components/dialogs/Modal';import {getActiveInstanceProductName} from '@app/features/app/state/ActiveInstanceProductName';import styles from '@app/features/messaging/components/modals/ExternalLinkWarningModal.module.css';import {remFromPx} from '@app/features/theme/layout/RemFromPx';+import {useCustomCssSuspension} from '@app/features/theme/state/CustomCssSuspension';import TrustedDomain from '@app/features/trusted_domain/state/TrustedDomain';import {Button} from '@app/features/ui/button/Button';import {Checkbox} from '@app/features/ui/checkbox/Checkbox';@@ -25,6 +26,7 @@ const LEAVING_PRODUCT_DESCRIPTOR = msg({comment: 'External link warning title. productName is the Fluxer product name.',});export const ExternalLinkWarningModal = observer(({url}: {url: string}) => {+ useCustomCssSuspension();const {i18n} = useLingui();const [trustDomain, setTrustDomain] = useState(false);const initialFocusRef = useRef<HTMLButtonElement | null>(null);diff --git a/fluxer_app/src/features/messaging/components/modals/ForwardMessagePreviewContent.ts b/fluxer_app/src/features/messaging/components/modals/ForwardMessagePreviewContent.tsindex a7b3bc855..3ac6a8c76 100644--- a/fluxer_app/src/features/messaging/components/modals/ForwardMessagePreviewContent.ts+++ b/fluxer_app/src/features/messaging/components/modals/ForwardMessagePreviewContent.ts@@ -3,6 +3,7 @@import {isMediaAttachment} from '@app/features/channel/components/MessageAttachmentUtils';import type {ForwardMediaSelection} from '@app/features/messaging/commands/MessageCommands';import type {Message} from '@app/features/messaging/models/MessagingMessage';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import {buildMediaProxyURL,snapMediaProxyImageSize,@@ -190,7 +191,7 @@ function resolveAttachmentThumbnail(const proxyUrl = attachment.proxy_url ?? attachment.url;if (proxyUrl == null) return null;return Object.freeze({- proxyUrl,+ proxyUrl: AttachmentUrlRefresher.fresh(proxyUrl),isVideo: kind === 'video',showsPlayIcon,showsFilePlaceholder: kind === 'file',@@ -207,7 +208,7 @@ function resolveEmbedThumbnail(embed: MessageEmbed | undefined): ForwardMessagePconst isSensitive =embed.nsfw === true || thumbnail.nsfw === true || (thumbnail.flags & EmbedMediaFlags.CONTAINS_EXPLICIT_MEDIA) !== 0;return Object.freeze({- proxyUrl: thumbnail.proxy_url,+ proxyUrl: AttachmentUrlRefresher.fresh(thumbnail.proxy_url),isVideo: false,showsPlayIcon: false,showsFilePlaceholder: false,diff --git a/fluxer_app/src/features/messaging/components/modals/MediaModal.tsx b/fluxer_app/src/features/messaging/components/modals/MediaModal.tsxindex bc755dc6f..aa4c0984b 100644--- a/fluxer_app/src/features/messaging/components/modals/MediaModal.tsx+++ b/fluxer_app/src/features/messaging/components/modals/MediaModal.tsx@@ -32,6 +32,7 @@ import {VIDEO_PREVIEW_DESCRIPTOR,type ZoomState,} from '@app/features/messaging/components/modals/media_modal/shared';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import {remFromPx} from '@app/features/theme/layout/RemFromPx';import * as MediaViewerCommands from '@app/features/ui/commands/MediaViewerCommands';import {Scroller} from '@app/features/ui/components/Scroller';@@ -622,6 +623,7 @@ export const MediaModal: FC<MediaModalProps> = observer(playsInlinepreload="metadata"aria-label={thumb.alt ?? i18n._(VIDEO_PREVIEW_DESCRIPTOR)}+ onError={() => void AttachmentUrlRefresher.refresh(thumb.src, {force: true})}data-flx="messaging.media-modal.thumbnail-video"/>);@@ -641,6 +643,7 @@ export const MediaModal: FC<MediaModalProps> = observer(alt={thumb.alt ?? ''}className={styles.thumbnailImage}draggable={false}+ onError={() => void AttachmentUrlRefresher.refresh(thumb.src, {force: true})}data-flx="messaging.media-modal.thumbnail-image"/>);diff --git a/fluxer_app/src/features/messaging/components/modals/MediaViewerModal.tsx b/fluxer_app/src/features/messaging/components/modals/MediaViewerModal.tsxindex 06e4f47ef..30ae4e9ef 100644--- a/fluxer_app/src/features/messaging/components/modals/MediaViewerModal.tsx+++ b/fluxer_app/src/features/messaging/components/modals/MediaViewerModal.tsx@@ -16,10 +16,12 @@ import type {ForwardModalSuccess} from '@app/features/messaging/components/modalimport {MediaModal} from '@app/features/messaging/components/modals/MediaModal';import styles from '@app/features/messaging/components/modals/MediaViewerModal.module.css';import {getMediaViewerPortalRoot} from '@app/features/messaging/components/modals/MediaViewerPortal';+import {useAttachmentRefreshOnError} from '@app/features/messaging/hooks/useAttachmentRefreshOnError';import {useDeleteAttachment} from '@app/features/messaging/hooks/useDeleteAttachment';import {useMediaFavorite} from '@app/features/messaging/hooks/useMediaFavorite';import type {Message} from '@app/features/messaging/models/MessagingMessage';import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';+import {attachmentUrlMayNeedRefresh} from '@app/features/messaging/utils/AttachmentCdnUrl';import {formatAttachmentDate} from '@app/features/messaging/utils/AttachmentExpiryUtils';import {openExternalUrlWithWarning} from '@app/features/messaging/utils/ExternalLinkUtils';import {createDownloadHandler} from '@app/features/messaging/utils/FileDownloadUtils';@@ -277,18 +279,37 @@ const MobileMediaOptionsSheet: FC<MobileMediaOptionsSheetProps> = observer(funct});function withFreshViewerItemUrls(item: MediaViewerItem): MediaViewerItem {if (!item) return item;- const src = AttachmentUrlRefresher.fresh(item.src);- const originalSrc = AttachmentUrlRefresher.fresh(item.originalSrc);+ const src = AttachmentUrlRefresher.fresh(item.src, {refreshUnsigned: true});+ const originalSrc = AttachmentUrlRefresher.fresh(item.originalSrc, {refreshUnsigned: true});if (src === item.src && originalSrc === item.originalSrc) return item;return {...item, src, originalSrc};}+function resolveAdjacentPinUrls(items: ReadonlyArray<MediaViewerItem>, currentIndex: number, isOpen: boolean): string {+ const count = items.length;+ if (!isOpen || count <= 1) return '';+ const adjacentIndices =+ count === 2 ? [(currentIndex + 1) % count] : [(currentIndex - 1 + count) % count, (currentIndex + 1) % count];+ const nowMs = Date.now();+ return adjacentIndices+ .map((index) => items[index])+ .filter(+ (item) =>+ item != null &&+ isViewerImageItem(item) &&+ !item.src.startsWith('blob:') &&+ !attachmentUrlMayNeedRefresh(item.src, nowMs),+ )+ .map(buildViewerMediaURL)+ .join('\n');+}const MediaViewerModalComponent: FC = observer(() => {const {i18n} = useLingui();const {isOpen, items, currentIndex, channelId, messageId, message, sourceChannel, allowAttachmentDelete} =MediaViewer;const {enabled: isMobile} = MobileLayout;const [isMediaMenuOpen, setIsMediaMenuOpen] = useState(false);- const currentItem = withFreshViewerItemUrls(items[currentIndex]);+ const freshItems = items.map(withFreshViewerItemUrls);+ const currentItem = freshItems[currentIndex];const currentGifvIsActualGif = currentItem != null && isGifvRenderedAsImage(currentItem);useBottomSheetBackHandler(isOpen, MediaViewerCommands.closeMediaViewer);useEffect(() => {@@ -298,23 +319,14 @@ const MediaViewerModalComponent: FC = observer(() => {LayerManager.removeLayer('modal', 'media-viewer');};}, [isOpen]);+ const adjacentPinUrls = resolveAdjacentPinUrls(freshItems, currentIndex, isOpen);useEffect(() => {- if (!isOpen || items.length <= 1) return;- const count = items.length;- const adjacentIndices =- count === 2 ? [(currentIndex + 1) % count] : [(currentIndex - 1 + count) % count, (currentIndex + 1) % count];- const unpinCallbacks = adjacentIndices.map((index) => {- const item = items[index];- if (!item) return () => {};- AttachmentUrlRefresher.warm(item.src);- AttachmentUrlRefresher.warm(item.originalSrc);- if (!isViewerImageItem(item) || item.src.startsWith('blob:')) return () => {};- return ImageCacheUtils.pinImage(buildViewerMediaURL(item));- });+ if (adjacentPinUrls.length === 0) return;+ const unpinCallbacks = adjacentPinUrls.split('\n').map((url) => ImageCacheUtils.pinImage(url));return () => {for (const unpin of unpinCallbacks) unpin();};- }, [isOpen, currentIndex, items]);+ }, [adjacentPinUrls]);const defaultName = useMemo(() => {if (!currentItem) return '';return untracked(() =>@@ -492,9 +504,12 @@ const MediaViewerModalComponent: FC = observer(() => {});}, [forwardMediaSelection, message, sourceChannel]);const imageSrc = useMemo(() => (currentItem ? buildViewerMediaURL(currentItem) : ''), [currentItem]);+ const handleImageError = useAttachmentRefreshOnError(imageSrc);+ const handleGifvVideoError = useAttachmentRefreshOnError(currentItem?.src);+ const freshItemSources = freshItems.map((item) => item.src).join('\n');const thumbnails = useMemo(() => {const snappedThumbnailSize = snapMediaProxyImageSize(MEDIA_VIEWER_THUMBNAIL_SIZE);- return items.map((item, index) => {+ return freshItems.map((item, index) => {const name =item.filename ||item.originalSrc.split('/').pop()?.split('?')[0] ||@@ -512,7 +527,7 @@ const MediaViewerModalComponent: FC = observer(() => {type: item.type,};});- }, [items, i18n.locale]);+ }, [freshItemSources, items, i18n.locale]);if (!isOpen || !currentItem) {return null;}@@ -562,6 +577,7 @@ const MediaViewerModalComponent: FC = observer(() => {objectFit: 'contain',}}draggable={false}+ onError={handleImageError}data-flx="messaging.media-viewer-modal.render-media.gifv-image"/>);@@ -580,6 +596,7 @@ const MediaViewerModalComponent: FC = observer(() => {playsInlinecontrols={false}aria-label={i18n._(ANIMATED_VIDEO_DESCRIPTOR)}+ onError={handleGifvVideoError}data-flx="messaging.media-viewer-modal.render-media.gifv-video"><track kind="captions" data-flx="messaging.media-viewer-modal.render-media.track" />@@ -661,6 +678,7 @@ const MediaViewerModalComponent: FC = observer(() => {objectFit: 'contain',}}draggable={false}+ onError={handleImageError}data-flx="messaging.media-viewer-modal.render-media.image"/>);diff --git a/fluxer_app/src/features/messaging/hooks/useMediaLoading.ts b/fluxer_app/src/features/messaging/hooks/useMediaLoading.tsindex 645596cda..5b64ec420 100644--- a/fluxer_app/src/features/messaging/hooks/useMediaLoading.ts+++ b/fluxer_app/src/features/messaging/hooks/useMediaLoading.ts@@ -1,6 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later-import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';+import AttachmentUrlRefresher, {sameAttachmentSource} from '@app/features/messaging/state/AttachmentUrlRefresher';import * as ImageCacheUtils from '@app/features/messaging/utils/ImageCacheUtils';import {decodeThumbHashDataURL} from '@app/features/messaging/utils/ThumbHashUtils';import {type SyntheticEvent, useCallback, useLayoutEffect, useMemo, useRef, useState} from 'react';@@ -101,9 +101,14 @@ function resolveMediaLoadingSourceState(cached: boolean,): MediaLoadingSourceState {if (state.src === src && state.loadEnabled === loadEnabled) return state;+ if (keepsLoadedState(state, src, loadEnabled)) return {...state, src};return createMediaLoadingSourceState(src, loadEnabled, cached);}+function keepsLoadedState(state: MediaLoadingSourceState, src: string, loadEnabled: boolean): boolean {+ return state.loaded && state.loadEnabled === loadEnabled && sameAttachmentSource(state.src, src);+}+function sourceIdentityMatches(currentIdentity: MediaLoadingSourceIdentity,expectedIdentity: MediaLoadingSourceIdentity,@@ -164,7 +169,11 @@ export function useMediaLoading(}}const cached = ImageCacheUtils.hasImage(src);- setSourceState(createMediaLoadingSourceState(src, loadEnabled, cached));+ setSourceState((currentState) =>+ keepsLoadedState(currentState, src, loadEnabled)+ ? {...currentState, src}+ : createMediaLoadingSourceState(src, loadEnabled, cached),+ );}, [loadEnabled, sourceIdentity, src]);const onLoad = useCallback((event: SyntheticEvent<MediaLoadingElement>) => {diff --git a/fluxer_app/src/features/messaging/hooks/useMediaViewerHoverWarm.ts b/fluxer_app/src/features/messaging/hooks/useMediaViewerHoverWarm.tsindex 07a65281b..32622bf21 100644--- a/fluxer_app/src/features/messaging/hooks/useMediaViewerHoverWarm.ts+++ b/fluxer_app/src/features/messaging/hooks/useMediaViewerHoverWarm.ts@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport {useSaveData} from '@app/features/app/hooks/useSaveData';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import * as ImageCacheUtils from '@app/features/messaging/utils/ImageCacheUtils';import {buildViewerMediaURL, isViewerImageItem} from '@app/features/messaging/utils/MediaViewerItemUtils';import type {MediaViewerItem} from '@app/features/ui/state/MediaViewer';@@ -60,7 +61,11 @@ export function useMediaViewerHoverWarm(if (item == null) {return;}- const url = resolveViewerWarmURL(item, {saveData, allowAnimated});+ const src = AttachmentUrlRefresher.freshWhenReady(item.src, {refreshUnsigned: true});+ if (src === null) {+ return;+ }+ const url = resolveViewerWarmURL({...item, src}, {saveData, allowAnimated});if (url == null) {return;}diff --git a/fluxer_app/src/features/messaging/hooks/useMessageSelectionCopy.ts b/fluxer_app/src/features/messaging/hooks/useMessageSelectionCopy.tsindex 1e1256746..a719169ef 100644--- a/fluxer_app/src/features/messaging/hooks/useMessageSelectionCopy.ts+++ b/fluxer_app/src/features/messaging/hooks/useMessageSelectionCopy.ts@@ -1,6 +1,7 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport type {Message} from '@app/features/messaging/models/MessagingMessage';+import {freshAttachmentUrlsInText} from '@app/features/messaging/utils/MessageCopyTextUtils';import {buildMessagePlaintextCopyText} from '@app/features/messaging/utils/MessagePlaintextCopyUtils';import {buildMessageSelectionCopyText} from '@app/features/messaging/utils/MessageSelectionCopyUtils';import {useLingui} from '@lingui/react/macro';@@ -29,10 +30,16 @@ function useMessageSelectionCopy<TElement extends HTMLElement>({getMessagePlaintext,});if (clipboardText === null) {+ const selectedText = selection?.toString() ?? '';+ const freshText = freshAttachmentUrlsInText(selectedText);+ if (freshText !== selectedText) {+ event.preventDefault();+ event.clipboardData.setData('text/plain', freshText);+ }return;}event.preventDefault();- event.clipboardData.setData('text/plain', clipboardText);+ event.clipboardData.setData('text/plain', freshAttachmentUrlsInText(clipboardText));},[getMessagePlaintext],);diff --git a/fluxer_app/src/features/messaging/hooks/useNearViewport.ts b/fluxer_app/src/features/messaging/hooks/useNearViewport.tsindex 245a2f919..e9e6e514f 100644--- a/fluxer_app/src/features/messaging/hooks/useNearViewport.ts+++ b/fluxer_app/src/features/messaging/hooks/useNearViewport.ts@@ -1,9 +1,10 @@// SPDX-License-Identifier: AGPL-3.0-or-later+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import {stripAttachmentSignature} from '@app/features/messaging/utils/AttachmentCdnUrl';import {observeIntersection} from '@app/features/platform/utils/SharedIntersectionObserver';import {LRUCache} from 'lru-cache';-import {createContext, useCallback, useContext, useEffect, useState} from 'react';+import {createContext, useCallback, useContext, useEffect, useRef, useState} from 'react';const DEFAULT_ROOT_MARGIN = '300px';const REMEMBERED_VIEWPORT_KEY_LIMIT = 1000;@@ -86,5 +87,10 @@ export function useNearViewport<T extends Element>({);return stopObserving;}, [disabled, element, isNearViewport, viewportKey, resolveScrollSurface, rootMargin, threshold]);- return {ref, isNearViewport};+ const loadStartedRef = useRef(false);+ const waitingForUrl =+ !loadStartedRef.current && !!rememberKey && AttachmentUrlRefresher.freshWhenReady(rememberKey) === null;+ const readyToLoad = isNearViewport && !waitingForUrl;+ if (readyToLoad) loadStartedRef.current = true;+ return {ref, isNearViewport: readyToLoad};}diff --git a/fluxer_app/src/features/messaging/hooks/useTextareaExpressionHandlers.ts b/fluxer_app/src/features/messaging/hooks/useTextareaExpressionHandlers.tsindex c6658c05d..4e43eb089 100644--- a/fluxer_app/src/features/messaging/hooks/useTextareaExpressionHandlers.ts+++ b/fluxer_app/src/features/messaging/hooks/useTextareaExpressionHandlers.ts@@ -5,6 +5,8 @@ import type {FavoriteMeme} from '@app/features/expressions/models/FavoriteMeme';import type {GuildSticker} from '@app/features/expressions/models/GuildSticker';import * as GifSlugUtils from '@app/features/expressions/utils/GifSlugUtils';import {UploadingAttachment} from '@app/features/messaging/models/UploadingAttachment';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';+import {attachmentUrlMayNeedRefresh} from '@app/features/messaging/utils/AttachmentCdnUrl';import {TextareaSegmentManager} from '@app/features/messaging/utils/TextareaSegmentManager';import {ComponentBus} from '@app/features/platform/utils/ComponentBus';import ActiveComposer from '@app/features/threads/state/ActiveComposer';@@ -53,21 +55,27 @@ export const useTextareaExpressionHandlers = ({[enabled, channelId, previousValueRef, segmentManagerRef, setValue],);useEffect(() => {- const handleGifSelect = (payload?: unknown) => {+ const handleGifSelect = async (payload?: unknown) => {if (!enabled || (channelId != null && !ActiveComposer.accepts(channelId))) return;const {gif, autoSend} = (payload ?? {}) as {gif?: Gif;autoSend?: boolean;};if (!gif) return;- const gifUrl = GifSlugUtils.resolveShareUrl(gif.provider, {url: gif.url, slug: gif.slug});+ const shareUrl = GifSlugUtils.resolveShareUrl(gif.provider, {url: gif.url, slug: gif.slug});+ const gifUrl = attachmentUrlMayNeedRefresh(shareUrl, Date.now())+ ? await AttachmentUrlRefresher.refresh(shareUrl)+ : shareUrl;+ if (channelId != null && !ActiveComposer.accepts(channelId)) return;if (autoSend) {sendOptimisticMessage({content: gifUrl}, {hasAttachments: false});} else {appendText(gifUrl);}};- return ComponentBus.subscribe('GIF_SELECT', handleGifSelect);+ return ComponentBus.subscribe('GIF_SELECT', (payload) => {+ void handleGifSelect(payload);+ });}, [appendText, sendOptimisticMessage, enabled, channelId]);useEffect(() => {const handleStickerSelect = (payload?: unknown) => {@@ -88,8 +96,8 @@ export const useTextareaExpressionHandlers = ({autoSend?: boolean;};if (!meme) return;- const insertMemeUrl = () => {- appendText(meme.url);+ const insertMemeUrl = async () => {+ appendText(await AttachmentUrlRefresher.refresh(meme.url));};const providerShareUrl =meme.gifProvider && meme.gifSlug ? GifSlugUtils.buildShareUrl(meme.gifProvider, meme.gifSlug) : null;@@ -112,7 +120,7 @@ export const useTextareaExpressionHandlers = ({if (providerShareUrl) {appendText(providerShareUrl);} else {- insertMemeUrl();+ void insertMemeUrl();}}};diff --git a/fluxer_app/src/features/messaging/state/AttachmentUrlRefresher.ts b/fluxer_app/src/features/messaging/state/AttachmentUrlRefresher.tsindex 5bf5565ea..59a3744c5 100644--- a/fluxer_app/src/features/messaging/state/AttachmentUrlRefresher.ts+++ b/fluxer_app/src/features/messaging/state/AttachmentUrlRefresher.ts@@ -5,6 +5,7 @@ import {ResettableStates} from '@app/features/app/state/ResettableStates';import RuntimeConfig from '@app/features/app/state/RuntimeConfig';import {ATTACHMENT_URL_REFRESH_MARGIN_MS,+ type AttachmentUrlSignature,applyAttachmentSignature,attachmentCacheKey,attachmentUrlNeedsRefresh,@@ -13,6 +14,7 @@ import {readAttachmentUrlSignature,stripAttachmentSignature,} from '@app/features/messaging/utils/AttachmentCdnUrl';+import {unwrapDesktopLocalResourceURL} from '@app/features/messaging/utils/DesktopResourceUrl';import {resolveRetryAfterMs} from '@app/features/messaging/utils/RetryAfterUtils';import {http} from '@app/features/platform/transport/RestTransport';import {HttpError} from '@app/features/platform/types/EndpointError';@@ -25,24 +27,48 @@ const logger = new Logger('AttachmentUrlRefresher');const FLUSH_WINDOW_MS = 16;const MAX_URLS_PER_REQUEST = 50;const UNSIGNED_RESULT_COOLDOWN_MS = 600_000;-const TRANSPORT_ERROR_COOLDOWN_MS = 30_000;+const REQUEST_FAILURE_COOLDOWN_MS = 30_000;+const REQUEST_FAILURE_MAX_BACKOFF_STEPS = 4;const RATE_LIMIT_FALLBACK_COOLDOWN_MS = 10_000;+const MAX_REQUEST_URL_LENGTH = 2048;+const MIN_SIGNATURE_LIFETIME_MS = 43_200_000;+const MAX_TIMER_DELAY_MS = 2_147_483_647;-type CacheEntry = {kind: 'signature'; fields: string; goodUntilMs: number} | {kind: 'blocked'; untilMs: number};+type CacheEntry =+ | {kind: 'signature'; fields: string; expiresAtMs: number; goodUntilMs: number; usableUntilMs: number}+ | {kind: 'blocked'; untilMs: number};interface QueuedRequest {url: string;resolvers: Array<(fields: string | null) => void>;}+export function sameAttachmentSource(first: string, second: string): boolean {+ if (first === second) return true;+ return (+ stripAttachmentSignature(unwrapDesktopLocalResourceURL(first)) ===+ stripAttachmentSignature(unwrapDesktopLocalResourceURL(second))+ );+}++function isNewerThanUrl(entry: {expiresAtMs: number}, signature: AttachmentUrlSignature | null): boolean {+ return signature === null || entry.expiresAtMs > signature.expiresAtMs;+}+class AttachmentUrlRefresher {entries = new Map<string, CacheEntry>();readonly queued = new Map<string, QueuedRequest>();readonly inFlight = new Map<string, Promise<string | null>>();+ readonly deferred = new Map<string, string>();flushTimer: ReturnType<typeof setTimeout> | null = null;+ wakeTimer: ReturnType<typeof setTimeout> | null = null;+ wakeAtMs = 0;+ retryAtMs = 0;+ requestFailures = 0;cooldownUntilMs = 0;generation = 0;revision = 0;+ wakeups = 0;constructor() {makeAutoObservable(@@ -50,31 +76,65 @@ class AttachmentUrlRefresher {{queued: false,inFlight: false,+ deferred: false,flushTimer: false,+ wakeTimer: false,+ wakeAtMs: false,+ retryAtMs: false,+ requestFailures: false,cooldownUntilMs: false,generation: false,},{autoBind: true},);+ if (typeof window !== 'undefined') {+ window.addEventListener('focus', this.wakeIfDue);+ window.addEventListener('online', this.retryNow);+ document.addEventListener('visibilitychange', this.wakeIfDue);+ }}fresh(url: string, options: {refreshUnsigned?: boolean} = {}): string {if (!url || !isAttachmentCdnUrl(url, RuntimeConfig.mediaEndpoint)) return url;- const signature = readAttachmentUrlSignature(url);- const nowMs = Date.now();- if (signature !== null && signature.expiresAtMs > nowMs + ATTACHMENT_URL_REFRESH_MARGIN_MS) return url;const key = attachmentCacheKey(url);if (key === null) return url;+ void this.wakeups;const entry = this.entries.get(key);- if (entry?.kind === 'signature' && entry.goodUntilMs > nowMs) {- return applyAttachmentSignature(url, entry.fields);+ const signature = readAttachmentUrlSignature(url);+ const nowMs = Date.now();+ if (entry?.kind === 'signature' && entry.usableUntilMs > nowMs) {+ const renewing = entry.goodUntilMs <= nowMs;+ this.wakeAt(renewing ? entry.usableUntilMs : entry.goodUntilMs);+ if (renewing && attachmentUrlNeedsRefresh(url, nowMs)) this.enqueue(key, url, nowMs);+ return isNewerThanUrl(entry, signature) ? applyAttachmentSignature(url, entry.fields) : url;+ }+ if (signature !== null && signature.expiresAtMs > nowMs + ATTACHMENT_URL_REFRESH_MARGIN_MS) {+ this.wakeAt(signature.expiresAtMs - ATTACHMENT_URL_REFRESH_MARGIN_MS);+ return url;}if (signature === null && options.refreshUnsigned !== true) return url;- if (entry?.kind === 'blocked' && entry.untilMs > nowMs) return url;+ if (entry?.kind === 'blocked' && entry.untilMs > nowMs) {+ this.wakeAt(entry.untilMs);+ return url;+ }this.enqueue(key, url, nowMs);return url;}+ freshWhenReady(url: string, options: {refreshUnsigned?: boolean} = {}): string | null {+ const current = this.fresh(url, options);+ if (!current || !isAttachmentCdnUrl(current, RuntimeConfig.mediaEndpoint)) return current;+ const nowMs = Date.now();+ if (nowMs < this.cooldownUntilMs) return current;+ const signature = readAttachmentUrlSignature(current);+ if (signature === null ? options.refreshUnsigned !== true : signature.expiresAtMs > nowMs) return current;+ const key = attachmentCacheKey(current);+ if (key === null) return current;+ const entry = this.entries.get(key);+ if (entry?.kind === 'blocked' || (entry?.kind === 'signature' && entry.usableUntilMs > nowMs)) return current;+ return this.queued.has(key) || this.inFlight.has(key) ? null : current;+ }+warm(url: string): void {if (!url || !isAttachmentCdnUrl(url, RuntimeConfig.mediaEndpoint)) return;const nowMs = Date.now();@@ -88,20 +148,25 @@ class AttachmentUrlRefresher {}async refresh(url: string, options: {force?: boolean} = {}): Promise<string> {- if (!url || !isAttachmentCdnUrl(url, RuntimeConfig.mediaEndpoint)) return url;- const key = attachmentCacheKey(url);+ if (!url) return url;+ const target = unwrapDesktopLocalResourceURL(url);+ if (!isAttachmentCdnUrl(target, RuntimeConfig.mediaEndpoint)) return url;+ const key = attachmentCacheKey(target);if (key === null) return url;const nowMs = Date.now();const entry = untracked(() => this.entries.get(key));if (entry?.kind === 'signature' && entry.goodUntilMs > nowMs) {- return applyAttachmentSignature(url, entry.fields);+ if (isNewerThanUrl(entry, readAttachmentUrlSignature(target))) {+ return applyAttachmentSignature(target, entry.fields);+ }+ if (options.force !== true) return target;}if (options.force !== true) {- if (entry?.kind === 'blocked' && entry.untilMs > nowMs) return url;- if (!attachmentUrlNeedsRefresh(url, nowMs)) return url;+ if (entry?.kind === 'blocked' && entry.untilMs > nowMs) return target;+ if (!attachmentUrlNeedsRefresh(target, nowMs)) return target;}- const fields = await this.request(key, url, nowMs);- return fields === null ? url : applyAttachmentSignature(url, fields);+ const fields = (await this.request(key, target, nowMs)) ?? this.usableFields(key);+ return fields === null ? target : applyAttachmentSignature(target, fields);}reset(): void {@@ -113,24 +178,106 @@ class AttachmentUrlRefresher {}this.queued.clear();this.inFlight.clear();+ this.deferred.clear();this.cooldownUntilMs = 0;+ this.retryAtMs = 0;+ this.requestFailures = 0;if (this.flushTimer !== null) {clearTimeout(this.flushTimer);this.flushTimer = null;}+ if (this.wakeTimer !== null) {+ clearTimeout(this.wakeTimer);+ this.wakeTimer = null;+ }}private forgetExpired(nowMs: number): void {for (const [key, entry] of this.entries) {- const untilMs = entry.kind === 'signature' ? entry.goodUntilMs : entry.untilMs;+ const untilMs = entry.kind === 'signature' ? entry.usableUntilMs : entry.untilMs;if (untilMs <= nowMs) this.entries.delete(key);}}+ private usableFields(key: string): string | null {+ const entry = untracked(() => this.entries.get(key));+ return entry?.kind === 'signature' && entry.usableUntilMs > Date.now() ? entry.fields : null;+ }++ private blockedEntry(key: string, untilMs: number, nowMs: number): CacheEntry {+ const entry = untracked(() => this.entries.get(key));+ if (entry?.kind !== 'signature' || entry.usableUntilMs <= nowMs) return {kind: 'blocked', untilMs};+ return {...entry, goodUntilMs: Math.min(entry.usableUntilMs, Math.max(entry.goodUntilMs, untilMs))};+ }++ private wakeAt(atMs: number): void {+ if (!Number.isFinite(atMs)) return;+ if (this.wakeTimer !== null) {+ if (atMs >= this.wakeAtMs) return;+ clearTimeout(this.wakeTimer);+ }+ this.wakeAtMs = atMs;+ this.wakeTimer = setTimeout(this.wake, Math.min(Math.max(atMs - Date.now(), 0), MAX_TIMER_DELAY_MS));+ }++ private wake(): void {+ this.wakeTimer = null;+ const nowMs = Date.now();+ if (this.wakeAtMs > nowMs) {+ this.wakeAt(this.wakeAtMs);+ return;+ }+ if (this.deferred.size > 0) {+ if (nowMs < this.retryAtMs) this.wakeAt(this.retryAtMs);+ else this.requeueDeferred();+ }+ runInAction(() => {+ this.forgetExpired(nowMs);+ this.notify();+ });+ }++ private wakeIfDue(): void {+ if (document.visibilityState === 'hidden') return;+ if (this.wakeTimer === null || this.wakeAtMs > Date.now()) return;+ clearTimeout(this.wakeTimer);+ this.wake();+ }++ private retryNow(): void {+ this.requestFailures = 0;+ this.retryAtMs = this.cooldownUntilMs;+ if (this.deferred.size === 0 || Date.now() < this.cooldownUntilMs) return;+ this.requeueDeferred();+ }++ private notify(): void {+ this.wakeups += 1;+ this.revision += 1;+ }++ private requeueDeferred(): void {+ for (const [key, url] of this.deferred) {+ if (this.inFlight.has(key) || this.queued.has(key)) continue;+ this.queued.set(key, {url, resolvers: []});+ }+ this.deferred.clear();+ if (this.queued.size > 0) this.scheduleFlush();+ }++ private defer(batch: Array<[string, QueuedRequest]>, retryAtMs: number): void {+ for (const [key, request] of batch) this.deferred.set(key, request.url);+ this.retryAtMs = Math.max(this.retryAtMs, retryAtMs);+ this.wakeAt(this.retryAtMs);+ }+private enqueue(key: string, url: string, nowMs: number): void {if (this.inFlight.has(key)) return;- if (nowMs < this.cooldownUntilMs) return;if (this.queued.has(key)) return;+ if (nowMs < this.cooldownUntilMs) {+ this.deferred.set(key, stripAttachmentSignature(url));+ return;+ }this.queued.set(key, {url: stripAttachmentSignature(url), resolvers: []});this.scheduleFlush();}@@ -138,7 +285,10 @@ class AttachmentUrlRefresher {private request(key: string, url: string, nowMs: number): Promise<string | null> {const existing = this.inFlight.get(key);if (existing) return existing;- if (nowMs < this.cooldownUntilMs) return Promise.resolve(null);+ if (nowMs < this.cooldownUntilMs) {+ this.deferred.set(key, stripAttachmentSignature(url));+ return Promise.resolve(null);+ }const queued = this.queued.get(key) ?? {url: stripAttachmentSignature(url), resolvers: []};this.queued.set(key, queued);this.scheduleFlush();@@ -159,12 +309,19 @@ class AttachmentUrlRefresher {if (this.queued.size === 0) return;const nowMs = Date.now();if (nowMs < this.cooldownUntilMs) {- this.drainQueue();+ this.deferQueue();return;}- const batch = Array.from(this.queued.entries()).slice(0, MAX_URLS_PER_REQUEST);- for (const [key] of batch) this.queued.delete(key);+ const batch: Array<[string, QueuedRequest]> = [];+ const oversized: Array<[string, QueuedRequest]> = [];+ for (const item of this.queued) {+ if (batch.length === MAX_URLS_PER_REQUEST) break;+ this.queued.delete(item[0]);+ (item[1].url.length > MAX_REQUEST_URL_LENGTH ? oversized : batch).push(item);+ }if (this.queued.size > 0) this.scheduleFlush();+ if (oversized.length > 0) this.blockOversized(oversized, nowMs);+ if (batch.length === 0) return;const generation = this.generation;const send = this.send(batch, generation);for (const [key] of batch) {@@ -198,15 +355,23 @@ class AttachmentUrlRefresher {const fields = refreshed === undefined ? null : readAttachmentSignatureFields(refreshed);const expiry = refreshed === undefined ? null : readAttachmentUrlSignature(refreshed);if (fields === null || expiry === null) {- updates.push([key, {kind: 'blocked', untilMs: nowMs + UNSIGNED_RESULT_COOLDOWN_MS}]);+ updates.push([key, this.blockedEntry(key, nowMs + UNSIGNED_RESULT_COOLDOWN_MS, nowMs)]);continue;}resolved.set(key, fields);+ const usableUntilMs = Math.max(expiry.expiresAtMs, nowMs + MIN_SIGNATURE_LIFETIME_MS);updates.push([key,- {kind: 'signature', fields, goodUntilMs: expiry.expiresAtMs - ATTACHMENT_URL_REFRESH_MARGIN_MS},+ {+ kind: 'signature',+ fields,+ expiresAtMs: expiry.expiresAtMs,+ goodUntilMs: usableUntilMs - ATTACHMENT_URL_REFRESH_MARGIN_MS,+ usableUntilMs,+ },]);}+ this.requestFailures = 0;runInAction(() => {this.forgetExpired(nowMs);for (const [key, entry] of updates) this.entries.set(key, entry);@@ -218,25 +383,48 @@ class AttachmentUrlRefresher {const nowMs = Date.now();if (error instanceof HttpError && error.status === 429) {this.cooldownUntilMs = nowMs + (resolveRetryAfterMs(error) ?? RATE_LIMIT_FALLBACK_COOLDOWN_MS);+ this.defer(batch, this.cooldownUntilMs);+ runInAction(this.notify);return resolved;}logger.warn('Failed to refresh attachment URLs', error);+ const rejected = error instanceof HttpError && error.status >= 400 && error.status < 500;+ const untilMs = nowMs + this.nextFailureBackoffMs();+ if (!rejected) this.defer(batch, untilMs);runInAction(() => {this.forgetExpired(nowMs);- for (const [key] of batch) {- this.entries.set(key, {kind: 'blocked', untilMs: nowMs + TRANSPORT_ERROR_COOLDOWN_MS});- }+ for (const [key] of batch) this.entries.set(key, this.blockedEntry(key, untilMs, nowMs));this.revision += 1;});return resolved;}}- private drainQueue(): void {- for (const request of this.queued.values()) {+ private nextFailureBackoffMs(): number {+ const step = Math.min(this.requestFailures, REQUEST_FAILURE_MAX_BACKOFF_STEPS);+ this.requestFailures += 1;+ return REQUEST_FAILURE_COOLDOWN_MS * 2 ** step;+ }++ private blockOversized(oversized: Array<[string, QueuedRequest]>, nowMs: number): void {+ runInAction(() => {+ for (const [key] of oversized) {+ this.entries.set(key, this.blockedEntry(key, nowMs + UNSIGNED_RESULT_COOLDOWN_MS, nowMs));+ }+ this.revision += 1;+ });+ for (const [, request] of oversized) {for (const resolve of request.resolvers) resolve(null);}+ }++ private deferQueue(): void {+ const pending = Array.from(this.queued.entries());this.queued.clear();+ this.defer(pending, this.cooldownUntilMs);+ for (const [, request] of pending) {+ for (const resolve of request.resolvers) resolve(null);+ }}}diff --git a/fluxer_app/src/features/messaging/utils/ImageCacheUtils.ts b/fluxer_app/src/features/messaging/utils/ImageCacheUtils.tsindex 742b24e61..bba95b524 100644--- a/fluxer_app/src/features/messaging/utils/ImageCacheUtils.ts+++ b/fluxer_app/src/features/messaging/utils/ImageCacheUtils.ts@@ -1,5 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-later+import {readAttachmentUrlSignature} from '@app/features/messaging/utils/AttachmentCdnUrl';import {retainImage} from '@app/features/messaging/utils/ImageRetention';import {LRUCache} from 'lru-cache';@@ -203,8 +204,17 @@ function startImageLoad(entry: ImageCacheEntry): void {image.src = entry.src;}+function hasLapsedAttachmentSignature(src: string): boolean {+ const signature = readAttachmentUrlSignature(src);+ return signature !== null && signature.expiresAtMs <= Date.now();+}+function scheduleRetryOrFail(entry: ImageCacheEntry): void {- if (entry.failedAttempts >= IMAGE_RETRY_ATTEMPT_LIMIT) {+ if (entry.subscribers.size === 0) {+ dropEntry(entry);+ return;+ }+ if (entry.failedAttempts >= IMAGE_RETRY_ATTEMPT_LIMIT || hasLapsedAttachmentSignature(entry.src)) {failEntry(entry);return;}@@ -215,6 +225,10 @@ function scheduleRetryOrFail(entry: ImageCacheEntry): void {abandonEntry(entry);return;}+ if (entry.subscribers.size === 0) {+ dropEntry(entry);+ return;+ }startImageLoad(entry);};if (typeof navigator !== 'undefined' && navigator.onLine === false) {diff --git a/fluxer_app/src/features/messaging/utils/MessageCopyTextUtils.ts b/fluxer_app/src/features/messaging/utils/MessageCopyTextUtils.tsindex 95d1f293e..3defa5d29 100644--- a/fluxer_app/src/features/messaging/utils/MessageCopyTextUtils.ts+++ b/fluxer_app/src/features/messaging/utils/MessageCopyTextUtils.ts@@ -3,6 +3,8 @@import {embedAllowsMarkdown} from '@app/features/channel/components/embeds/EmbedRenderUtils';import {MarkdownContext} from '@app/features/messaging/components/markdown/renderers/RendererTypes';import type {Message} from '@app/features/messaging/models/MessagingMessage';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';+import {attachmentUrlMayNeedRefresh} from '@app/features/messaging/utils/AttachmentCdnUrl';import {getParserFlagsForContext} from '@app/features/messaging/utils/markdown/MarkdownParserFlags';import {normaliseUrlForComparison,@@ -73,13 +75,15 @@ function normaliseCopyBlock(value?: string | null): string {.trim();}+const COPY_URL_PATTERN = /\bhttps?:\/\/[^\s<>"'`]+/giu;+function trimUrlCandidate(value: string): string {return value.replace(/[),.;:!?]+$/u, '');}function extractNormalisedUrls(value?: string | null): Set<string> {const urls = new Set<string>();- const matches = value?.matchAll(/\bhttps?:\/\/[^\s<>"'`]+/giu) ?? [];+ const matches = value?.matchAll(COPY_URL_PATTERN) ?? [];for (const match of matches) {const normalisedUrl = normaliseUrlForComparison(trimUrlCandidate(match[0]));if (normalisedUrl) {@@ -123,6 +127,30 @@ export function buildMessageContentCopyText(nodes: Array<Node>, context: Markdowreturn normaliseCopyBlock(renderAstToPlaintext(nodes, createPlaintextCopyOptions(context)));}+export function freshAttachmentUrlsInText(text: string): string {+ return text.replace(COPY_URL_PATTERN, (match) => {+ const url = trimUrlCandidate(match);+ return `${AttachmentUrlRefresher.fresh(url, {refreshUnsigned: true})}${match.slice(url.length)}`;+ });+}++export async function refreshAttachmentUrlsInText(text: string): Promise<string> {+ const nowMs = Date.now();+ const urls = new Set(+ Array.from(text.matchAll(COPY_URL_PATTERN), (match) => trimUrlCandidate(match[0])).filter((url) =>+ attachmentUrlMayNeedRefresh(url, nowMs),+ ),+ );+ if (urls.size === 0) return text;+ const refreshed = new Map(+ await Promise.all(Array.from(urls, async (url) => [url, await AttachmentUrlRefresher.refresh(url)] as const)),+ );+ return text.replace(COPY_URL_PATTERN, (match) => {+ const url = trimUrlCandidate(match);+ return `${refreshed.get(url) ?? url}${match.slice(url.length)}`;+ });+}+function buildAttachmentCopyText(attachment: MessageAttachment): string {const blocks: Array<string> = [];appendCopyBlock(blocks, attachment.title || attachment.filename);diff --git a/fluxer_app/src/features/theme/components/modals/ThemeAcceptModal.tsx b/fluxer_app/src/features/theme/components/modals/ThemeAcceptModal.tsxindex ca693c6fa..b5093e0a0 100644--- a/fluxer_app/src/features/theme/components/modals/ThemeAcceptModal.tsx+++ b/fluxer_app/src/features/theme/components/modals/ThemeAcceptModal.tsx@@ -7,7 +7,9 @@ import {useArboriumHighlightedHtml} from '@app/features/code_highlighting/utils/import {COPY_CODE_DESCRIPTOR, SOMETHING_WENT_WRONG_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';import {Logger} from '@app/features/platform/utils/AppLogger';import styles from '@app/features/theme/components/modals/ThemeAcceptModal.module.css';+import {useCustomCssSuspension} from '@app/features/theme/state/CustomCssSuspension';import ThemeEditTarget from '@app/features/theme/state/ThemeEditTarget';+import {gateThemeCss} from '@app/features/theme/utils/ThemeCssUrlGate';import {buildThemeCssFetchUrl} from '@app/features/theme/utils/ThemeUtils';import * as ThemeSettingsCommands from '@app/features/theme_settings/commands/ThemeSettingsCommands';import {useCurrentAccountLabels} from '@app/features/theme_settings/hooks/useCurrentAccountLabels';@@ -18,7 +20,7 @@ import {CopyButton} from '@app/features/ui/components/CopyButton';import {msg} from '@lingui/core/macro';import {Trans, useLingui} from '@lingui/react/macro';import {observer} from 'mobx-react-lite';-import {useEffect, useState} from 'react';+import {useEffect, useMemo, useState} from 'react';const WE_COULDN_T_READ_THIS_THEME_IT_MAY_DESCRIPTOR = msg({message: "We couldn't read this theme. It may be corrupted or invalid.",@@ -49,7 +51,12 @@ const OPEN_IN_THEMES_DESCRIPTOR = msg({message: 'Open in Themes',comment: 'Button in the modal that applied a shared theme. Opens Settings > Themes.',});+const BLOCKED_FILES_DESCRIPTOR = msg({+ message: "Fluxer won't load {count, plural, one {# file} other {# files}} that this theme links to on other sites.",+ comment: 'Shown in the modal that applies a shared theme when the theme points at files the app will not load.',+});const logger = new Logger('ThemeAcceptModal');+const NO_OBJECT_URLS: ReadonlySet<string> = new Set();interface ThemeAcceptModalProps {themeId: string;@@ -58,6 +65,7 @@ interface ThemeAcceptModalProps {export const ThemeAcceptModal = observer(function ThemeAcceptModal({themeId, runtimeSnapshot}: ThemeAcceptModalProps) {const {i18n} = useLingui();+ useCustomCssSuspension();const {username, instanceName} = useCurrentAccountLabels();const target = ThemeEditTarget.target;const [isApplying, setIsApplying] = useState(false);@@ -66,6 +74,10 @@ export const ThemeAcceptModal = observer(function ThemeAcceptModal({themeId, runconst [fetchStatus, setFetchStatus] = useState<'idle' | 'loading' | 'error' | 'ready'>('idle');const [fetchError, setFetchError] = useState<string | null>(null);const highlightedCss = useArboriumHighlightedHtml('css', css);+ const blockedCount = useMemo(() => {+ if (!css) return 0;+ return gateThemeCss(css, {mediaEndpoint: runtimeSnapshot.mediaEndpoint, objectUrls: NO_OBJECT_URLS}).blocked.length;+ }, [css, runtimeSnapshot]);useEffect(() => {let cancelled = false;const fetchTheme = async () => {@@ -160,6 +172,11 @@ export const ThemeAcceptModal = observer(function ThemeAcceptModal({themeId, run? i18n._(REPLACES_DESKTOP_QUICK_CSS_DESCRIPTOR): i18n._(REPLACES_ACCOUNT_QUICK_CSS_DESCRIPTOR, {username, instanceName})}</p>+ {blockedCount > 0 && (+ <p className={styles.description} data-flx="theme.theme-accept-modal.blocked-files">+ {i18n._(BLOCKED_FILES_DESCRIPTOR, {count: blockedCount})}+ </p>+ )}<div className={styles.codeContainer} data-flx="theme.theme-accept-modal.code-container"><CopyButtonvalue={css ?? ''}diff --git a/fluxer_app/src/features/theme/hooks/useCustomThemeStyle.ts b/fluxer_app/src/features/theme/hooks/useCustomThemeStyle.tsindex 6500e0449..57087ca66 100644--- a/fluxer_app/src/features/theme/hooks/useCustomThemeStyle.ts+++ b/fluxer_app/src/features/theme/hooks/useCustomThemeStyle.ts@@ -1,14 +1,29 @@// SPDX-License-Identifier: AGPL-3.0-or-later+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';+import {+ ATTACHMENT_URL_REFRESH_MARGIN_MS,+ readAttachmentUrlSignature,+} from '@app/features/messaging/utils/AttachmentCdnUrl';import {Logger} from '@app/features/platform/utils/AppLogger';import {clearRemScaleCache} from '@app/features/theme/layout/RemFromPx';import type {ThemeLibraryAsset, ThemeLibraryLocalFileReference} from '@app/features/theme/state/ThemeLibrary';+import {+ gateThemeCss,+ signGatedCss,+ type ThemeCssGatePolicy,+ type ThemeCssGateResult,+} from '@app/features/theme/utils/ThemeCssUrlGate';import {resolveThemeCssReferences} from '@app/features/theme/utils/ThemeCssUtils';-import {useEffect, useRef} from 'react';+import {useEffect, useLayoutEffect, useRef} from 'react';export const CUSTOM_THEME_STYLE_ELEMENT_ID = 'fluxer-custom-theme-style';export const INSTANCE_CUSTOM_CSS_ELEMENT_ID = 'fluxer-instance-custom-css';const logger = new Logger('useCustomThemeStyle');+const SHEET_PREPARE_WAIT_MS = 1_500;+const UNSIGNED_URL_RETRY_MS = 300_000;+const SIGNING_TIMEOUT_RETRY_MS = 5_000;+const MAX_TIMER_DELAY_MS = 2_147_483_647;const USER_STYLE_ELEMENT_IDS: ReadonlySet<string> = new Set([CUSTOM_THEME_STYLE_ELEMENT_ID,INSTANCE_CUSTOM_CSS_ELEMENT_ID,@@ -24,13 +39,16 @@ interface CustomThemeStyleOptions {themeLibraryAssets: ReadonlyArray<ThemeLibraryAsset>;themeLibraryLocalFiles: ReadonlyArray<ThemeLibraryLocalFileReference>;themeLibraryRevision: number;+ mediaEndpoint: string;onMissingReferences: (references: ReadonlyArray<string>) => void;onBlockedUrl: (url: string) => void;+ onCssRejected: (rejected: boolean) => void;}-export function useInstanceCustomCss(instanceCss: string | null): void {- useEffect(() => {- const css = instanceCss?.trim() ?? '';+export function useInstanceCustomCss(instanceCss: string | null, gatedOrigins: ReadonlyArray<string> | null): void {+ const gatedOriginsKey = gatedOrigins?.join(' ') ?? null;+ useLayoutEffect(() => {+ const css = gateInstanceCss(instanceCss?.trim() ?? '', gatedOriginsKey);const existing = document.getElementById(INSTANCE_CUSTOM_CSS_ELEMENT_ID);if (!css) {if (existing) {@@ -46,14 +64,44 @@ export function useInstanceCustomCss(instanceCss: string | null): void {document.head.insertBefore(styleElement, document.getElementById(CUSTOM_THEME_STYLE_ELEMENT_ID));}clearRemScaleCache();- }, [instanceCss]);+ }, [instanceCss, gatedOriginsKey]);+}++function gateInstanceCss(css: string, gatedOriginsKey: string | null): string {+ if (!css || gatedOriginsKey === null) return css;+ try {+ const policy = {+ mediaEndpoint: '',+ objectUrls: new Set<string>(),+ instanceOrigins: new Set(gatedOriginsKey.split(' ')),+ };+ return gateThemeCss(css, policy).css;+ } catch (error) {+ logger.error('Failed to check instance custom CSS', error);+ return '';+ }}interface ThemeCssRequest {css: string;assets: ReadonlyArray<ThemeLibraryAsset>;localFiles: ReadonlyArray<ThemeLibraryLocalFileReference>;+ mediaEndpoint: string;onMissingReferences: (references: ReadonlyArray<string>) => void;+ onBlockedUrl: (url: string) => void;+ onCssRejected: (rejected: boolean) => void;+}++interface GatedThemeSheet {+ css: string;+ policy: ThemeCssGatePolicy;+ keptMediaUrls: ReadonlyArray<string>;+ signedUrls: ReadonlyMap<string, string>;+}++interface SignedKeptUrls {+ signedUrls: ReadonlyMap<string, string>;+ timedOut: boolean;}interface ThemeCssApplier {@@ -61,6 +109,10 @@ interface ThemeCssApplier {running: boolean;disposed: boolean;objectUrls: Array<string>;+ sheet: GatedThemeSheet | null;+ resignDue: boolean;+ resignAtMs: number | null;+ resignTimer: ReturnType<typeof setTimeout> | null;}function revokeObjectUrls(objectUrls: ReadonlyArray<string>): void {@@ -73,45 +125,187 @@ function writeThemeStyle(applier: ThemeCssApplier, css: string, objectUrls: Arraconst existing = document.getElementById(CUSTOM_THEME_STYLE_ELEMENT_ID);if (!css) {existing?.remove();- } else {+ } else if (existing?.textContent !== css) {const styleElement = existing ?? document.createElement('style');styleElement.id = CUSTOM_THEME_STYLE_ELEMENT_ID;styleElement.textContent = css;if (!existing) document.head.appendChild(styleElement);}- revokeObjectUrls(applier.objectUrls);- applier.objectUrls = objectUrls;+ if (objectUrls !== applier.objectUrls) {+ revokeObjectUrls(applier.objectUrls);+ applier.objectUrls = objectUrls;+ }clearRemScaleCache();}+function clearResignSchedule(applier: ThemeCssApplier): void {+ if (applier.resignTimer !== null) clearTimeout(applier.resignTimer);+ applier.resignTimer = null;+ applier.resignAtMs = null;+ applier.resignDue = false;+}++function clearThemeStyle(applier: ThemeCssApplier): void {+ clearResignSchedule(applier);+ applier.sheet = null;+ writeThemeStyle(applier, '', []);+}++function requestResign(applier: ThemeCssApplier): void {+ if (applier.disposed || applier.sheet === null) return;+ applier.resignDue = true;+ if (!applier.running) void drainThemeCssRequests(applier);+}++function scheduleResign(applier: ThemeCssApplier, urls: ReadonlyArray<string>, retryMs: number): void {+ clearResignSchedule(applier);+ if (urls.length === 0) return;+ const nowMs = Date.now();+ let resignAtMs = nowMs + MAX_TIMER_DELAY_MS;+ for (const url of urls) {+ const signature = readAttachmentUrlSignature(url);+ const dueAtMs = signature ? signature.expiresAtMs - ATTACHMENT_URL_REFRESH_MARGIN_MS : nowMs;+ resignAtMs = Math.min(resignAtMs, dueAtMs > nowMs ? dueAtMs : nowMs + retryMs);+ }+ applier.resignAtMs = resignAtMs;+ applier.resignTimer = setTimeout(() => requestResign(applier), resignAtMs - nowMs);+}++function resignIfOverdue(applier: ThemeCssApplier): void {+ if (applier.resignAtMs !== null && Date.now() >= applier.resignAtMs) requestResign(applier);+}++function waitAtMost<T>(work: Promise<T>, fallback: T): Promise<T> {+ return new Promise((resolve) => {+ const timer = setTimeout(() => resolve(fallback), SHEET_PREPARE_WAIT_MS);+ void work.then((value) => {+ clearTimeout(timer);+ resolve(value);+ });+ });+}++async function signKeptUrls(+ urls: ReadonlyArray<string>,+ lastSignedUrls: ReadonlyMap<string, string>,+): Promise<SignedKeptUrls> {+ let timedOut = false;+ const signed = await Promise.all(+ urls.map(async (url) => {+ const refreshed = await waitAtMost<string | null>(AttachmentUrlRefresher.refresh(url), null);+ if (refreshed === null) timedOut = true;+ const isNewer = refreshed !== null && refreshed !== url;+ return [url, isNewer ? refreshed : (lastSignedUrls.get(url) ?? url)] as const;+ }),+ );+ return {signedUrls: new Map(signed), timedOut};+}++function preloadImage(url: string): Promise<void> {+ return new Promise((resolve) => {+ const image = new Image();+ image.onload = () => resolve();+ image.onerror = () => resolve();+ image.src = url;+ });+}++function isRequestStale(applier: ThemeCssApplier): boolean {+ return applier.disposed || applier.pending !== null;+}++async function publishSheet(+ applier: ThemeCssApplier,+ sheet: GatedThemeSheet,+ objectUrls: Array<string>,+): Promise<ThemeCssGateResult | null> {+ const {signedUrls, timedOut} = await signKeptUrls(sheet.keptMediaUrls, applier.sheet?.signedUrls ?? new Map());+ if (isRequestStale(applier)) return null;+ const final = signGatedCss(sheet.css, sheet.policy, signedUrls);+ if (final.rejected) return final;+ await waitAtMost(Promise.all(final.keptMediaUrls.map(preloadImage)), []);+ if (isRequestStale(applier)) return null;+ applier.sheet = {...sheet, signedUrls};+ writeThemeStyle(applier, final.css, objectUrls);+ scheduleResign(applier, final.keptMediaUrls, timedOut ? SIGNING_TIMEOUT_RETRY_MS : UNSIGNED_URL_RETRY_MS);+ return final;+}++async function applyThemeCssRequest(applier: ThemeCssApplier, request: ThemeCssRequest): Promise<void> {+ let objectUrls: Array<string> = [];+ try {+ const resolved = await resolveThemeCssReferences(request.css, request.assets, request.localFiles);+ objectUrls = resolved.objectUrls;+ if (isRequestStale(applier)) {+ revokeObjectUrls(objectUrls);+ return;+ }+ const policy = {mediaEndpoint: request.mediaEndpoint, objectUrls: new Set(objectUrls)};+ const gated = gateThemeCss(resolved.css, policy);+ for (const url of gated.blocked) request.onBlockedUrl(url);+ const final = gated.rejected+ ? gated+ : await publishSheet(+ applier,+ {css: gated.css, policy, keptMediaUrls: gated.keptMediaUrls, signedUrls: new Map()},+ objectUrls,+ );+ if (final === null) {+ revokeObjectUrls(objectUrls);+ return;+ }+ if (final.rejected) {+ logger.error('Custom theme CSS did not settle after filtering and was not applied');+ revokeObjectUrls(objectUrls);+ if (!isRequestStale(applier)) clearThemeStyle(applier);+ }+ request.onCssRejected(final.rejected);+ request.onMissingReferences([...resolved.missingAssetReferences, ...resolved.missingLocalFileReferences]);+ if (resolved.missingAssetReferences.length > 0 || resolved.missingLocalFileReferences.length > 0) {+ logger.warn('Custom theme CSS has unresolved file references', {+ assets: resolved.missingAssetReferences,+ localFiles: resolved.missingLocalFileReferences,+ });+ }+ } catch (error) {+ logger.error('Failed to prepare custom theme CSS', error);+ revokeObjectUrls(objectUrls);+ if (!isRequestStale(applier)) {+ clearThemeStyle(applier);+ request.onCssRejected(true);+ }+ }+}++async function resignAppliedSheet(applier: ThemeCssApplier): Promise<void> {+ const sheet = applier.sheet;+ if (sheet === null) return;+ try {+ const final = await publishSheet(applier, sheet, applier.objectUrls);+ if (final?.rejected) clearThemeStyle(applier);+ } catch (error) {+ logger.error('Failed to refresh custom theme CSS links', error);+ clearThemeStyle(applier);+ }+}+async function drainThemeCssRequests(applier: ThemeCssApplier): Promise<void> {applier.running = true;- while (applier.pending && !applier.disposed) {+ while (!applier.disposed && (applier.pending || applier.resignDue)) {const request = applier.pending;applier.pending = null;+ if (request === null) {+ applier.resignDue = false;+ await resignAppliedSheet(applier);+ continue;+ }if (!request.css) {- writeThemeStyle(applier, '', []);+ clearThemeStyle(applier);+ request.onCssRejected(false);request.onMissingReferences([]);continue;}- try {- const resolved = await resolveThemeCssReferences(request.css, request.assets, request.localFiles);- if (applier.disposed || applier.pending) {- revokeObjectUrls(resolved.objectUrls);- continue;- }- writeThemeStyle(applier, resolved.css, resolved.objectUrls);- request.onMissingReferences([...resolved.missingAssetReferences, ...resolved.missingLocalFileReferences]);- if (resolved.missingAssetReferences.length > 0 || resolved.missingLocalFileReferences.length > 0) {- logger.warn('Custom theme CSS has unresolved file references', {- assets: resolved.missingAssetReferences,- localFiles: resolved.missingLocalFileReferences,- });- }- } catch (error) {- logger.error('Failed to resolve custom theme CSS references', error);- if (!applier.disposed && !applier.pending) writeThemeStyle(applier, request.css, []);- }+ await applyThemeCssRequest(applier, request);}applier.running = false;}@@ -122,10 +316,21 @@ export function useCustomThemeStyle({themeLibraryAssets,themeLibraryLocalFiles,themeLibraryRevision,+ mediaEndpoint,onMissingReferences,onBlockedUrl,+ onCssRejected,}: CustomThemeStyleOptions): void {- const applierRef = useRef<ThemeCssApplier>({pending: null, running: false, disposed: false, objectUrls: []});+ const applierRef = useRef<ThemeCssApplier>({+ pending: null,+ running: false,+ disposed: false,+ objectUrls: [],+ sheet: null,+ resignDue: false,+ resignAtMs: null,+ resignTimer: null,+ });const requestedCssRef = useRef('');useEffect(() => {const handleViolation = (event: SecurityPolicyViolationEvent): void => {@@ -138,14 +343,21 @@ export function useCustomThemeStyle({useEffect(() => {const applier = applierRef.current;applier.disposed = false;+ const handleWake = (): void => resignIfOverdue(applier);+ window.addEventListener('focus', handleWake);+ window.addEventListener('online', handleWake);return () => {+ window.removeEventListener('focus', handleWake);+ window.removeEventListener('online', handleWake);applier.disposed = true;applier.pending = null;+ clearResignSchedule(applier);+ applier.sheet = null;revokeObjectUrls(applier.objectUrls);applier.objectUrls = [];};}, []);- useEffect(() => {+ useLayoutEffect(() => {const applier = applierRef.current;const css = [enabledThemeCss, customThemeCss].map((value) => value?.trim() ?? '')@@ -156,8 +368,12 @@ export function useCustomThemeStyle({css,assets: themeLibraryAssets,localFiles: themeLibraryLocalFiles,+ mediaEndpoint,onMissingReferences,+ onBlockedUrl,+ onCssRejected,};+ if (!css) clearThemeStyle(applier);if (!applier.running) void drainThemeCssRequests(applier);}, [customThemeCss,@@ -165,6 +381,9 @@ export function useCustomThemeStyle({themeLibraryAssets,themeLibraryLocalFiles,themeLibraryRevision,+ mediaEndpoint,onMissingReferences,+ onBlockedUrl,+ onCssRejected,]);}diff --git a/fluxer_app/src/features/theme/state/CustomCssSuspension.ts b/fluxer_app/src/features/theme/state/CustomCssSuspension.tsnew file mode 100644index 000000000..5a5ee6725--- /dev/null+++ b/fluxer_app/src/features/theme/state/CustomCssSuspension.ts@@ -0,0 +1,36 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {makeAutoObservable} from 'mobx';+import {useLayoutEffect} from 'react';++class CustomCssSuspension {+ count = 0;++ constructor() {+ makeAutoObservable(this, {}, {autoBind: true});+ }++ get active(): boolean {+ return this.count > 0;+ }++ acquire(): void {+ this.count += 1;+ }++ release(): void {+ this.count -= 1;+ }+}++const customCssSuspension = new CustomCssSuspension();++export function useCustomCssSuspension(enabled = true): void {+ useLayoutEffect(() => {+ if (!enabled) return;+ customCssSuspension.acquire();+ return customCssSuspension.release;+ }, [enabled]);+}++export default customCssSuspension;diff --git a/fluxer_app/src/features/theme/utils/ThemeCssUrlGate.ts b/fluxer_app/src/features/theme/utils/ThemeCssUrlGate.tsnew file mode 100644index 000000000..81b1d7495--- /dev/null+++ b/fluxer_app/src/features/theme/utils/ThemeCssUrlGate.ts@@ -0,0 +1,364 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {isAttachmentCdnUrl} from '@app/features/messaging/utils/AttachmentCdnUrl';+import {type CSSToken, TokenType, tokenize} from '@csstools/css-tokenizer';++export const REJECTED_CSS_URL = 'data:,';++const REJECTED_CSS_VALUE = `url("${REJECTED_CSS_URL}")`;+const MAX_KEPT_MEDIA_URLS = 32;+const SIGNATURE_FIELDS = ['ex', 'is', 'hm'] as const;+const HEX_PATTERN = /^[0-9a-f]+$/i;+const ENCODED_SEPARATOR_PATTERN = /%2f|%5c|\\/i;+const FRAGMENT_REFERENCE_PATTERN = /^#[^/\\:]*$/;+const DATA_URL_PATTERN =+ /^data:(image\/(png|jpeg|gif|webp|avif|svg\+xml)|font\/[a-z0-9.+-]+|application\/(font-woff2?|x-font-[a-z0-9]+|vnd\.ms-fontobject))[;,]/i;+const FONT_STYLESHEET_ORIGINS: ReadonlySet<string> = new Set([+ 'https://fonts.googleapis.com',+ 'https://api.fonts.coollabs.io',+]);+const FONT_STYLESHEET_PATHS: ReadonlySet<string> = new Set(['/css', '/css2']);+const FONT_FILE_PATH_PREFIXES: ReadonlyMap<string, string> = new Map([+ ['https://fonts.gstatic.com', '/s/'],+ ['https://cdn.fonts.coollabs.io', '/'],+]);+const URL_FUNCTIONS: ReadonlySet<string> = new Set([+ 'url',+ 'url-prefix',+ 'domain',+ 'src',+ 'image',+ 'image-set',+ '-webkit-image-set',+ 'cross-fade',+ '-webkit-cross-fade',+]);+const FUNCTIONS_ALLOWED_IN_URL_FUNCTIONS: ReadonlySet<string> = new Set([+ 'url',+ 'image-set',+ '-webkit-image-set',+ 'type',+]);+const CLOSER_BY_OPENER: ReadonlyMap<TokenType, TokenType> = new Map([+ [TokenType.Function, TokenType.CloseParen],+ [TokenType.OpenParen, TokenType.CloseParen],+ [TokenType.OpenSquare, TokenType.CloseSquare],+ [TokenType.OpenCurly, TokenType.CloseCurly],+]);++export interface ThemeCssGatePolicy {+ readonly mediaEndpoint: string;+ readonly objectUrls: ReadonlySet<string>;+ readonly instanceOrigins?: ReadonlySet<string>;+}++export interface ThemeCssGateResult {+ readonly css: string;+ readonly rejected: boolean;+ readonly blocked: ReadonlyArray<string>;+ readonly keptMediaUrls: ReadonlyArray<string>;+}++interface Replacement {+ readonly from: number;+ readonly to: number;+ readonly text: string;+}++interface GatePass {+ readonly css: string;+ readonly changed: boolean;+ readonly blocked: Array<string>;+ readonly keptMediaUrls: Array<string>;+}++function parseUrl(value: string): URL | null {+ try {+ return new URL(value);+ } catch {+ return null;+ }+}++function canonicalAttachmentUrl(value: string, mediaEndpoint: string): string | null {+ if (ENCODED_SEPARATOR_PATTERN.test(value) || !isAttachmentCdnUrl(value, mediaEndpoint)) return null;+ const url = parseUrl(value);+ if (url === null || url.hash !== '') return null;+ const query = new URLSearchParams();+ for (const field of SIGNATURE_FIELDS) {+ const fieldValue = url.searchParams.get(field);+ if (fieldValue !== null && HEX_PATTERN.test(fieldValue)) query.set(field, fieldValue);+ }+ const queryText = query.toString();+ return `${url.origin}${url.pathname}${queryText ? `?${queryText}` : ''}`;+}++function isInstanceUrl(value: string, instanceOrigins: ReadonlySet<string> | undefined): boolean {+ if (!instanceOrigins) return false;+ const url = parseUrl(value);+ return (+ url !== null &&+ (url.protocol === 'https:' || url.protocol === 'http:') &&+ url.username === '' &&+ url.password === '' &&+ instanceOrigins.has(url.origin)+ );+}++function isFontFile(value: string): boolean {+ const url = parseUrl(value);+ if (url === null || url.username !== '' || url.password !== '') return false;+ const pathPrefix = FONT_FILE_PATH_PREFIXES.get(url.origin);+ return pathPrefix !== undefined && url.pathname.startsWith(pathPrefix);+}++function isFontStylesheet(value: string): boolean {+ const url = parseUrl(value);+ return (+ url !== null &&+ FONT_STYLESHEET_ORIGINS.has(url.origin) &&+ url.username === '' &&+ url.password === '' &&+ FONT_STYLESHEET_PATHS.has(url.pathname)+ );+}++function allowedValue(rawValue: string, inFontFace: boolean, policy: ThemeCssGatePolicy): string | null {+ const value = rawValue.trim();+ if (value === REJECTED_CSS_URL) return value;+ if (value.startsWith('#')) return !inFontFace && FRAGMENT_REFERENCE_PATTERN.test(value) ? value : null;+ if (DATA_URL_PATTERN.test(value)) return value;+ if (/^blob:/i.test(value)) return policy.objectUrls.has(value) ? value : null;+ if (isInstanceUrl(value, policy.instanceOrigins)) return value;+ if (inFontFace) return isFontFile(value) ? value : null;+ return canonicalAttachmentUrl(value, policy.mediaEndpoint);+}++function quoteCssString(value: string): string {+ return `"${value.replace(/[\\"\n\r\f]/g, (character) => `\\${character.charCodeAt(0).toString(16)} `)}"`;+}++function tokenName(token: CSSToken): string {+ return (token[4] as {value: string}).value.toLowerCase();+}++function tokenValue(token: CSSToken): string {+ return (token[4] as {value: string}).value;+}++function isValueToken(token: CSSToken): boolean {+ return token[0] === TokenType.String || token[0] === TokenType.URL;+}++function matchingCloseIndex(tokens: ReadonlyArray<CSSToken>, openIndex: number): number {+ const expectedClosers: Array<TokenType> = [];+ for (let index = openIndex; index < tokens.length; index++) {+ const type = tokens[index][0];+ const closer = CLOSER_BY_OPENER.get(type);+ if (closer !== undefined) {+ expectedClosers.push(closer);+ } else if (type === expectedClosers[expectedClosers.length - 1]) {+ expectedClosers.pop();+ if (expectedClosers.length === 0) return index;+ }+ }+ return tokens.length - 1;+}++function importRuleEndIndex(tokens: ReadonlyArray<CSSToken>, ruleIndex: number): number {+ for (let index = ruleIndex; index < tokens.length - 1; index++) {+ const type = tokens[index][0];+ if (type === TokenType.Semicolon || type === TokenType.CloseCurly) return index;+ if (type === TokenType.OpenCurly) return matchingCloseIndex(tokens, index);+ if (CLOSER_BY_OPENER.has(type)) index = matchingCloseIndex(tokens, index);+ }+ return tokens.length - 1;+}++function importTarget(tokens: ReadonlyArray<CSSToken>, ruleIndex: number, endIndex: number): string | null {+ const prelude = tokens+ .slice(ruleIndex + 1, endIndex)+ .filter((token) => token[0] !== TokenType.Whitespace && token[0] !== TokenType.Comment);+ if (prelude.length === 1 && isValueToken(prelude[0])) return tokenValue(prelude[0]);+ if (+ prelude.length === 3 &&+ prelude[0][0] === TokenType.Function &&+ tokenName(prelude[0]) === 'url' &&+ prelude[1][0] === TokenType.String &&+ prelude[2][0] === TokenType.CloseParen+ ) {+ return tokenValue(prelude[1]);+ }+ return null;+}++function runGatePass(css: string, policy: ThemeCssGatePolicy, signedUrls: ReadonlyMap<string, string>): GatePass {+ const tokens = tokenize({css});+ const replacements: Array<Replacement> = [];+ const blocked: Array<string> = [];+ const keptMediaUrls = new Set<string>();+ let fontFaceEndIndex = -1;++ const endOffset = (index: number): number => (tokens[index][0] === TokenType.EOF ? css.length : tokens[index][3] + 1);++ const keepValue = (token: CSSToken, inFontFace: boolean): Replacement | null | undefined => {+ const original = tokenValue(token);+ const allowed = allowedValue(original, inFontFace, policy);+ if (allowed === null) return null;+ let next = allowed;+ if (!inFontFace && canonicalAttachmentUrl(allowed, policy.mediaEndpoint) === allowed) {+ if (!keptMediaUrls.has(allowed) && keptMediaUrls.size >= MAX_KEPT_MEDIA_URLS) return null;+ keptMediaUrls.add(allowed);+ next = signedUrls.get(allowed) ?? allowed;+ }+ if (next === original) return undefined;+ const text = token[0] === TokenType.URL ? `url(${quoteCssString(next)})` : quoteCssString(next);+ return {from: token[2], to: token[3] + 1, text};+ };++ const reject = (from: number, to: number, value: string): void => {+ replacements.push({from, to, text: REJECTED_CSS_VALUE});+ blocked.push(value);+ };++ for (let index = 0; index < tokens.length; index++) {+ const token = tokens[index];+ const type = token[0];++ if (type === TokenType.AtKeyword) {+ const name = tokenName(token);+ if (name === 'import') {+ const endIndex = importRuleEndIndex(tokens, index);+ const target = importTarget(tokens, index, endIndex);+ if (target === null || !isFontStylesheet(target)) {+ replacements.push({from: token[2], to: endOffset(endIndex), text: ' '});+ blocked.push(target ?? css.slice(token[2], endOffset(endIndex)));+ }+ index = endIndex;+ } else if (name === 'font-face') {+ let blockIndex = index;+ while (+ blockIndex < tokens.length - 1 &&+ tokens[blockIndex][0] !== TokenType.OpenCurly &&+ tokens[blockIndex][0] !== TokenType.Semicolon+ ) {+ blockIndex++;+ }+ if (tokens[blockIndex][0] === TokenType.OpenCurly) fontFaceEndIndex = matchingCloseIndex(tokens, blockIndex);+ }+ continue;+ }++ const inFontFace = index <= fontFaceEndIndex;++ if (type === TokenType.BadURL) {+ reject(token[2], token[3] + 1, token[1]);+ continue;+ }++ if (type === TokenType.URL) {+ const kept = keepValue(token, inFontFace);+ if (kept === null) reject(token[2], token[3] + 1, tokenValue(token));+ else if (kept) replacements.push(kept);+ continue;+ }++ if (type !== TokenType.Function || !URL_FUNCTIONS.has(tokenName(token))) continue;++ const closeIndex = matchingCloseIndex(tokens, index);+ const values: Array<CSSToken> = [];+ let refused = tokens[closeIndex][0] !== TokenType.CloseParen;+ for (let inner = index + 1; inner < closeIndex; inner++) {+ const innerToken = tokens[inner];+ const innerType = innerToken[0];+ if (innerType === TokenType.Function) {+ const innerName = tokenName(innerToken);+ if (!FUNCTIONS_ALLOWED_IN_URL_FUNCTIONS.has(innerName)) {+ refused = true;+ } else if (innerName === 'type') {+ const typeCloseIndex = matchingCloseIndex(tokens, inner);+ for (let typeIndex = inner + 1; typeIndex < typeCloseIndex; typeIndex++) {+ const typeToken = tokens[typeIndex][0];+ if (typeToken !== TokenType.String && typeToken !== TokenType.Whitespace) refused = true;+ }+ inner = typeCloseIndex;+ }+ } else if (isValueToken(innerToken)) {+ values.push(innerToken);+ } else if (+ innerType === TokenType.BadURL ||+ innerType === TokenType.BadString ||+ innerType === TokenType.OpenCurly ||+ innerType === TokenType.OpenSquare+ ) {+ refused = true;+ }+ }+ if (values.length === 0 && tokenName(token) === 'url') refused = true;+ const urlReplacements: Array<Replacement> = [];+ let refusedValue: string | null = null;+ if (!refused) {+ for (const value of values) {+ const kept = keepValue(value, inFontFace);+ if (kept === null) {+ refused = true;+ refusedValue = tokenValue(value);+ break;+ }+ if (kept) urlReplacements.push(kept);+ }+ }+ if (refused) {+ reject(token[2], endOffset(closeIndex), refusedValue ?? css.slice(token[2], endOffset(closeIndex)));+ } else {+ replacements.push(...urlReplacements);+ }+ index = closeIndex;+ }++ replacements.sort((left, right) => left.from - right.from);+ let output = '';+ let position = 0;+ for (const {from, to, text} of replacements) {+ output += css.slice(position, from) + text;+ position = to;+ }+ output += css.slice(position);+ return {css: output, changed: replacements.length > 0, blocked, keptMediaUrls: [...keptMediaUrls]};+}++function runGate(css: string, policy: ThemeCssGatePolicy, signedUrls: ReadonlyMap<string, string>): ThemeCssGateResult {+ const pass = runGatePass(css, policy, signedUrls);+ const check = runGatePass(pass.css, policy, new Map());+ const rejected = check.changed || check.css !== pass.css;+ return {+ css: rejected ? '' : pass.css,+ rejected,+ blocked: [...new Set(pass.blocked)].filter((value) => value.trim() !== ''),+ keptMediaUrls: rejected ? [] : check.keptMediaUrls,+ };+}++let lastGate: {css: string; policyKey: string; result: ThemeCssGateResult} | null = null;++export function gateThemeCss(css: string, policy: ThemeCssGatePolicy): ThemeCssGateResult {+ const policyKey = JSON.stringify([policy.mediaEndpoint, [...policy.objectUrls], [...(policy.instanceOrigins ?? [])]]);+ if (lastGate?.css === css && lastGate.policyKey === policyKey) return lastGate.result;+ const result = runGate(css, policy, new Map());+ lastGate = {css, policyKey, result};+ return result;+}++export function signGatedCss(+ gatedCss: string,+ policy: ThemeCssGatePolicy,+ signedUrls: ReadonlyMap<string, string>,+): ThemeCssGateResult {+ const accepted = new Map<string, string>();+ for (const [url, signedUrl] of signedUrls) {+ if (signedUrl !== url && canonicalAttachmentUrl(signedUrl, policy.mediaEndpoint) === signedUrl) {+ accepted.set(url, signedUrl);+ }+ }+ return runGate(gatedCss, policy, accepted);+}diff --git a/fluxer_app/src/features/theme/utils/ThemeCssUtils.ts b/fluxer_app/src/features/theme/utils/ThemeCssUtils.tsindex 14489dfeb..364f05753 100644--- a/fluxer_app/src/features/theme/utils/ThemeCssUtils.ts+++ b/fluxer_app/src/features/theme/utils/ThemeCssUtils.ts@@ -1,8 +1,8 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport {readBlobAsDataUrl as blobToDataUrl} from '@app/features/platform/utils/BlobDataUrl';-import type {ThemeLibraryAsset, ThemeLibraryLocalFileReference} from '@app/features/theme/state/ThemeLibrary';+import {REJECTED_CSS_URL} from '@app/features/theme/utils/ThemeCssUrlGate';import {getElectronAPI} from '@app/features/ui/utils/NativeUtils';export interface ThemeMetadata {@@ -57,6 +57,7 @@ const ASSET_FUNCTION_PATTERN = /fluxer-theme-asset\(\s*(['"])(.*?)\1\s*\)/g;const ASSET_URL_PATTERN = /url\(\s*(['"]?)fluxer-theme-asset:\/\/([^'")\s]+)\1\s*\)/g;const LOCAL_FILE_FUNCTION_PATTERN = /fluxer-local-file\(\s*(['"])(.*?)\1\s*\)/g;const LOCAL_FILE_URL_PATTERN = /url\(\s*(['"]?)fluxer-local-file:\/\/([^'")]+)\1\s*\)/g;+const LOCAL_FONT_DATA_URL_PREFIX = 'data:font/';function normalizeMetadataKey(key: string): keyof ThemeMetadata | null {const normalized = key@@ -250,7 +251,7 @@ async function resolveAssetUrls(const asset = assetMap.get(reference) ?? assetMap.get(reference.toLowerCase());if (!asset?.data) {missing.add(reference);- return cssUrl(`about:blank#missing-theme-asset-${encodeURIComponent(reference)}`);+ return cssUrl(REJECTED_CSS_URL);}const cached = urlCache.get(asset.id);if (cached) {@@ -272,6 +273,7 @@ async function resolveLocalFileUrls(localFiles: ReadonlyArray<ThemeLibraryLocalFileReference>,): Promise<{css: string;+ objectUrls: Array<string>;missing: Array<string>;}> {const referenceMap = getLocalFileReferenceMap(localFiles);@@ -289,12 +291,18 @@ async function resolveLocalFileUrls(};css.replace(LOCAL_FILE_FUNCTION_PATTERN, collectReference).replace(LOCAL_FILE_URL_PATTERN, collectReference);const electronApi = getElectronAPI();- const dataByPath = new Map<string, string>();+ const urlByPath = new Map<string, string>();+ const objectUrls: Array<string> = [];if (electronApi?.readThemeLocalFiles && requestedReferences.size > 0) {const files = await electronApi.readThemeLocalFiles([...requestedReferences]);for (const file of files) {- if (file.dataUrl) {- dataByPath.set(file.path, file.dataUrl);+ if (file.dataUrl?.startsWith(LOCAL_FONT_DATA_URL_PREFIX)) {+ urlByPath.set(file.path, file.dataUrl);+ } else if (file.dataUrl) {+ const blob = await (await fetch(file.dataUrl)).blob();+ const objectUrl = URL.createObjectURL(blob);+ objectUrls.push(objectUrl);+ urlByPath.set(file.path, objectUrl);} else {missing.add(file.path);}@@ -307,19 +315,13 @@ async function resolveLocalFileUrls(const resolveLocalFile = (rawReference: string): string => {const reference = decodeReferenceValue(rawReference);const path = referenceMap.get(reference) ?? referenceMap.get(reference.toLowerCase());- if (!path) {- return cssUrl(`about:blank#missing-theme-local-file-${encodeURIComponent(reference)}`);- }- const dataUrl = dataByPath.get(path);- if (!dataUrl) {- return cssUrl(`about:blank#missing-theme-local-file-${encodeURIComponent(path)}`);- }- return cssUrl(dataUrl);+ const url = path ? urlByPath.get(path) : undefined;+ return cssUrl(url ?? REJECTED_CSS_URL);};const nextCss = css.replace(LOCAL_FILE_FUNCTION_PATTERN, (_match, _quote: string, reference: string) => resolveLocalFile(reference)).replace(LOCAL_FILE_URL_PATTERN, (_match, _quote: string, reference: string) => resolveLocalFile(reference));- return {css: nextCss, missing: [...missing]};+ return {css: nextCss, objectUrls, missing: [...missing]};}export async function resolveThemeCssReferences(@@ -331,7 +333,7 @@ export async function resolveThemeCssReferences(const localFileResolution = await resolveLocalFileUrls(assetResolution.css, localFiles);return {css: localFileResolution.css,- objectUrls: assetResolution.objectUrls,+ objectUrls: [...assetResolution.objectUrls, ...localFileResolution.objectUrls],missingAssetReferences: assetResolution.missing,missingLocalFileReferences: localFileResolution.missing,};diff --git a/fluxer_app/src/features/theme_settings/components/QuickCssEditor.tsx b/fluxer_app/src/features/theme_settings/components/QuickCssEditor.tsxindex adc10689c..329efb78e 100644--- a/fluxer_app/src/features/theme_settings/components/QuickCssEditor.tsx+++ b/fluxer_app/src/features/theme_settings/components/QuickCssEditor.tsx@@ -836,6 +836,7 @@ const QuickCssEditor: React.FC<QuickCssEditorProps> = observer(return reaction(() => [ThemeSettingsState.blockedUrls,+ ThemeSettingsState.cssRejected,ThemeSettingsState.missingReferences,ThemeLibrary.assets,ThemeLibrary.localFiles,diff --git a/fluxer_app/src/features/theme_settings/editor/CssLint.ts b/fluxer_app/src/features/theme_settings/editor/CssLint.tsindex 03da7e16d..1b52c90bd 100644--- a/fluxer_app/src/features/theme_settings/editor/CssLint.ts+++ b/fluxer_app/src/features/theme_settings/editor/CssLint.ts@@ -35,9 +35,13 @@ const MISSING_FILE_DESCRIPTOR = msg({comment: 'Problem shown in the quick CSS editor on a reference to a file on the computer that Fluxer cannot read.',});const BLOCKED_URL_DESCRIPTOR = msg({- message: 'Fluxer blocked loading {url}. Upload it as an asset.',+ message: 'Fluxer blocked loading {url}. Upload the file as an asset, or use an attachment link for an image.',comment:- 'Problem shown in the quick CSS editor on a web address that the app is not allowed to load. Assets are files uploaded under "Assets".',+ 'Problem shown in the quick CSS editor on a web address that the app is not allowed to load. An attachment link is a link to a file uploaded in a message, and it only works for images. Assets are files uploaded under "Assets".',+});+const CSS_REJECTED_DESCRIPTOR = msg({+ message: "Fluxer couldn't apply this CSS. Check it for a broken comment, string or bracket.",+ comment: 'Problem shown at the top of the quick CSS editor when the whole sheet was left out.',});const MISSING_SEMICOLON_DESCRIPTOR = msg({message: 'Add ";" at the end of this line.',@@ -294,6 +298,14 @@ export function lintCss(state: EditorState): Array<Diagnostic> {index = doc.indexOf(url, index + url.length);}}+ if (ThemeSettingsState.cssRejected) {+ diagnostics.push({+ from: 0,+ to: Math.min(doc.length, 1),+ severity: 'error',+ message: i18n._(CSS_REJECTED_DESCRIPTOR),+ });+ }return diagnostics.sort((left, right) => left.from - right.from);}diff --git a/fluxer_app/src/features/theme_settings/state/ThemeSettingsState.ts b/fluxer_app/src/features/theme_settings/state/ThemeSettingsState.tsindex c5eb39664..5f7bf7be7 100644--- a/fluxer_app/src/features/theme_settings/state/ThemeSettingsState.ts+++ b/fluxer_app/src/features/theme_settings/state/ThemeSettingsState.ts@@ -53,6 +53,7 @@ class ThemeSettingsState {editorDirty = false;missingReferences: ReadonlyArray<string> = [];blockedUrls: ReadonlyArray<string> = [];+ cssRejected = false;themePreview: ThemePreview | null = null;customCssOff = readCustomCssOff();editorWindow: Window | null = null;@@ -179,6 +180,10 @@ class ThemeSettingsState {this.blockedUrls = [...this.blockedUrls, url].slice(-BLOCKED_URL_LIMIT);}+ setCssRejected(rejected: boolean): void {+ this.cssRejected = rejected;+ }+setCustomCssOff(off: boolean): void {this.customCssOff = off;writeCustomCssOff(off);diff --git a/fluxer_app/src/features/ui/action_menu/MessageContextMenu.tsx b/fluxer_app/src/features/ui/action_menu/MessageContextMenu.tsxindex 84c6c3b59..6dfdbec7d 100644--- a/fluxer_app/src/features/ui/action_menu/MessageContextMenu.tsx+++ b/fluxer_app/src/features/ui/action_menu/MessageContextMenu.tsx@@ -23,7 +23,9 @@ import {MessageReactionsModal} from '@app/features/messaging/components/modals/Mimport {ReactionImage} from '@app/features/messaging/components/ReactionImage';import {useMessageReactions as useMessageReactionsSnapshot} from '@app/features/messaging/hooks/useMessageReactionStore';import type {Message} from '@app/features/messaging/models/MessagingMessage';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import MessagesState from '@app/features/messaging/state/MessagingMessages';+import {refreshAttachmentUrlsInText} from '@app/features/messaging/utils/MessageCopyTextUtils';import {buildMessagePlaintextCopyText} from '@app/features/messaging/utils/MessagePlaintextCopyUtils';import {buildMessageSelectionCopyTextForRange,@@ -387,12 +389,12 @@ export const MessageContextMenu: React.FC<MessageContextMenuProps> = observer(}, [i18n.locale]);const handleCopySelection = useCallback(async () => {if (!selectionText) return;- await TextCopyCommands.copy(i18n, selectionText, true);+ await TextCopyCommands.copy(i18n, await refreshAttachmentUrlsInText(selectionText), true);onClose();}, [selectionText, onClose, i18n]);const handleCopyLink = useCallback(async () => {if (!linkUrl) return;- await TextCopyCommands.copy(i18n, linkUrl, true);+ await TextCopyCommands.copy(i18n, await AttachmentUrlRefresher.refresh(linkUrl), true);onClose();}, [linkUrl, onClose, i18n]);const handleOpenLink = useCallback(() => {diff --git a/fluxer_app/src/features/ui/action_menu/items/ReverseImageSearchMenuItems.tsx b/fluxer_app/src/features/ui/action_menu/items/ReverseImageSearchMenuItems.tsxindex 14f5b4a56..dd1401a89 100644--- a/fluxer_app/src/features/ui/action_menu/items/ReverseImageSearchMenuItems.tsx+++ b/fluxer_app/src/features/ui/action_menu/items/ReverseImageSearchMenuItems.tsx@@ -7,6 +7,7 @@ import {import {SearchProviderPickerModal} from '@app/features/search/components/modals/SearchProviderPickerModal';import ReverseImageSearch from '@app/features/search/state/ReverseImageSearch';import {CopyLinkIcon, OpenMediaLinkIcon, SearchIcon} from '@app/features/ui/action_menu/ContextMenuIcons';+import {openReverseImageSearchWith} from '@app/features/ui/action_menu/items/SearchMenuData';import {SearchProviderContextMenuItems} from '@app/features/ui/action_menu/items/SearchProviderMenuItems';import {getSearchProviderMenuState} from '@app/features/ui/action_menu/items/SearchProviderMenuUtils';import {MenuGroup} from '@app/features/ui/action_menu/MenuGroup';@@ -46,22 +47,16 @@ export const ReverseImageSearchMenuItems: React.FC<ReverseImageSearchMenuItemsPrconst renderDefaultLabel = defaultLabel ?? i18n._(REVERSE_IMAGE_SEARCH_DESCRIPTOR);const renderCopyLabel = copyLabel ?? i18n._(COPY_IMAGE_URL_DESCRIPTOR);const renderOpenLabel = openLabel ?? i18n._(OPEN_IMAGE_IN_BROWSER_DESCRIPTOR);- const openWith = useCallback((engineId: string, url: string) => {- const target = ReverseImageSearch.buildSearchUrl(engineId, url);- if (target) {- void openExternalUrl(target);- }- }, []);const handleSearch = useCallback((engineId: string) => {if (!imageUrl) {onClose?.();return;}- openWith(engineId, imageUrl);+ void openReverseImageSearchWith(engineId, imageUrl);onClose?.();},- [imageUrl, onClose, openWith],+ [imageUrl, onClose],);const handleDefaultSearch = useCallback(() => {if (!imageUrl) {@@ -70,7 +65,7 @@ export const ReverseImageSearchMenuItems: React.FC<ReverseImageSearchMenuItemsPr}const defaultEngine = ReverseImageSearch.defaultEngine;if (defaultEngine) {- openWith(defaultEngine.id, imageUrl);+ void openReverseImageSearchWith(defaultEngine.id, imageUrl);onClose?.();return;}@@ -80,7 +75,7 @@ export const ReverseImageSearchMenuItems: React.FC<ReverseImageSearchMenuItemsPrmodal(() => (<SearchProviderPickerModalmode="image"- onPick={(engineId) => openWith(engineId, targetImageUrl)}+ onPick={(engineId) => void openReverseImageSearchWith(engineId, targetImageUrl)}data-flx="ui.action-menu.items.reverse-image-search-menu-items.handle-default-search.search-provider-picker-modal"/>)),@@ -90,7 +85,7 @@ export const ReverseImageSearchMenuItems: React.FC<ReverseImageSearchMenuItemsPrreturn;}openPicker();- }, [imageUrl, onClose, openWith]);+ }, [imageUrl, onClose]);const handleCopy = useCallback(async () => {if (!imageUrl) {onClose?.();diff --git a/fluxer_app/src/features/ui/action_menu/items/SearchMenuData.tsx b/fluxer_app/src/features/ui/action_menu/items/SearchMenuData.tsxindex b32bb6bf0..bfcd806dc 100644--- a/fluxer_app/src/features/ui/action_menu/items/SearchMenuData.tsx+++ b/fluxer_app/src/features/ui/action_menu/items/SearchMenuData.tsx@@ -4,6 +4,8 @@ import {LINK_COPIED_TO_CLIPBOARD_DESCRIPTOR,REVERSE_IMAGE_SEARCH_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';+import {attachmentUrlMayNeedRefresh} from '@app/features/messaging/utils/AttachmentCdnUrl';import {SearchProviderPickerModal} from '@app/features/search/components/modals/SearchProviderPickerModal';import ReverseImageSearch from '@app/features/search/state/ReverseImageSearch';import {CopyLinkIcon, OpenMediaLinkIcon, SearchIcon} from '@app/features/ui/action_menu/ContextMenuIcons';@@ -46,12 +48,13 @@ interface ReverseImageSearchMenuOptions {openLabel?: string;}-const openReverseImageSearchWith = (engineId: string, url: string) => {- const target = ReverseImageSearch.buildSearchUrl(engineId, url);+export async function openReverseImageSearchWith(engineId: string, url: string): Promise<void> {+ const imageUrl = attachmentUrlMayNeedRefresh(url, Date.now()) ? await AttachmentUrlRefresher.refresh(url) : url;+ const target = ReverseImageSearch.buildSearchUrl(engineId, imageUrl);if (target) {- void openExternalUrl(target);+ await openExternalUrl(target);}-};+}export function buildReverseImageSearchMenuGroups(imageUrl: string | null | undefined,@@ -100,7 +103,7 @@ export function buildReverseImageSearchMenuGroups(const handleDefault = () => {const defaultEngine = ReverseImageSearch.defaultEngine;if (defaultEngine) {- openReverseImageSearchWith(defaultEngine.id, imageUrl);+ void openReverseImageSearchWith(defaultEngine.id, imageUrl);onClose();return;}@@ -110,7 +113,7 @@ export function buildReverseImageSearchMenuGroups(modal(() => (<SearchProviderPickerModalmode="image"- onPick={(engineId) => openReverseImageSearchWith(engineId, targetImageUrl)}+ onPick={(engineId) => void openReverseImageSearchWith(engineId, targetImageUrl)}data-flx="ui.action-menu.items.search-menu-data.handle-default.search-provider-picker-modal"/>)),@@ -125,7 +128,7 @@ export function buildReverseImageSearchMenuGroups(),onDefaultSearch: handleDefault,onSearchWithEngine: (engine) => {- openReverseImageSearchWith(engine.id, imageUrl);+ void openReverseImageSearchWith(engine.id, imageUrl);onClose();},}),diff --git a/fluxer_app/src/features/ui/components/form/FormInput.tsx b/fluxer_app/src/features/ui/components/form/FormInput.tsxindex 0b29fc3a9..885c923e2 100644--- a/fluxer_app/src/features/ui/components/form/FormInput.tsx+++ b/fluxer_app/src/features/ui/components/form/FormInput.tsx@@ -10,6 +10,7 @@ import {shouldApplyPasswordManagerIgnoreAttributes,type TextareaWithPasswordManagerIgnoreAttributes,} from '@app/features/platform/utils/PasswordManagerAutocomplete';+import {useCustomCssSuspension} from '@app/features/theme/state/CustomCssSuspension';import scrollerStyles from '@app/features/theme/styles/Scroller.module.css';import {CharacterCountAnnouncer} from '@app/features/ui/character_counter/CharacterCountAnnouncer';import styles from '@app/features/ui/components/form/FormInput.module.css';@@ -19,7 +20,7 @@ import {msg} from '@lingui/core/macro';import {useLingui} from '@lingui/react/macro';import {EyeIcon, EyeSlashIcon} from '@phosphor-icons/react';import {clsx} from 'clsx';-import React, {useCallback, useId, useMemo, useRef, useState} from 'react';+import React, {useCallback, useId, useLayoutEffect, useMemo, useReducer, useRef, useState} from 'react';const HIDE_PASSWORD_DESCRIPTOR = msg({message: 'Hide password',@@ -95,6 +96,7 @@ type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {leftIcon?: React.ReactNode;rightIcon?: React.ReactNode;renderInput?: (args: RenderInputArgs) => React.ReactNode;+ sensitive?: boolean;};export const Input = React.forwardRef<HTMLInputElement, InputProps>(@@ -113,6 +115,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(renderInput,disabled,readOnly,+ sensitive,...props},forwardedRef,@@ -121,6 +124,10 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(const disableAutofocus = shouldDisableAutofocusOnMobile();const [showPassword, setShowPassword] = useState(false);const isPasswordType = type === 'password';+ const isCredentialField = isPasswordType || props.autoComplete === 'one-time-code';+ const keepsValueOutOfDom = (sensitive || isCredentialField) && props.value !== undefined;+ const [, rerenderValue] = useReducer((revision: number) => revision + 1, 0);+ useCustomCssSuspension(isCredentialField);const shouldIgnorePasswordManagers = useMemo(() => shouldApplyPasswordManagerIgnoreAttributes(type, props.autoComplete),[type, props.autoComplete],@@ -154,6 +161,11 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(},[forwardedRef],);+ useLayoutEffect(() => {+ if (!keepsValueOutOfDom || !inputRef.current) return;+ const nextValue = String(props.value ?? '');+ if (inputRef.current.value !== nextValue) inputRef.current.value = nextValue;+ });const ariaInvalid = !!error;const hasControlledValue = props.value !== undefined;const shouldForceReadOnly = useMemo(@@ -179,6 +191,15 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(() => ({...props,...(shouldIgnorePasswordManagers ? PASSWORD_MANAGER_IGNORE_ATTRIBUTES : {}),+ ...(keepsValueOutOfDom+ ? {+ value: undefined,+ onChange: (event: React.ChangeEvent<HTMLInputElement>) => {+ props.onChange?.(event);+ rerenderValue();+ },+ }+ : {}),autoFocus: disableAutofocus ? false : props.autoFocus,disabled,id: inputId,@@ -191,6 +212,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>([props,shouldIgnorePasswordManagers,+ keepsValueOutOfDom,disableAutofocus,disabled,inputId,diff --git a/fluxer_app/src/features/user/components/modals/BouncedEmailChangeModal.tsx b/fluxer_app/src/features/user/components/modals/BouncedEmailChangeModal.tsxindex 970c02670..61d3c1c23 100644--- a/fluxer_app/src/features/user/components/modals/BouncedEmailChangeModal.tsx+++ b/fluxer_app/src/features/user/components/modals/BouncedEmailChangeModal.tsx@@ -152,6 +152,7 @@ export const BouncedEmailChangeModal = observer(() => {placeholder="XXXX-XXXX"required={true}error={codeError ?? undefined}+ sensitivedata-flx="user.bounced-email-change-modal.input.set-code"/></Modal.InputGroup>diff --git a/fluxer_app/src/features/user/components/modals/EmailChangeModal.tsx b/fluxer_app/src/features/user/components/modals/EmailChangeModal.tsxindex a9dd88c93..93cb76323 100644--- a/fluxer_app/src/features/user/components/modals/EmailChangeModal.tsx+++ b/fluxer_app/src/features/user/components/modals/EmailChangeModal.tsx@@ -194,6 +194,7 @@ export const EmailChangeModal = observer(({user}: EmailChangeModalProps) => {placeholder="XXXX-XXXX"required={true}error={originalCodeError ?? undefined}+ sensitivedata-flx="user.email-change-modal.input.set-original-code"/></Modal.InputGroup>@@ -240,6 +241,7 @@ export const EmailChangeModal = observer(({user}: EmailChangeModalProps) => {placeholder="XXXX-XXXX"required={true}error={newCodeError ?? undefined}+ sensitivedata-flx="user.email-change-modal.input.set-new-code"/></Modal.InputGroup>diff --git a/fluxer_app/src/features/user/components/modals/PasswordChangeModal.tsx b/fluxer_app/src/features/user/components/modals/PasswordChangeModal.tsxindex 9a8eeb1c7..e6f831a6c 100644--- a/fluxer_app/src/features/user/components/modals/PasswordChangeModal.tsx+++ b/fluxer_app/src/features/user/components/modals/PasswordChangeModal.tsx@@ -184,6 +184,7 @@ export const PasswordChangeModal = observer(() => {placeholder="XXXX-XXXX"required={true}error={codeError ?? undefined}+ sensitivedata-flx="user.password-change-modal.input.set-code"/></Modal.InputGroup>diff --git a/fluxer_app/src/features/user/components/modals/tabs/applications_tab/application_detail/SecretsSection.tsx b/fluxer_app/src/features/user/components/modals/tabs/applications_tab/application_detail/SecretsSection.tsxindex 5a7725c60..fa7cb2ee2 100644--- a/fluxer_app/src/features/user/components/modals/tabs/applications_tab/application_detail/SecretsSection.tsx+++ b/fluxer_app/src/features/user/components/modals/tabs/applications_tab/application_detail/SecretsSection.tsx@@ -64,6 +64,7 @@ export const SecretsSection: React.FC<SecretsSectionProps> = ({value={clientSecret ?? ''}readOnlyplaceholder={clientSecret ? '•'.repeat(64) : '•'.repeat(64)}+ sensitivedata-flx="user.applications-tab.application-detail.secrets-section.input.text"/><div@@ -93,6 +94,7 @@ export const SecretsSection: React.FC<SecretsSectionProps> = ({value={botToken ?? ''}readOnlyplaceholder={botToken ? '•'.repeat(64) : '•'.repeat(64)}+ sensitivedata-flx="user.applications-tab.application-detail.secrets-section.input.text--2"/><divdiff --git a/fluxer_app/src/features/voice/components/media_player/components/AudioPlayer.tsx b/fluxer_app/src/features/voice/components/media_player/components/AudioPlayer.tsxindex 0308800cd..c8833c0da 100644--- a/fluxer_app/src/features/voice/components/media_player/components/AudioPlayer.tsx+++ b/fluxer_app/src/features/voice/components/media_player/components/AudioPlayer.tsx@@ -1,7 +1,6 @@// SPDX-License-Identifier: AGPL-3.0-or-laterimport {PAUSE_DESCRIPTOR, PLAY_DESCRIPTOR} from '@app/features/i18n/utils/CommonMessageDescriptors';-import {useAttachmentRefreshOnError} from '@app/features/messaging/hooks/useAttachmentRefreshOnError';import {resolveDesktopCrossOriginMediaURL} from '@app/features/messaging/utils/DesktopResourceUrl';import FocusRing from '@app/features/ui/focus_ring/FocusRing';import {Tooltip} from '@app/features/ui/tooltip/Tooltip';@@ -79,7 +78,6 @@ export function AudioPlayer({});const {volume, isMuted, setVolume, toggleMute} = useMediaVolume({mediaRef});const {escalateToMetadata, sourceAttribute, preloadAttribute} = useMetadataPreload(src, hasStarted);- const handleMediaError = useAttachmentRefreshOnError(src);useEffect(() => {if (hasStarted && pendingPlayRef.current) {const timer = setTimeout(() => {@@ -213,7 +211,6 @@ export function AudioPlayer({ref={mediaRef as React.RefObject<HTMLAudioElement>}src={resolveDesktopCrossOriginMediaURL(sourceAttribute)}preload={preloadAttribute}- onError={handleMediaError}data-flx="voice.media-player.audio-player.audio"/>{title && (diff --git a/fluxer_app/src/features/voice/components/media_player/components/InlineAudioPlayer.tsx b/fluxer_app/src/features/voice/components/media_player/components/InlineAudioPlayer.tsxindex 207fe3fd7..5ec5934cf 100644--- a/fluxer_app/src/features/voice/components/media_player/components/InlineAudioPlayer.tsx+++ b/fluxer_app/src/features/voice/components/media_player/components/InlineAudioPlayer.tsx@@ -8,7 +8,6 @@ import {PLAY_DESCRIPTOR,REMOVE_FROM_FAVORITES_DESCRIPTOR,} from '@app/features/i18n/utils/CommonMessageDescriptors';-import {useAttachmentRefreshOnError} from '@app/features/messaging/hooks/useAttachmentRefreshOnError';import {resolveDesktopCrossOriginMediaURL} from '@app/features/messaging/utils/DesktopResourceUrl';import {formatFileSize} from '@app/features/messaging/utils/FileUtils';import {remFromPx} from '@app/features/theme/layout/RemFromPx';@@ -106,7 +105,6 @@ export function InlineAudioPlayer({mediaRef,});const {escalateToMetadata, sourceAttribute, preloadAttribute} = useMetadataPreload(src, hasStarted);- const handleMediaError = useAttachmentRefreshOnError(src);const displayDuration = duration > 0 ? duration : (initialDuration ?? 0);useLayoutEffect(() => {const media = mediaRef.current;@@ -201,7 +199,6 @@ export function InlineAudioPlayer({ref={mediaRef as React.RefObject<HTMLAudioElement>}src={resolveDesktopCrossOriginMediaURL(sourceAttribute)}preload={preloadAttribute}- onError={handleMediaError}data-flx="voice.media-player.inline-audio-player.audio"><track kind="captions" data-flx="voice.media-player.inline-audio-player.track" />@@ -329,7 +326,6 @@ export function InlineAudioPlayer({ref={mediaRef as React.RefObject<HTMLAudioElement>}src={resolveDesktopCrossOriginMediaURL(sourceAttribute)}preload={preloadAttribute}- onError={handleMediaError}data-flx="voice.media-player.inline-audio-player.audio--2"><track kind="captions" data-flx="voice.media-player.inline-audio-player.track--2" />diff --git a/fluxer_app/src/features/voice/components/media_player/hooks/useMediaPlayer.ts b/fluxer_app/src/features/voice/components/media_player/hooks/useMediaPlayer.tsindex e4db6a8f8..da3caac16 100644--- a/fluxer_app/src/features/voice/components/media_player/hooks/useMediaPlayer.ts+++ b/fluxer_app/src/features/voice/components/media_player/hooks/useMediaPlayer.ts@@ -1,7 +1,9 @@// SPDX-License-Identifier: AGPL-3.0-or-later+import AttachmentUrlRefresher from '@app/features/messaging/state/AttachmentUrlRefresher';import AppStorage from '@app/features/platform/state/PersistentStorage';import {Logger} from '@app/features/platform/utils/AppLogger';+import {useMediaSourceResume} from '@app/features/voice/components/media_player/hooks/useMediaSourceResume';import {armPendingSeekTarget,clampMediaTime,@@ -111,6 +113,8 @@ export function useMediaPlayer(options: UseMediaPlayerOptions = {}): UseMediaPla} = options;const mediaRef = useRef<HTMLMediaElement | null>(null);useInAppMediaSoundCapture(mediaRef);+ const sourceResumeRef = useMediaSourceResume(mediaRef);+ const refreshedSourceRef = useRef<string | null>(null);const callbacksRef = useRef({onEnded, onError, onPlay, onLoadedMetadata});callbacksRef.current = {onEnded, onError, onPlay, onLoadedMetadata};const initialElementSettingsRef = useRef({loop});@@ -251,6 +255,10 @@ export function useMediaPlayer(options: UseMediaPlayerOptions = {}): UseMediaPla: new Error('Unknown media error');recoverPlaybackWhenReadyRef.current = false;setState((prev) => ({...prev, isBuffering: false, error: errorMessage, failureCode: 'error'}));+ if (refreshedSourceRef.current !== media.currentSrc) {+ refreshedSourceRef.current = media.currentSrc;+ void AttachmentUrlRefresher.refresh(media.currentSrc, {force: true});+ }callbacksRef.current.onError?.(errorMessage, 'error');};media.addEventListener('play', handlePlay);@@ -314,6 +322,7 @@ export function useMediaPlayer(options: UseMediaPlayerOptions = {}): UseMediaPla});};const attemptAutoplayOnSource = () => {+ if (sourceResumeRef.current !== null) return;attempted = false;attemptAutoplay();};@@ -322,7 +331,7 @@ export function useMediaPlayer(options: UseMediaPlayerOptions = {}): UseMediaPlareturn () => {media.removeEventListener('loadstart', attemptAutoplayOnSource);};- }, [autoPlay]);+ }, [autoPlay, sourceResumeRef]);useLayoutEffect(() => {const media = mediaRef.current;return () => {diff --git a/fluxer_app/src/features/voice/components/media_player/hooks/useMediaSourceResume.ts b/fluxer_app/src/features/voice/components/media_player/hooks/useMediaSourceResume.tsnew file mode 100644index 000000000..371444110--- /dev/null+++ b/fluxer_app/src/features/voice/components/media_player/hooks/useMediaSourceResume.ts@@ -0,0 +1,77 @@+// SPDX-License-Identifier: AGPL-3.0-or-later++import {sameAttachmentSource} from '@app/features/messaging/state/AttachmentUrlRefresher';+import {armPendingSeekTarget, clampMediaTime} from '@app/features/voice/components/media_player/utils/MediaSeekUtils';+import {type RefObject, useEffect, useRef} from 'react';++const HAVE_METADATA_READY_STATE = 1;++interface MediaSourceResume {+ time: number;+ playing: boolean;+}++export function useMediaSourceResume(+ mediaRef: RefObject<HTMLMediaElement | null>,+ attached = true,+): RefObject<MediaSourceResume | null> {+ const resumeRef = useRef<MediaSourceResume | null>(null);+ useEffect(() => {+ const media = mediaRef.current;+ if (!media || !attached) return;+ let source = media.currentSrc;+ let time = 0;+ let playing = !media.paused;+ const recordTime = () => {+ if (media.readyState >= HAVE_METADATA_READY_STATE) time = media.currentTime;+ };+ const markPlaying = () => {+ playing = true;+ };+ const markStopped = () => {+ playing = false;+ };+ const handleEnded = () => {+ playing = false;+ time = 0;+ };+ const handleLoadStart = () => {+ const nextSource = media.currentSrc;+ const swapped = source !== '' && source !== nextSource && sameAttachmentSource(source, nextSource);+ source = nextSource;+ if (!swapped) {+ resumeRef.current = null;+ time = 0;+ playing = !media.paused;+ return;+ }+ resumeRef.current = {time, playing};+ if (playing) void Promise.resolve(media.play()).catch(() => {});+ };+ const handleLoadedMetadata = () => {+ const resume = resumeRef.current;+ resumeRef.current = null;+ if (resume === null || resume.time <= 0) return;+ const target = clampMediaTime(resume.time, media.duration);+ armPendingSeekTarget(media, target);+ media.currentTime = target;+ };+ media.addEventListener('timeupdate', recordTime);+ media.addEventListener('seeking', recordTime);+ media.addEventListener('play', markPlaying);+ media.addEventListener('pause', markStopped);+ media.addEventListener('ended', handleEnded);+ media.addEventListener('loadstart', handleLoadStart);+ media.addEventListener('loadedmetadata', handleLoadedMetadata);+ return () => {+ media.removeEventListener('timeupdate', recordTime);+ media.removeEventListener('seeking', recordTime);+ media.removeEventListener('play', markPlaying);+ media.removeEventListener('pause', markStopped);+ media.removeEventListener('ended', handleEnded);+ media.removeEventListener('loadstart', handleLoadStart);+ media.removeEventListener('loadedmetadata', handleLoadedMetadata);+ };+ }, [attached, mediaRef]);+ return resumeRef;+}diff --git a/fluxer_app/src/features/voice/components/modals/MobileVideoViewer.tsx b/fluxer_app/src/features/voice/components/modals/MobileVideoViewer.tsxindex 143f583a5..76b39d0bb 100644--- a/fluxer_app/src/features/voice/components/modals/MobileVideoViewer.tsx+++ b/fluxer_app/src/features/voice/components/modals/MobileVideoViewer.tsx@@ -11,8 +11,10 @@ import {getCachedNumberFormat} from '@app/features/i18n/utils/IntlCache';import {isKeyboardActivationKey} from '@app/features/input/utils/KeyboardUtils';import {PanZoomSurface} from '@app/features/messaging/components/modals/media_modal/pan_zoom/PanZoomSurface';import type {ZoomState} from '@app/features/messaging/components/modals/media_modal/shared';+import {useAttachmentRefreshOnError} from '@app/features/messaging/hooks/useAttachmentRefreshOnError';import {resolveDesktopCrossOriginMediaURL} from '@app/features/messaging/utils/DesktopResourceUrl';import {remFromPx} from '@app/features/theme/layout/RemFromPx';+import {useMediaSourceResume} from '@app/features/voice/components/media_player/hooks/useMediaSourceResume';import {clampMediaTime,getBufferedPercentage,@@ -73,6 +75,8 @@ export const MobileVideoViewer = observer(function MobileVideoViewer({}: MobileVideoViewerProps) {const {i18n} = useLingui();const videoRef = useRef<HTMLVideoElement>(null);+ useMediaSourceResume(videoRef);+ const handleVideoError = useAttachmentRefreshOnError(src);useInAppMediaSoundCapture(videoRef);const [isPlaying, setIsPlaying] = useState(false);const [zoomState, setZoomState] = useState<ZoomState>('fit');@@ -398,6 +402,7 @@ export const MobileVideoViewer = observer(function MobileVideoViewer({loop={loop}muted={VideoVolume.isMuted}onPointerUp={handleVideoPointerUp}+ onError={handleVideoError}data-flx="voice.mobile-video-viewer.video"/></PanZoomSurface>diff --git a/fluxer_app_proxy/src/csp.rs b/fluxer_app_proxy/src/csp.rsindex beb415cf8..a02fd617d 100644--- a/fluxer_app_proxy/src/csp.rs+++ b/fluxer_app_proxy/src/csp.rs@@ -128,7 +128,7 @@ const STYLE_SOURCES: &[&str] = &[const FONT_SOURCES: &[&str] = &["https://*.fluxer.app","https://fonts.gstatic.com",- "https://api.fonts.coollabs.io",+ "https://cdn.fonts.coollabs.io",];const CONNECT_SOURCES: &[&str] = &[@@ -287,7 +287,7 @@ fn build_csp_directives(let mut style = vec!["'self'".to_owned(), "'unsafe-inline'".to_owned()];extend_from(&mut style, &config.extra_style_src, STYLE_SOURCES);- extend_runtime_sources(&mut style, runtime_sources, instance_sources, true, true);+ extend_runtime_sources(&mut style, runtime_sources, instance_sources, true, false);directives.push(format!("style-src {}", style.join(" ")));let mut img = vec!["'self'".to_owned(), "blob:".to_owned(), "data:".to_owned()];@@ -303,7 +303,7 @@ fn build_csp_directives(extend_runtime_sources(&mut media, runtime_sources, instance_sources, true, true);directives.push(format!("media-src {}", media.join(" ")));- let mut font = vec!["'self'".to_owned(), "data:".to_owned()];+ let mut font = vec!["'self'".to_owned(), "blob:".to_owned(), "data:".to_owned()];extend_from(&mut font, &config.extra_font_src, FONT_SOURCES);extend_runtime_sources(&mut font, runtime_sources, instance_sources, true, true);directives.push(format!("font-src {}", font.join(" ")));diff --git a/fluxer_common/src/attachment_url_signature.rs b/fluxer_common/src/attachment_url_signature.rsindex 5566d01ad..04b5eb2ab 100644--- a/fluxer_common/src/attachment_url_signature.rs+++ b/fluxer_common/src/attachment_url_signature.rs@@ -41,6 +41,7 @@ impl Verdict {pub struct Verification {pub verdict: Verdict,pub remaining_secs: Option<u64>,+ pub expired_secs: Option<u64>,}impl Verification {@@ -48,6 +49,7 @@ impl Verification {Self {verdict,remaining_secs: None,+ expired_secs: None,}}}@@ -190,11 +192,16 @@ pub fn verify(return Verification::without_expiry(Verdict::Valid);}if now_secs >= expires {- return Verification::without_expiry(Verdict::Expired);+ return Verification {+ verdict: Verdict::Expired,+ remaining_secs: None,+ expired_secs: Some(now_secs - expires),+ };}Verification {verdict: Verdict::Valid,remaining_secs: Some(expires - now_secs),+ expired_secs: None,}}diff --git a/fluxer_desktop/src/main/LocalAppCSP.ts b/fluxer_desktop/src/main/LocalAppCSP.tsindex 7cd4ebf19..de241a783 100644--- a/fluxer_desktop/src/main/LocalAppCSP.ts+++ b/fluxer_desktop/src/main/LocalAppCSP.ts@@ -35,7 +35,7 @@ const STYLE_SOURCES: ReadonlyArray<string> = Object.freeze([const FONT_SOURCES: ReadonlyArray<string> = Object.freeze(['https://*.fluxer.app','https://fonts.gstatic.com',- 'https://api.fonts.coollabs.io',+ 'https://cdn.fonts.coollabs.io',]);const CONNECT_SOURCES: ReadonlyArray<string> = Object.freeze([@@ -95,7 +95,7 @@ export function buildLocalAppCSP({nonce, cleartextInstanceOrigins = []}: LocalApextendFrom(media, cleartextSources);directives.push(`media-src ${media.join(' ')}`);- const font = [SELF_SOURCE, 'data:'];+ const font = [SELF_SOURCE, 'blob:', 'data:'];extendFrom(font, FONT_SOURCES);directives.push(`font-src ${font.join(' ')}`);diff --git a/fluxer_desktop/src/main/LocalAppRemoteResourceRequestHandler.ts b/fluxer_desktop/src/main/LocalAppRemoteResourceRequestHandler.tsindex 1d9183c4b..9d4711c77 100644--- a/fluxer_desktop/src/main/LocalAppRemoteResourceRequestHandler.ts+++ b/fluxer_desktop/src/main/LocalAppRemoteResourceRequestHandler.ts@@ -39,6 +39,15 @@ interface ForwardRemoteResourceRequest {readonly signal: AbortSignal;}+const RANGE_NOT_SATISFIABLE_STATUS = 416;++function isRefusedMidFileRead(request: Request, response: Response): boolean {+ if (request.method !== 'GET' || response.status < HttpStatus.BAD_REQUEST) return false;+ if (response.status === RANGE_NOT_SATISFIABLE_STATUS) return false;+ const start = /^bytes=(\d+)-/u.exec(request.headers.get('range') ?? '')?.[1];+ return start !== undefined && Number(start) > 0;+}+export class DesktopLocalAppRemoteResourceRequestHandler {private readonly proxyClient: DesktopLocalAppProxyClient;private readonly runtimePlans: LocalAppRemoteResourceRuntimePlans;@@ -97,6 +106,10 @@ export class DesktopLocalAppRemoteResourceRequestHandler {uploadId,uploadTotalBytes: readRequestContentLength(request.headers),});+ if (isRefusedMidFileRead(request, response)) {+ await response.body?.cancel();+ return Response.error();+ }const body = await this.proxyClient.responseBodyForMethod({method: request.method,response,diff --git a/fluxer_docs/src/content/docs/http-api/instance.mdx b/fluxer_docs/src/content/docs/http-api/instance.mdxindex e0e0bc2c9..540e81efd 100644--- a/fluxer_docs/src/content/docs/http-api/instance.mdx+++ b/fluxer_docs/src/content/docs/http-api/instance.mdx@@ -419,7 +419,7 @@ What a client needs before anyone signs in.| premium_product_name | string | The name of the premium tier, `Premium` unless an admin sets one || premium_info_url | ?string | URL of a page about the premium tier, or null || sign_in_backdrop_url | ?string | Image shown behind the sign-in screens, or null for the default |-| custom_css | ?string | CSS the web and desktop app apply before the person's own theme, or null |+| custom_css | ?string | CSS the web and desktop app apply before the person's own theme, except on sign-in pages, or null || upload_limit_message | ?string | Markdown shown when a file is over the upload limit, or null for the default text || trusted_domains | string[] | Extra domains whose links open without a warning. Entries are hostnames, and a `*.` prefix also covers subdomains |diff --git a/fluxer_docs/src/content/docs/http-api/memes.mdx b/fluxer_docs/src/content/docs/http-api/memes.mdxindex 50cc974bb..55e6fc080 100644--- a/fluxer_docs/src/content/docs/http-api/memes.mdx+++ b/fluxer_docs/src/content/docs/http-api/memes.mdx@@ -59,7 +59,7 @@ A meme object is one saved file. You can change only `name`, `alt_text` and `tag"filename": "party_parrot.gif","content_type": "image/gif","size": 40213,- "url": "https://media.example.com/attachments/1501314428688998183/party_parrot.gif?ex=6a1b2c3d&sig=4f9e2a",+ "url": "https://media.example.com/attachments/1501314428688998182/1501314428688998183/party_parrot.gif?ex=69fba4b5&is=69fa5335&hm=5586be3ae70411fe6582431649e2f28abc6c201e4f12a4f43a3256b72b90d3de","content_hash": "b3f1c2e4a5d6978812ab34cd56ef7890","width": 320,"height": 240,diff --git a/fluxer_docs/src/content/docs/http-api/messages.mdx b/fluxer_docs/src/content/docs/http-api/messages.mdxindex 5850a9b9a..292341721 100644--- a/fluxer_docs/src/content/docs/http-api/messages.mdx+++ b/fluxer_docs/src/content/docs/http-api/messages.mdx@@ -843,7 +843,7 @@ The rate limit is 10 requests per 10 seconds, on the `channel:attachment:upload:<RouteHeader method="POST" path="/v1/attachments/refresh-urls" bot />-Signs 1 to 50 attachment URLs again, each valid for another 24 hours. OAuth2 tokens can't use this route.+Signs 1 to 50 attachment URLs again. A refreshed URL is valid until its `ex`, which is 12 to 24 hours away. Check `ex` on each URL, because it isn't always a full day. OAuth2 tokens can't use this route.### JSON body@@ -863,7 +863,7 @@ Signs 1 to 50 attachment URLs again, each valid for another 24 hours. OAuth2 tok| --- | --- | --- || 200 | response body | The URLs were signed |-The rate limit is 20 requests per 10 seconds, on the `attachment:refresh_urls` bucket.+The rate limit is 60 requests per 10 seconds, on the `attachment:refresh_urls` bucket.## Create messagediff --git a/fluxer_docs/src/content/docs/media-proxy/overview.md b/fluxer_docs/src/content/docs/media-proxy/overview.mdindex cbb4ffa53..7131dd5cb 100644--- a/fluxer_docs/src/content/docs/media-proxy/overview.md+++ b/fluxer_docs/src/content/docs/media-proxy/overview.md@@ -60,7 +60,7 @@ Under `enforce`, an `Origin` must match an entry in `FLUXER_MEDIA_PROXY_CORS_ALLA preflight `OPTIONS` request from an allowed origin gets a 204 that allows `GET` and `HEAD` with the `Range` header, and a refused origin gets the same 403 as a read.-The policy applies to `mp` and `upload` processes and not to the upload relay or the operator endpoints. If a shared cache sits in front of the Media Proxy, purge `/attachments/` when you switch from `off` to `enforce`.+The policy applies to `mp` and `upload` processes and not to the upload relay or the operator endpoints. If a shared cache is in front of the Media Proxy, purge `/attachments/` when you switch from `off` to `enforce`.## Signed attachment URLs@@ -84,9 +84,9 @@ A [data package URL](/http-api/messages/#data-package-attachment-urls) never exp?ex=0&is={issued}&hm={signature}&uc=dp```-Keep `ex`, `is`, `hm` and `uc` as issued, and you can add or change any other parameter. One signed URL works for every [transformation](/media-proxy/transformations/) and `download` variant of its file. A read is refused when a signature parameter is missing or malformed, the signature doesn't match a configured secret, or the URL has expired. A shared cache must leave `ex`, `is`, `hm` and `uc` out of its cache key.+Keep `ex`, `is`, `hm` and `uc` as issued, and you can add or change any other parameter. One signed URL works for every [transformation](/media-proxy/transformations/) and `download` variant of its file. A request is refused when a signature parameter is missing or malformed, the signature doesn't match a configured secret, or the URL has expired. A shared cache must leave `ex`, `is`, `hm` and `uc` out of its cache key. If a shared cache is in front of the Media Proxy, purge `/attachments/` after every `mp` and `upload` process runs `enforce`, because entries stored under `off` keep their year-long cache lifetime.-Under `enforce`, a refused read returns the same 404 as a missing file, with the body `This content is no longer available.` Under `report`, each read that `enforce` would refuse logs a warning with the reason `attachment_signature_would_deny`. The policy covers `/attachments/` paths on `mp` and `upload` processes.+Under `enforce`, a refused request returns the same 404 as a missing file, with the body `This content is no longer available.`, and the Media Proxy logs a warning with the reason `attachment_signature_refused`. Under `report`, the Media Proxy logs a warning with the reason `attachment_signature_would_deny` for each request that `enforce` would refuse, and the response has `Cache-Control: no-store`. These warnings are limited to 20 a second. The policy applies to `/attachments/` paths on `mp` and `upload` processes.Any signed-in user or bot can re-sign an attachment URL with [Refresh attachment URLs](/http-api/messages/#refresh-attachment-urls). A signature limits how long a copied URL works and not who can open the file.diff --git a/fluxer_docs/src/content/docs/operator/environment.mdx b/fluxer_docs/src/content/docs/operator/environment.mdxindex 5e5e79e88..4f1398494 100644--- a/fluxer_docs/src/content/docs/operator/environment.mdx+++ b/fluxer_docs/src/content/docs/operator/environment.mdx@@ -868,7 +868,7 @@ Whether uploads go through when a ClamAV scan fails, such as when Fluxer can't c### `FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64`-Keys that sign attachment URLs, separated by commas. Each is standard base64 that decodes to at least 32 bytes. The first entry signs and every entry verifies. To rotate keys, put the new key first. When it's empty, Fluxer returns unsigned attachment URLs. Keep it secret. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64`.+Keys that sign attachment URLs, separated by commas. Each is standard base64 that decodes to at least 32 bytes. The first entry signs and every entry verifies. To rotate keys, add the new key last and restart the stack. Then move it first and restart again. Every process can then verify the new key before any process signs with it. Remove the old key 24 hours later. Removing a key ends the data package links it signed. When it's empty, Fluxer returns unsigned attachment URLs. Keep it secret. With rexctl, use `rexctl config set FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64`.### `FLUXER_MEDIA_PROXY_UPLOAD_RELAY_ENDPOINT`diff --git a/fluxer_media_proxy/src/request_log/mod.rs b/fluxer_media_proxy/src/request_log/mod.rsindex 6a27981d6..ec5b33540 100644--- a/fluxer_media_proxy/src/request_log/mod.rs+++ b/fluxer_media_proxy/src/request_log/mod.rs@@ -238,6 +238,8 @@ wherensfw_ms,reason = code,source = %source,+ referer = referer.as_deref().unwrap_or(""),+ user_agent = user_agent.as_deref().unwrap_or(""),"request rejected"),}diff --git a/fluxer_media_proxy/src/server/attachment_signature.rs b/fluxer_media_proxy/src/server/attachment_signature.rsindex 80f08e403..a0beb4e3d 100644--- a/fluxer_media_proxy/src/server/attachment_signature.rs+++ b/fluxer_media_proxy/src/server/attachment_signature.rs@@ -3,11 +3,12 @@use crate::{config::AttachmentSignatureConfig,metrics::now_ms,+ public_net_policy::external_url_for_log,request_log::{self, HEADER_LOG_BYTES_MAX, RequestId, clip},- server::response::error::text_with_source,+ server::{response::error::text_with_source, transform::cache::forbid_storing},};use axum::{- http::{HeaderMap, HeaderValue, Method, StatusCode, header},+ http::{HeaderMap, HeaderName, HeaderValue, Method, StatusCode, header},response::Response,};use fluxer_common::attachment_url_signature::{@@ -63,18 +64,21 @@ pub(in crate::server) fn check(return Verification {verdict: Verdict::Malformed,remaining_secs: None,+ expired_secs: None,};};verify(&key, raw_query, &cfg.secrets(), now_secs())}pub(in crate::server) fn limit_cache_lifetime(response: &mut Response, verification: Verification) {- if verification.verdict != Verdict::Valid- || !matches!(- response.status(),- StatusCode::OK | StatusCode::PARTIAL_CONTENT- )- {+ if !matches!(+ response.status(),+ StatusCode::OK | StatusCode::PARTIAL_CONTENT+ ) {+ return;+ }+ if verification.verdict != Verdict::Valid {+ forbid_storing(response);return;}let headers = response.headers_mut();@@ -124,25 +128,46 @@ pub(in crate::server) fn masked_not_found_response(key: &str) -> Response {)}-pub(in crate::server) fn log_would_deny(+pub(in crate::server) fn log_refusal(budget: &WouldDenyLog,+ enforced: bool,method: &Method,- verdict: Verdict,+ verification: Verification,headers: &HeaderMap,request_id: Option<&RequestId>,) {let Some(suppressed) = budget.admit(now_ms()) else {return;};+ let (reason, message) = if enforced {+ ("attachment_signature_refused", "attachment read refused")+ } else {+ (+ "attachment_signature_would_deny",+ "attachment read would be refused",+ )+ };+ let referer = headers+ .get(header::REFERER)+ .and_then(|value| value.to_str().ok())+ .map(external_url_for_log)+ .unwrap_or_default();tracing::warn!(- reason = "attachment_signature_would_deny",+ reason,kind = request_log::classify_route(ATTACHMENT_PATH).label(),method = %method,- verdict = verdict.label(),+ verdict = verification.verdict.label(),+ expired_for_secs = verification.expired_secs,req = request_id.map(RequestId::as_str).unwrap_or(""),suppressed,- user_agent = %user_agent_for_log(headers),- "attachment read would be refused"+ user_agent = %header_for_log(headers, header::USER_AGENT),+ referer = %clip(&referer, HEADER_LOG_BYTES_MAX),+ origin = %header_for_log(headers, header::ORIGIN),+ sec_fetch_dest = %header_for_log(headers, HeaderName::from_static("sec-fetch-dest")),+ sec_fetch_mode = %header_for_log(headers, HeaderName::from_static("sec-fetch-mode")),+ sec_fetch_site = %header_for_log(headers, HeaderName::from_static("sec-fetch-site")),+ has_range = headers.contains_key(header::RANGE),+ "{message}");}@@ -156,9 +181,9 @@ fn refusal_code(verdict: Verdict) -> &'static str {}}-fn user_agent_for_log(headers: &HeaderMap) -> String {+fn header_for_log(headers: &HeaderMap, name: HeaderName) -> String {headers- .get(header::USER_AGENT)+ .get(name).and_then(|value| value.to_str().ok()).map(|value| clip(value, HEADER_LOG_BYTES_MAX)).unwrap_or_default()diff --git a/fluxer_media_proxy/src/server/routes/dispatch.rs b/fluxer_media_proxy/src/server/routes/dispatch.rsindex b546d760a..f7178444a 100644--- a/fluxer_media_proxy/src/server/routes/dispatch.rs+++ b/fluxer_media_proxy/src/server/routes/dispatch.rs@@ -134,16 +134,18 @@ async fn serve_public_read(app: &Arc<AppState>, read: PublicRead<'_>) -> Respons.attachment_signature().record(verification.verdict);if verification.verdict != Verdict::Valid {- if signature_mode == PolicyMode::Enforce {- return attachment_signature::denied_response(verification.verdict);- }- attachment_signature::log_would_deny(+ let enforced = signature_mode == PolicyMode::Enforce;+ attachment_signature::log_refusal(&app.signature_log,+ enforced,&method,- verification.verdict,+ verification,headers,request_id,);+ if enforced {+ return attachment_signature::denied_response(verification.verdict);+ }}checked = Some(verification);}diff --git a/fluxer_messages/src/shard_impl.rs b/fluxer_messages/src/shard_impl.rsindex c71cce60b..bf46b6e19 100644--- a/fluxer_messages/src/shard_impl.rs+++ b/fluxer_messages/src/shard_impl.rs@@ -3105,6 +3105,10 @@ fn own_attachment_key(input_url: &str, media_endpoint: &str) -> Option<(String,if !path.starts_with("/attachments/") {return None;}+ let parsed_url = Url::parse(input_url).ok()?;+ if !fluxer_common::external_media_path::is_own_media_url(media_endpoint, &parsed_url) {+ return None;+ }let storage_key = fluxer_common::attachment_url_signature::decode_key(path)?;let attachment_id = attachment_key_id(&storage_key)?;Some((storage_key, attachment_id))diff --git a/fluxer_rexctl/internal/instance/envvars.go b/fluxer_rexctl/internal/instance/envvars.goindex 9be01439b..8a3041516 100644--- a/fluxer_rexctl/internal/instance/envvars.go+++ b/fluxer_rexctl/internal/instance/envvars.go@@ -234,7 +234,7 @@ var envVars = []envVar{{"FLUXER_CLAMAV_HOST", "media", "The hostname or address of your ClamAV scanner. When it's empty, Fluxer uses `127.0.0.1`."},{"FLUXER_CLAMAV_PORT", "media", "The port of your ClamAV scanner. When it's empty, Fluxer uses `3310`."},{"FLUXER_CLAMAV_FAIL_OPEN", "media", "Whether uploads go through when a ClamAV scan fails, such as when Fluxer can't connect to the scanner or gets no usable answer. Use `true` or `false`. When it's empty, Fluxer rejects the upload."},- {"FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64", "media", "Keys that sign attachment URLs, separated by commas. Each is standard base64 that decodes to at least 32 bytes. The first entry signs and every entry verifies. To rotate keys, put the new key first. When it's empty, Fluxer returns unsigned attachment URLs."},+ {"FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64", "media", "Keys that sign attachment URLs, separated by commas. Each is standard base64 that decodes to at least 32 bytes. The first entry signs and every entry verifies. To rotate keys, add the new key last and restart the stack. Then move it first and restart again. Every process can then verify the new key before any process signs with it. Remove the old key 24 hours later. Removing a key ends the data package links it signed. When it's empty, Fluxer returns unsigned attachment URLs."},{"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_ENDPOINT", "media", "The upload relay URL the API hands to clients. When it's empty, the API uses the public origin followed by /media."},{"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_MAX_BODY_BYTES", "media", "The largest upload the relay accepts, in bytes from 1 to 5 GiB. It can't be more than FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SPOOL_MAX_TOTAL_BYTES. When it's empty, the relay uses `524288000`, which is 500 MiB."},{"FLUXER_MEDIA_PROXY_UPLOAD_RELAY_TOKEN_TTL_SECS", "media", "How long an upload relay token stays valid, in seconds. When it's empty, the API uses `900`."},diff --git a/fluxer_rexctl/internal/instance/shipped.json b/fluxer_rexctl/internal/instance/shipped.jsonindex e9247024a..e33954560 100644--- a/fluxer_rexctl/internal/instance/shipped.json+++ b/fluxer_rexctl/internal/instance/shipped.json@@ -1,6 +1,7 @@{".env.example": ["013e26017b51e7310d7e044090b50d0b4ae33cd1d91f0ac380a0a6783d9edab1",+ "02c25f1579248b44399519b505152e6f0b3b42f99f6888d7ccab31d75aeb0786","039e161673ae76f5b8cc5562a7e6acebc1a211ffaf65d488a993f16ca481fb94","04a85d483aeaf1425fbd2134f6914ebac513646f160300e0c968ea7d6b0f33a4","0b718956b039a8d8402bd9c6102322fb273159f2834509fdf23a95459c7537b9",diff --git a/fluxer_rexctl/internal/stack/files/.env.example b/fluxer_rexctl/internal/stack/files/.env.exampleindex 9f3d76541..a8dc46552 100644--- a/fluxer_rexctl/internal/stack/files/.env.example+++ b/fluxer_rexctl/internal/stack/files/.env.example@@ -1222,8 +1222,11 @@ FLUXER_VAPID_PRIVATE_KEY=# Keys that sign attachment URLs, separated by commas. Each is standard base64# that decodes to at least 32 bytes. The first entry signs and every entry-# verifies. To rotate keys, put the new key first. When it's empty, Fluxer-# returns unsigned attachment URLs. Keep it secret.+# verifies. To rotate keys, add the new key last and restart the stack. Then+# move it first and restart again. Every process can then verify the new key+# before any process signs with it. Remove the old key 24 hours later.+# Removing a key ends the data package links it signed. When it's empty,+# Fluxer returns unsigned attachment URLs. Keep it secret.# rexctl: rexctl config set FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64# FLUXER_MEDIA_PROXY_ATTACHMENT_URL_SECRETS_BASE64=diff --git a/packages/schema/src/domains/instance/InstanceSchemas.ts b/packages/schema/src/domains/instance/InstanceSchemas.tsindex a4cb2a543..50a6538ae 100644--- a/packages/schema/src/domains/instance/InstanceSchemas.ts+++ b/packages/schema/src/domains/instance/InstanceSchemas.ts@@ -84,7 +84,9 @@ export const InstanceBrandingSchema = zcustom_css: z.string().nullable()- .describe('Optional stylesheet a self-hosted instance applies to every page of its web and desktop app'),+ .describe(+ 'Optional stylesheet a self-hosted instance applies to its web and desktop app, except on sign-in pages',+ ),upload_limit_message: z.string().nullable()diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex ddfe21dec..ed229660f 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1361,6 +1361,9 @@ importers:'@codemirror/view':specifier: ^6.43.15version: 6.43.15+ '@csstools/css-tokenizer':+ specifier: 4.0.2+ version: 4.0.2'@floating-ui/react':specifier: 'catalog:'