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,24 @@
// Metro module 10301 (f10302).
import { useMemo } from "react";
import MessageRecord, { MessageSnapshotRecord } from "../../../../records/MessageRecord";
import isForwardMessage from "../../../forwarding/isForwardMessage";
export function useGetInitialMessagePreview({ message }) {
return useMemo(() => {
const messageRecord = new MessageRecord(message);
messageRecord.attachments = [];
messageRecord.stickerItems = [];
if (messageRecord.embeds.length > 0) {
messageRecord.embeds = messageRecord.embeds.filter((embed) => embed.image == null && embed.thumbnail == null);
}
if (isForwardMessage(message)) {
messageRecord.messageSnapshots = messageRecord.messageSnapshots.map((messageSnapshot) => new MessageSnapshotRecord({
message: messageSnapshot.message.merge({
attachments: [],
embeds: [],
stickerItems: []
})
}));
}
return messageRecord;
}, [message]);
}
@@ -0,0 +1,147 @@
// Metro module 10295 (f10296).
import { useMemo } from "react";
import { View, StyleSheet } from "react-native";
import { MessageEmbedTypes, MessageFlags } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { useToken } from "../../../../design/tokens/native/useToken";
import Module712 from "../../../../_bundle/Module712";
import Module8531, { Path } from "../../../../_bundle/Module8531";
import { CirclePlayIcon } from "../../../../design/components/Icon/native/redesign/generated/CirclePlayIcon";
import { WaveformIcon } from "../../../../design/components/Icon/native/redesign/generated/WaveformIcon";
import * as _MediaFormatTesters from "../../../messages/MediaFormatTesters";
import { isImageFile, isVideoFile } from "../../../messages/MediaFormatTesters";
import { FileIcon } from "../../../../design/components/Icon/native/redesign/generated/FileIcon";
import isForwardMessage from "../../../forwarding/isForwardMessage";
let c6878_10, useStyles, getBasePreviewableMedia;
const VoiceMessageIcon = function VoiceMessageIcon() {
const styles = useStyles();
return <>
<Module8531 width="100%" height="100%" viewBox="0 0 64 61" fill="none">
<Path d="M22.2188 59.8545C19.5607 61.6263 16.0003 59.7208 16 56.5264V48C7.16344 48 2.5772e-07 40.8366 0 32V16C0 7.16344 7.16344 0 16 0H48C56.8366 0 64 7.16344 64 16V32C64 40.8366 56.8366 48 48 48H40L22.2188 59.8545Z" fill={useToken(Module712.colors.BACKGROUND_MOD_STRONG)} stroke={useToken(Module712.colors.BACKGROUND_MOD_SUBTLE)} />
</Module8531>
<View style={styles.voiceMessageIconOverlay}>
<CirclePlayIcon size="md" color="background-brand" secondaryColor="white" />
<WaveformIcon size="md" color="background-brand" />
</View>
</>;
};
getBasePreviewableMedia = function getBasePreviewableMedia({ message: message2, isForward }) {
const r43 = [];
if (message2.attachments.length > 0) {
const hasFlag = message2.hasFlag(MessageFlags.IS_VOICE_MESSAGE);
const attachments = message2.attachments;
if (hasFlag) {
const media4 = attachments[0];
r43.push({
id: `${media4.id}-${c6878_10.VOICE_MESSAGE}`,
type: c6878_10.VOICE_MESSAGE,
media: media4,
icon: <VoiceMessageIcon />,
parentType: isForward ? "forward" : null
});
} else {
for (const item of attachments) {
const filename = item.filename;
if (isImageFile(filename)) {
const media3 = item;
r43.push({
id: `${media3.id}-${c6878_10.IMAGE}`,
type: c6878_10.IMAGE,
media: media3,
parentType: isForward ? "forward" : null
});
} else if (isVideoFile(filename)) {
const media2 = item;
r43.push({
id: `${media2.id}-${c6878_10.VIDEO}`,
type: c6878_10.VIDEO,
media: media2,
parentType: isForward ? "forward" : null
});
} else {
const isAudioFile = _MediaFormatTesters.isAudioFile(filename);
const r67 = {
id: null,
type: null,
media: null,
icon: null,
parentType: null
};
const media = item;
const id = media.id;
if (isAudioFile) {
r67.id = `${id}-${c6878_10.AUDIO}`;
r67.type = c6878_10.AUDIO;
r67.media = media;
r67.icon = <CirclePlayIcon size="lg" color="background-brand" secondaryColor="white" />;
r67.parentType = isForward ? "forward" : null;
r43.push(r67);
} else {
r67.id = `${id}-${c6878_10.FILE}`;
r67.type = c6878_10.FILE;
r67.media = media;
r67.icon = <FileIcon size="lg" color={Module712.colors.ICON_SUBTLE} />;
r67.parentType = isForward ? "forward" : null;
r43.push(r67);
}
}
}
}
}
for (const embed of message2.embeds) {
if (embed.type === MessageEmbedTypes.GIFV) {
r43.push({
id: `${embed.id}-${c6878_10.GIF}`,
type: c6878_10.GIF,
media: embed,
parentType: isForward ? "forward" : null
});
}
}
if (message2.stickerItems.length > 0) {
const media6 = message2.stickerItems[0];
r43.push({
id: `${media6.id}-${c6878_10.STICKER}`,
type: c6878_10.STICKER,
media: media6,
parentType: isForward ? "forward" : null
});
}
return r43;
};
c6878_10 = {
IMAGE: "image",
VIDEO: "video",
AUDIO: "audio",
FILE: "file",
STICKER: "sticker",
GIF: "gif",
VOICE_MESSAGE: "voice_message"
};
useStyles = createStyles({
voiceMessageIconOverlay: {
...StyleSheet.absoluteFillObject,
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
paddingBottom: 13
}
});
export { c6878_10 as PreviewableMediaTypes };
export function usePreviewableMedia(a0) {
const message = a0;
return useMemo(() => {
const r3 = [];
r3.push.apply(r3, [...getBasePreviewableMedia({
message,
isForward: false
})]);
if (isForwardMessage(message) && message.messageSnapshots.length > 0) {
r3.push.apply(r3, [...getBasePreviewableMedia({
message: message.messageSnapshots[0].message,
isForward: true
})]);
}
return r3;
}, [a0]);
}
@@ -0,0 +1,125 @@
// Metro module 10300 (f10301).
import { useMemo } from "react";
import { PreviewableMediaTypes } from "./usePreviewableMedia";
import { intl, t } from "../../../../intl/index.native";
export function usePreviewableMediaText({ previewableMedia, author }) {
return useMemo(() => {
if (previewableMedia.length === 0) {
return {
text: null,
secondaryText: null
};
}
if (previewableMedia.length === 1) {
const r74 = previewableMedia[0];
const type = r74.type;
if (PreviewableMediaTypes.IMAGE === type) {
return author != null ? {
text: intl.formatToPlainString(t.pTiyNB, {
username: author.nick
}),
secondaryText: null
} : {
text: intl.string(t.tCcq5p),
secondaryText: null
};
}
if (PreviewableMediaTypes.VIDEO === type) {
return author != null ? {
text: intl.formatToPlainString(t.zqhHWH, {
username: author.nick
}),
secondaryText: null
} : {
text: intl.string(t.KxO2Yl),
secondaryText: null
};
}
if (PreviewableMediaTypes.AUDIO === type) {
return author != null ? {
text: intl.formatToPlainString(t.HADQ6n, {
username: author.nick
}),
secondaryText: r74.media.filename
} : {
text: intl.string(t.FWqQt5),
secondaryText: r74.media.filename
};
}
if (PreviewableMediaTypes.FILE === type) {
return author != null ? {
text: intl.formatToPlainString(t["ifW/ef"], {
username: author.nick
}),
secondaryText: r74.media.filename
} : {
text: intl.string(t.mX8M6i),
secondaryText: r74.media.filename
};
}
if (PreviewableMediaTypes.STICKER === type) {
return author != null ? {
text: intl.formatToPlainString(t["3iI/fs"], {
username: author.nick
}),
secondaryText: null
} : {
text: intl.string(t.dyquw8),
secondaryText: null
};
}
if (PreviewableMediaTypes.VOICE_MESSAGE === type) {
return author != null ? {
text: intl.formatToPlainString(t.Y7wlOj, {
username: author.nick
}),
secondaryText: null
} : {
text: intl.string(t.slFYgi),
secondaryText: null
};
}
if (PreviewableMediaTypes.GIF === type) {
return author != null ? {
text: intl.formatToPlainString(t.mikhon, {
username: author.nick
}),
secondaryText: null
} : {
text: intl.string(t.p0oZmy),
secondaryText: null
};
}
return author != null ? {
text: intl.formatToPlainString(t["7FJeVi"], {
username: author.nick
}),
secondaryText: null
} : {
text: intl.string(t.sDqZHL),
secondaryText: null
};
}
const r7 = previewableMedia.every((item) => item.type === PreviewableMediaTypes.FILE);
const length = previewableMedia.length;
const r29 = author != null ? intl.format(t["319zWs"], {
count: length,
username: author.nick
}) : intl.formatToPlainString(t.y0gZht, {
count: length
});
let text = author != null ? intl.format(t["1OSGGk"], {
count: length,
username: author.nick
}) : intl.formatToPlainString(t["8/qgDd"], {
count: length
});
if (r7) {
text = r29;
}
return {
text,
secondaryText: null
};
}, [author, previewableMedia]);
}
@@ -0,0 +1,19 @@
// Metro module 10280 (f10281).
import { useMemo } from "react";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { useToken } from "../../../../design/tokens/native/useToken";
import Module712 from "../../../../_bundle/Module712";
import Module689 from "../../../../_bundle/Module689";
const useStyles = createStyles({
gradient: {
height: 40
}
});
export default function useTruncatedGradientColors() {
const styles = useStyles();
const token = useToken(Module712.colors.MOBILE_ALERT_BACKGROUND_DEFAULT);
return {
gradientColors: useMemo(() => [Module689(token).alpha(0).hex(), Module689(token).alpha(0.72).hex()], [token]),
gradientStyles: styles.gradient
};
};