// Metro module 15365 (f15366). import * as Module19 from "react"; import { useContext, useMemo, useEffect, useCallback } from "react"; import { View } from "react-native"; import ChannelStore from "../../../stores/ChannelStore"; import GuildMemberStore from "../../../stores/GuildMemberStore"; import GuildStore from "../../../stores/GuildStore"; import RelationshipStore from "../../../stores/RelationshipStore"; import UserGuildSettingsStore from "../../../stores/UserGuildSettingsStore"; import UserStore from "../../../stores/UserStore"; import { ITEM_PADDING } from "./DesignConstants"; import { DEFAULT_ROLE_COLOR_HEX, MessageEmbedTypes } from "../../../Constants"; import Module712 from "../../../_bundle/Module712"; import { createICYMIStyles } from "./createICYMIStyles"; import { isAndroid } from "../../../utils/PlatformUtils"; import { ICYMIContext } from "./ICYMIContext"; import { extractMediaSourcesFromMessage } from "../../media_viewer/native/MediaSourceUtil"; import { GRAVITY_VALID_EMBED_TYPES } from "../ICYMITypes"; import { useStateFromStores } from "../../../_bundle/Module589"; import { MessageRowPreview, NonMediaEmbedsRowPreview } from "./ICYMIMessageRowPreview"; import ICYMIMediaMosaic from "./media/ICYMIMediaMosaic"; import { Text } from "../../../design/components/Text/native/Text"; import { intl, t } from "../../../intl/index.native"; import { Avatar, AvatarSizes } from "../../../design/void/native"; import { getName } from "../../../utils/NicknameUtils"; import GuildActionCreators from "../../../actions/GuildActionCreators"; import { useICYMIMessage, useGravityMessage } from "../ICYMIUtils"; import ICYMIActionCreators from "../ICYMIActionCreators"; import { openChannelLongPressActionSheet } from "../../channel/native/openChannelLongPressActionSheet"; import { showLongPressMessageActionSheet } from "../../messages/native/long_press/showLongPressMessageActionSheet"; import { navigateToPost } from "./ICYMIShared"; import ICYMICardInCard from "./ICYMICardInCard"; import SnowflakeUtils from "../../../utils/SnowflakeUtils"; import { PressableHighlight } from "../../../design/void/Pressables/native/Pressables"; import getChannelA11yLabel, { getChannelA11yHint } from "../../channel/getChannelA11yLabel"; import ICYMICardInteractionRow from "./ICYMICardInteractionRow"; let PX_12, PX_8, styles, ReplyMessageContent, Component; const MessageRowContent = function MessageRowContent(props) { const { message, channel, lineClamp = 3, nested = false, visible = false } = props; const r14 = styles(); const context = useContext(ICYMIContext); const r34 = extractMediaSourcesFromMessage(message, message, channel.guild_id, GRAVITY_VALID_EMBED_TYPES); const stateFromStores2 = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.isChannelMuted(channel.getGuildId(), channel.id)); const memo = useMemo(() => { const r1 = message.embeds.length !== 1 || message.attachments.length > 0; return r1 ? !r1 : message.embeds[0].type === MessageEmbedTypes.GIFV && message.embeds[0].url === message.content; }, [message.attachments.length, message.content, message.embeds]); const r18 = message.attachments.every(({ content_type }) => content_type == null ? void 0 : content_type.startsWith("audio/")); return {memo ? !memo : 0 ? message.embeds.length === 0 ? { renderAttachments: true } : void 0 : void 0 : void 0} pointerEvents={r18 ? "auto" : "none"} />} {r34.length > 0 && } {r34.length === 0 && message.embeds.length > 0 && } ; }; ReplyMessageContent = function ReplyMessageContent(props) { const { message: message2, channel: channel3, guild } = props; const r12 = styles(); const context = useContext(ICYMIContext); const stateFromStores2 = useStateFromStores([UserStore], () => UserStore.getUser(message2.author.id)); let color = useStateFromStores([GuildMemberStore], () => GuildMemberStore.getMember(guild.id, message2.author.id))?.colorString; if (color == null) { color = DEFAULT_ROLE_COLOR_HEX; } const width = useContext(ICYMIContext).width; return stateFromStores2 == null ? null : {intl.string(t.mPPcez)} {getName(guild.id, channel3.id, stateFromStores2)} ; }; PX_12 = Module712.space.PX_12; PX_8 = Module712.space.PX_8; styles = createICYMIStyles((a0) => ({ pressable: { flex: 1, paddingLeft: a0.inset, gap: Module712.space.PX_8 }, messagePreview: { marginTop: isAndroid() ? -2 : 0, borderRadius: Module712.radii.md, gap: 0 }, replyPreview: { gap: Module712.space.PX_8, marginHorizontal: a0.margin, padding: PX_12, overflow: "hidden", borderWidth: 1, borderColor: Module712.colors.BORDER_SUBTLE, borderRadius: Module712.radii.lg, maxHeight: 132 }, replyInner: { flexDirection: "row", gap: PX_8, overflow: "hidden" }, afterMessage: { paddingLeft: a0.inset, paddingBottom: a0.margin }, media: { marginRight: a0.margin }, footer: { marginTop: Module712.space.PX_8, marginBottom: a0.margin, gap: Module712.space.PX_8, paddingHorizontal: a0.margin, marginLeft: a0.inset } })); Component = Module19.memo(function({ message: message3, channel: channel2, guild: guild2, visible, messageContext }) { const stateFromStores2 = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.isChannelMuted(channel2.getGuildId(), channel2.id)); useEffect(() => { if (guild2?.id != null) { GuildActionCreators.requestMembersById(guild2?.id, message3.author.id); } }, [guild2?.id, message3.author.id]); const iCYMIMessage = useICYMIMessage(channel2.id, messageContext?.reply_message_id); const iCYMIMessage2 = useICYMIMessage(channel2.id, messageContext?.before_message_id); const r14 = styles(); const callback2 = useCallback(() => { ICYMIActionCreators.itemInteracted(message3.id, "message", "long_press_channel"); ICYMIActionCreators.feedItemActioned({ itemId: message3.id, itemType: "message", actionParameters: { actionGestureType: "long_press", actionTargetElement: "item_header", actionIntentType: "open", actionDestinationType: null } }); openChannelLongPressActionSheet(channel2.id); }, [channel2.id, message3]); const callback3 = useCallback(() => { ICYMIActionCreators.itemInteracted(message3.id, "message", "long_press_message"); ICYMIActionCreators.feedItemActioned({ itemId: message3.id, itemType: "message", actionParameters: { actionGestureType: "long_press", actionTargetElement: "item_body", actionIntentType: "open", actionDestinationType: null } }); showLongPressMessageActionSheet({ channel: channel2, message: message3, user: UserStore.getUser(message3.author.id) }); }, [channel2, message3]); const callback = useCallback(() => { ICYMIActionCreators.itemInteracted(message3.id, "message", "press_message"); ICYMIActionCreators.feedItemActioned({ itemId: message3.id, itemType: "message", actionParameters: { actionGestureType: "press", actionTargetElement: "item_container", actionIntentType: "navigate", actionDestinationType: "channel" } }); navigateToPost(channel2.id, guild2.id, message3.id); }, [channel2.id, guild2.id, message3.id]); return {iCYMIMessage2 != null ? : null} {iCYMIMessage != null ? : null} ; }); export default function MessageRowWrapper(props) { const { message: message4, messageContext, visible } = props; const gravityMessage = useGravityMessage(message4); const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(gravityMessage.getChannelId())); const stateFromStores2 = useStateFromStores([GuildStore], () => GuildStore.getGuild(stateFromStores?.guild_id)); const stateFromStores3 = useStateFromStores([RelationshipStore], () => RelationshipStore.isBlockedOrIgnored(gravityMessage.author.id)); return stateFromStores == null ? null : stateFromStores2 == null ? null : stateFromStores3 ? null : ; }; export { MessageRowContent };