This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,43 @@
// Metro module 11188 (f11189).
import { ImageBackground, StyleSheet } from "react-native";
import { Fragment } from "react/jsx-runtime";
import { ForumPostMediaSpoiler } from "../../forums/native/posts/ForumPostMedia";
import FastImage from "../../../components_native/common/FastImage";
import { isAndroid } from "../../../utils/PlatformUtils";
let MediaPostGridThumbnailIOS;
const MediaPostGridThumbnailAndroid = function MediaPostGridThumbnailAndroid(props) {
const { shouldSpoiler, blurTheme, source, androidStyle, backgroundImagesource, resizeMode } = props;
return backgroundImagesource == null ? <ImageBackground style={androidStyle} source={source} blurRadius={shouldSpoiler ? 10 : 0} resizeMode="cover">
<ForumPostMediaSpoiler shouldSpoiler={shouldSpoiler} blurTheme={blurTheme} />
</ImageBackground> : <ImageBackground style={androidStyle} source={backgroundImagesource} resizeMode="cover" imageStyle={{
opacity: 0.2
}}>
<FastImage style={StyleSheet.absoluteFill} source={source} resizeMode={resizeMode} />
<ForumPostMediaSpoiler shouldSpoiler={shouldSpoiler} blurTheme={blurTheme} />
</ImageBackground>;
};
MediaPostGridThumbnailIOS = function MediaPostGridThumbnailIOS(props) {
const { shouldSpoiler, blurTheme, source, iosStyle, backgroundImagesource, resizeMode } = props;
return <Fragment {...backgroundImagesource == null ? {
children: [<FastImage style={iosStyle} source={source} resizeMode={resizeMode} />, <ForumPostMediaSpoiler shouldSpoiler={shouldSpoiler} blurTheme={blurTheme} />]
} : {
children: [<FastImage style={[StyleSheet.absoluteFill, {
opacity: 0.2
}]} source={backgroundImagesource} resizeMode="cover" />, <FastImage style={iosStyle} source={source} resizeMode={resizeMode} />, <ForumPostMediaSpoiler shouldSpoiler={shouldSpoiler} blurTheme={blurTheme} />]
}} />;
};
export default function MediaPostGridThumbnail(props) {
const r0 = props.isPortrait === true && props.shouldSpoiler === false;
let resizeMode = "cover";
let backgroundImagesource = void 0;
if (r0) {
backgroundImagesource = props.source;
resizeMode = "contain";
}
const props2 = {
...props,
backgroundImagesource,
resizeMode
};
return isAndroid() ? <MediaPostGridThumbnailAndroid {...props2} /> : <MediaPostGridThumbnailIOS {...props2} />;
};
@@ -0,0 +1,76 @@
// Metro module 9581 (f9582).
import { View } from "react-native";
import { ContentDismissActionType } from "../../dismissible_content/DismissibleContentConstants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import useSafeAreaInsets_native from "../../safe_area/useSafeAreaInsets.native";
import { BottomSheet } from "../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetScrollView } from "../../../_bundle/Module5245";
import { Text } from "../../../design/components/Text/native/Text";
import { intl, t } from "../../../intl/index.native";
import { Checkbox, Spacer } from "../../../design/void/native";
import { Button } from "../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
padding: 24
},
topContainer: {
flex: 1,
width: "100%",
paddingVertical: 40,
paddingHorizontal: 12,
backgroundColor: Module712.colors.TEXT_FEEDBACK_WARNING,
borderRadius: Module712.radii.sm
},
setAsThumbnailContainer: {
flex: 1,
flexDirection: "row",
padding: 12,
width: "100%",
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL,
borderRadius: Module712.radii.sm,
alignItems: "center",
justifyContent: "space-between"
},
contentContainer: {
alignItems: "center",
flex: 1
},
title: {
marginTop: 24
},
description: {
textAlign: "center"
}
});
export default function MediaPostThumbnailActionSheet(props) {
const markAsDismissed = props.markAsDismissed;
const styles = useStyles();
return <BottomSheet backdropOpacity={0.8} onDismiss={() => markAsDismissed(ContentDismissActionType.UNKNOWN)}>
<View style={styles.container}>
<BottomSheetScrollView contentContainerStyle={[styles.contentContainer, {
paddingBottom: useSafeAreaInsets_native().bottom
}]}>
<View style={styles.topContainer}>
<View style={styles.setAsThumbnailContainer}>
<Text variant="text-md/semibold" color="mobile-text-heading-primary">
{intl.string(t.ews2pj)}
</Text>
<Checkbox selected />
</View>
</View>
<Text variant="heading-lg/semibold" color="mobile-text-heading-primary" style={styles.title}>
{intl.string(t.WJisip)}
</Text>
<Spacer size={12} />
<Text variant="text-md/normal" color="text-default" style={styles.description}>
{intl.string(t.X6ZH6d)}
</Text>
<Spacer size={48} />
<Button text={intl.string(t["NX+WJN"])} grow onPress={() => markAsDismissed(ContentDismissActionType.UNKNOWN)} />
</BottomSheetScrollView>
</View>
</BottomSheet>;
};
@@ -0,0 +1,118 @@
// Metro module 12387 (f12388).
import { Image as Image2, processColor } from "react-native";
import DevSettingsStore from "../../devtools/dev_settings/DevSettingsStore";
import ChannelStore from "../../../stores/ChannelStore";
import GuildStore from "../../../stores/GuildStore";
import SelectedGuildStore from "../../../stores/SelectedGuildStore";
import UserStore from "../../../stores/UserStore";
import MediaPostEmbedStore, { FetchState } from "../MediaPostEmbedStore";
import { getMediaPostEmbedChannelId, getMediaPostEmbedCommonData } from "../MediaPostEmbedUtils";
import { canViewChannel } from "../../links/LinkUtils";
import { intl, t } from "../../../intl/index.native";
import { getUserAuthorWithProcessedColor } from "../../messages/native/renderer/system_messages/useAuthorWithProcessedColor";
import formatUsernameOnClick from "../../messages/native/renderer/system_messages/formatUsernameOnClick";
import Module712 from "../../../_bundle/Module712";
import { isAnimatedImageUrl } from "../../messages/MediaFormatTesters";
import Module12388 from "../../../_bundle/Module12388";
import * as _ExplicitMediaRedactionUtils from "../../explicit_media_redaction/ExplicitMediaRedactionUtils";
import { shouldAgeVerifyForExplicitMedia } from "../../explicit_media_redaction/ExplicitMediaRedactionUtils";
import { isVerifiedTeen } from "../../age_assurance/AgeVerificationUtils";
import { getBackgroundImageUrl } from "../MediaPostThumbnailUtils";
export default function createMediaPostPreviewEmbedContent(a0, a1, a2, r10 = false) {
let r148;
const mediaPostEmbedChannelId = getMediaPostEmbedChannelId(a2);
if (mediaPostEmbedChannelId == null) {
return null;
}
if (MediaPostEmbedStore.getEmbedFetchState(mediaPostEmbedChannelId) !== FetchState.FETCHED) {
return null;
}
const media = MediaPostEmbedStore.getMediaPostEmbed(mediaPostEmbedChannelId)?.media;
if (media == null) {
return null;
}
const guild = GuildStore.getGuild(media.guild_id);
const user = UserStore.getUser(media.author_id);
const channel = ChannelStore.getChannel(media.parent_channel_id);
const mediaPostEmbedCommonData = getMediaPostEmbedCommonData({
mediaPostEmbedData: media,
guild,
parentChannel: channel,
postThread: ChannelStore.getChannel(media.channel_id),
user,
selectedGuildId: SelectedGuildStore.getGuildId(),
canAccess: channel != null && canViewChannel(channel)
});
if (mediaPostEmbedCommonData == null) {
return null;
}
const footer = mediaPostEmbedCommonData.authorName != null && (mediaPostEmbedCommonData.channelName != null && user != null) ? intl.formatToParts(t.mCytFr, {
username: mediaPostEmbedCommonData.authorName,
usernameOnClick: formatUsernameOnClick({
userId: user.id,
message: a0,
author: getUserAuthorWithProcessedColor(user, mediaPostEmbedCommonData.postThread),
roleStyle: a1,
messageChannelId: mediaPostEmbedCommonData.threadId
}),
channelName: mediaPostEmbedCommonData.channelName
}) : intl.formatToParts(t.p4VdWJ, {
guildName: mediaPostEmbedCommonData.guildName
});
const ctaButtonColor = mediaPostEmbedCommonData.canAccess === false ? processColor(Module712.unsafe_rawColors.TEAL_430) : processColor(Module712.unsafe_rawColors.BRAND_500);
const r109 = mediaPostEmbedCommonData.coverImage != null && isAnimatedImageUrl(mediaPostEmbedCommonData.coverImage);
if (mediaPostEmbedCommonData.coverImage != null && !mediaPostEmbedCommonData.shouldShowBlurredThumbnailImage && r109 && r10) {
mediaPostEmbedCommonData.coverImage = `${mediaPostEmbedCommonData.coverImage}?format=webp`;
}
if (mediaPostEmbedCommonData.shouldShowBlurredThumbnailImage) {
return {
...mediaPostEmbedCommonData,
blurredCoverImage: Image2.resolveAssetSource(Module12388).uri,
footer,
ctaButtonColor
};
}
const obscureIsOpaque = DevSettingsStore.get("obscure_blur_effect_explicit_content_enabled") || DevSettingsStore.get("obscure_blur_effect_gore_content_enabled") || DevSettingsStore.get("obscure_blur_effect_self_harm_content_enabled");
const isPendingScanVersion = _ExplicitMediaRedactionUtils.isPendingScanVersion(mediaPostEmbedCommonData.contentScanVersion);
const verifyAge = obscureIsOpaque ? shouldAgeVerifyForExplicitMedia() : obscureIsOpaque;
const obscureHideControls = obscureIsOpaque && isVerifiedTeen();
if (mediaPostEmbedCommonData.shouldContainMediaWithBackground && mediaPostEmbedCommonData.coverImage != null) {
const shouldSpoiler2 = mediaPostEmbedCommonData.shouldSpoiler;
let obscure2 = "";
const spoiler2 = shouldSpoiler2 === true ? intl.string(t["F+x38C"]).toUpperCase() : "";
if (obscureIsOpaque) {
obscure2 = intl.string(t.SpxcUR);
}
r148 = {
...mediaPostEmbedCommonData,
footer,
spoiler: spoiler2,
obscure: obscure2,
obscureAwaitingScan: isPendingScanVersion,
verifyAge,
obscureHideControls,
obscureIsOpaque,
ctaButtonColor,
backgroundImage: getBackgroundImageUrl(mediaPostEmbedCommonData.coverImage)
};
} else {
const shouldSpoiler = mediaPostEmbedCommonData.shouldSpoiler;
let obscure = "";
const spoiler = shouldSpoiler === true ? intl.string(t["F+x38C"]).toUpperCase() : "";
if (obscureIsOpaque) {
obscure = intl.string(t.SpxcUR);
}
r148 = {
...mediaPostEmbedCommonData,
footer,
spoiler,
obscure,
obscureAwaitingScan: isPendingScanVersion,
verifyAge,
obscureHideControls,
obscureIsOpaque,
ctaButtonColor
};
}
return r148;
};
@@ -0,0 +1,35 @@
// Metro module 9843 (f9844).
import { useCallback } from "react";
import { DraftType } from "../../../stores/DraftStore";
import UploadAttachmentStore from "../../../stores/UploadAttachmentStore";
import { useStateFromStores } from "../../../_bundle/defaultAreStatesEqual";
import { UploadPlatform } from "../../../lib/uploader/Upload";
import UploadAttachmentActionCreators from "../../../actions/UploadAttachmentActionCreators";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
export default function useSetMediaPostThumbnail(a0, a1) {
const stateFromStores = useStateFromStores([UploadAttachmentStore], () => {
let r11 = UploadAttachmentStore.getUploads(a0, DraftType.ChannelMessage).find((item) => (item == null ? void 0 : item.item?.platform) === UploadPlatform.REACT_NATIVE && item.isThumbnail === true);
if (r11 == null) {
r11 = null;
}
return r11;
});
return useCallback(() => {
if (a1?.id != null) {
if (stateFromStores != null && stateFromStores.id !== a1?.id) {
UploadAttachmentActionCreators.update(a0, stateFromStores.id, DraftType.ChannelMessage, {
thumbnail: false
});
}
let r25 = a1?.isThumbnail;
if (r25 == null) {
r25 = false;
}
UploadAttachmentActionCreators.update(a0, a1?.id, DraftType.ChannelMessage, {
thumbnail: !r25,
spoiler: false
});
ActionSheetActionCreators.hideActionSheet();
}
}, [stateFromStores, a0, a1]);
};