1094 lines
67 KiB
TypeScript
1094 lines
67 KiB
TypeScript
/* Metro module 8184; source: modules/messages/native/renderer/createMessageContent.tsx; dependencies: [27, 4502, 4234, 3964, 6540, 8183, 8057, 3785, 8185, 4833, 3786, 6898, 1310, 1226, 1379, 1945, 1867, 3793, 7223, 1878, 4503, 8178, 661, 8187, 4805, 8189, 21, 8190, 1244, 8191, 8192, 8193, 4643, 1391, 7149, 8198, 6630, 8199, 8201, 5216, 8203, 8334, 8335, 8350, 4838, 4821, 3829, 8351, 8355, 8293, 8393, 4634, 1426, 1423, 8396, 1305, 6793, 8425, 1360, 8426, 3773, 5043, 8427, 8428, 3826, 8431, 8439, 8401, 6858, 697, 8440, 8206, 8442, 8443, 8331, 8446, 8449, 10535, 10576, 10578, 10601, 8209, 8210, 10602, 10606, 10607, 10608, 8216, 10611, 2] */
|
|
import SnowflakeUtils from '../../../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
|
|
import AuthenticationStore from '../../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import ThemeStore from '../../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */
|
|
import ChannelStore from '../../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import GuildStore from '../../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import GuildMemberStore from '../../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
|
|
import LurkingStore from '../../../lurker_mode/LurkingStore.tsx'; /* Metro dependency 3785 */
|
|
import JoinedThreadsStore from '../../../threads/JoinedThreadsStore.tsx'; /* Metro dependency 3786 */
|
|
import RelationshipStore from '../../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import ClientThemesBackgroundStore from '../../../client_themes/ClientThemesBackgroundStore.tsx'; /* Metro dependency 3964 */
|
|
import ApplicationStore from '../../../applications/ApplicationStore.tsx'; /* Metro dependency 4234 */
|
|
import AccessibilityStore from '../../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import ReferencedMessageStore from '../../../replies/ReferencedMessageStore.tsx'; /* Metro dependency 4833 */
|
|
import EmojiStore from '../../../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */
|
|
import ThreadMessageStore from '../../../threads/ThreadMessageStore.tsx'; /* Metro dependency 6898 */
|
|
import UploadStore from '../../../../stores/UploadStore.tsx'; /* Metro dependency 7223 */
|
|
import InteractionStore from '../../../interactions/InteractionStore.tsx'; /* Metro dependency 8057 */
|
|
import GuildAutomodMessageStore from '../../../guild_automod/GuildAutomodMessageStore.tsx'; /* Metro dependency 8183 */
|
|
import MediaPostSharePromptStore from '../../../media_channel/MediaPostSharePromptStore.tsx'; /* Metro dependency 8185 */
|
|
import ResolveMessageContentColors from './resolveMessageContentColors.tsx'; /* Metro dependency 8198 */
|
|
import TransformMessageComponents from './transformMessageComponents.tsx'; /* Metro dependency 8355 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as MessageConstantsModule from '../../MessageConstants.tsx'; /* Metro dependency 4503 */
|
|
import * as ReferencedMessageStoreModule from '../../../replies/ReferencedMessageStore.tsx'; /* Metro dependency 4833 */
|
|
import * as UseHasEnhancedRoleColorsModule from '../../../premium/powerups/hooks/useHasEnhancedRoleColors.tsx'; /* Metro dependency 6630 */
|
|
import * as RowGeneratorConstantsModule from './RowGeneratorConstants.tsx'; /* Metro dependency 8178 */
|
|
import * as GuildTagConstantsModule from '../../../guild_tag/GuildTagConstants.tsx'; /* Metro dependency 8187 */
|
|
|
|
function _fun65649(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#65649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8369:6, offset: 0x01bd62ac, size: 611 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const createMessageContent2 = createMessageContent;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = MessageConstantsModule;
|
|
const env0_24 = value.DEFAULT_GUILD_OFFICIAL_COLOR;
|
|
const env0_25 = value.GUILD_OFFICIAL_HIGHLIGHT_ALPHA;
|
|
const env0_26 = value.GUILD_OFFICIAL_HIGHLIGHT_ALPHA_COLOR;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_28 = value.MessageTypes;
|
|
const env0_29 = value.MessageStates;
|
|
const env0_30 = value.MessageFlags;
|
|
const env0_31 = value.ChannelTypes;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/messages/native/renderer/createMessageContent.tsx');
|
|
exports.default = createMessageContent2;
|
|
function createThreadEmbed(a0, a1, a2, a3, a4, a5) { // fn#65650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8369:618, offset: 0x01bd650f, size: 913 bytes, params: 7, frame: 26
|
|
var r1;
|
|
var r0;
|
|
var moduleValue;
|
|
var channelName;
|
|
var backgroundColor;
|
|
var threadMessageStoreBinding;
|
|
var getMostRecentMessage;
|
|
var defaultImport2;
|
|
var castMessageIdAsChannelId;
|
|
var id;
|
|
var value2;
|
|
var getCount;
|
|
var defaultImport3;
|
|
var value3;
|
|
var moduleValue2;
|
|
var formatMobileMessageCountLabel;
|
|
var value4;
|
|
var moduleValue3;
|
|
var formatMessageCountLabel;
|
|
var value5;
|
|
var object;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var threadMetadata;
|
|
var blocked;
|
|
var object2;
|
|
if (!a2) {
|
|
var hasFlag = a0.hasFlag;
|
|
var HAS_THREAD = MessageFlags.HAS_THREAD;
|
|
if (Reflect.apply(hasFlag, a0, [HAS_THREAD])) {
|
|
if (a3 == null) {
|
|
return undefined;
|
|
}
|
|
moduleValue = require(4805) /* metro dependency 4805: useChannelName */;
|
|
channelName = moduleValue.computeChannelName(a3, UserStore, RelationshipStore);
|
|
backgroundColor = (importDefault(8189) /* metro dependency 8189: getEmbedThemeColors */)(a5).baseColors.backgroundColor;
|
|
threadMessageStoreBinding = ThreadMessageStore;
|
|
getMostRecentMessage = threadMessageStoreBinding.getMostRecentMessage;
|
|
defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
castMessageIdAsChannelId = defaultImport2.castMessageIdAsChannelId;
|
|
id = a0.id;
|
|
value2 = Reflect.apply(getMostRecentMessage, threadMessageStoreBinding,
|
|
[Reflect.apply(castMessageIdAsChannelId,
|
|
defaultImport2, [id])]);
|
|
threadMessageStoreBinding = ThreadMessageStore;
|
|
getCount = threadMessageStoreBinding.getCount;
|
|
defaultImport3 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
castMessageIdAsChannelId = defaultImport3.castMessageIdAsChannelId;
|
|
id = a0.id;
|
|
value3 = Reflect.apply(getCount, threadMessageStoreBinding, [Reflect.apply(castMessageIdAsChannelId,
|
|
defaultImport3,
|
|
[id])]);
|
|
moduleValue2 = require(8190) /* metro dependency 8190: MessageCountUtils */;
|
|
formatMobileMessageCountLabel = moduleValue2.formatMobileMessageCountLabel;
|
|
id = a3.id;
|
|
value4 = Reflect.apply(formatMobileMessageCountLabel, moduleValue2, [value3, id]);
|
|
moduleValue3 = require(8190) /* metro dependency 8190: MessageCountUtils */;
|
|
formatMessageCountLabel = moduleValue3.formatMessageCountLabel;
|
|
id = a3.id;
|
|
value5 = Reflect.apply(formatMessageCountLabel, moduleValue3, [value3, id]);
|
|
if (value3 == null) {
|
|
r0 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: intl.string(t.HYtNyE), archived: false, backgroundColor: backgroundColor};
|
|
} else if (value3 > 0) {
|
|
threadMetadata = a3.threadMetadata;
|
|
if (threadMetadata == null) {
|
|
if (value2 == null) {
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: intl.string(t.ZTo4HS), archived: false,
|
|
backgroundColor: backgroundColor};
|
|
} else if (value2.type === MessageTypes.CHANNEL_NAME_CHANGE) {
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: intl.string(t.ZTo4HS), archived: false,
|
|
backgroundColor: backgroundColor};
|
|
} else if (value2.type === MessageTypes.THREAD_STARTER_MESSAGE) {
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: intl.string(t.ZTo4HS), archived: false,
|
|
backgroundColor: backgroundColor};
|
|
} else {
|
|
blocked = value2.blocked;
|
|
if (blocked) {
|
|
blocked = value2.blocked;
|
|
string = intl.string;
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: blocked ? Reflect.apply(string, intl,
|
|
[t.XAkOo2]) : Reflect.apply(string,
|
|
intl,
|
|
[t['G7p6v/']]), archived: false, backgroundColor: backgroundColor};
|
|
} else if (value2.ignored) {
|
|
blocked = value2.blocked;
|
|
string = intl.string;
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: blocked ? Reflect.apply(string, intl,
|
|
[t.XAkOo2]) : Reflect.apply(string,
|
|
intl,
|
|
[t['G7p6v/']]), archived: false, backgroundColor: backgroundColor};
|
|
} else {
|
|
object = {title: channelName, messageCountLabel: value4,
|
|
messageCountAccessibilityLabel: value5};
|
|
object2 = {};
|
|
object2.state = ReferencedMessageRowState.LOADED;
|
|
object2.message = createMessageContent({'message': null, 'roleStyle': null, 'options': null,
|
|
'isFirst': true,
|
|
'isEditing': false, 'canShowImages': true, 'isSystemDM': false,
|
|
'isInlineReplyPreview': true,
|
|
message: value2,
|
|
roleStyle: a1, options: a4});
|
|
object.referencedMessage = object2;
|
|
object.backgroundColor = backgroundColor;
|
|
r1 = object;
|
|
}
|
|
}
|
|
} else if (threadMetadata.archived) {
|
|
object = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5};
|
|
object.messagePreviewString = intl.string(t.ZTo4HS);
|
|
object.archived = true;
|
|
object.archivedIconUrl = (require(8191) /* metro dependency 8191: EmbedUtils */).getAssetUriForEmbed(importDefault(8192) /* metro dependency 8192 */);
|
|
object.backgroundColor = backgroundColor;
|
|
r1 = object;
|
|
} else if (value2 == null) {
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: intl.string(t.ZTo4HS), archived: false, backgroundColor: backgroundColor};
|
|
} else if (value2.type === MessageTypes.CHANNEL_NAME_CHANGE) {
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: intl.string(t.ZTo4HS), archived: false, backgroundColor: backgroundColor};
|
|
} else if (value2.type === MessageTypes.THREAD_STARTER_MESSAGE) {
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: intl.string(t.ZTo4HS), archived: false, backgroundColor: backgroundColor};
|
|
} else {
|
|
blocked = value2.blocked;
|
|
if (blocked) {
|
|
blocked = value2.blocked;
|
|
string = intl.string;
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: blocked ? Reflect.apply(string, intl,
|
|
[t.XAkOo2]) : Reflect.apply(string,
|
|
intl,
|
|
[t['G7p6v/']]), archived: false, backgroundColor: backgroundColor};
|
|
} else if (value2.ignored) {
|
|
blocked = value2.blocked;
|
|
string = intl.string;
|
|
r1 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: blocked ? Reflect.apply(string, intl,
|
|
[t.XAkOo2]) : Reflect.apply(string,
|
|
intl,
|
|
[t['G7p6v/']]), archived: false, backgroundColor: backgroundColor};
|
|
} else {
|
|
object = {title: channelName, messageCountLabel: value4,
|
|
messageCountAccessibilityLabel: value5};
|
|
object2 = {};
|
|
object2.state = ReferencedMessageRowState.LOADED;
|
|
object2.message = createMessageContent({'message': null, 'roleStyle': null, 'options': null,
|
|
'isFirst': true,
|
|
'isEditing': false, 'canShowImages': true, 'isSystemDM': false,
|
|
'isInlineReplyPreview': true,
|
|
message: value2,
|
|
roleStyle: a1, options: a4});
|
|
object.referencedMessage = object2;
|
|
object.backgroundColor = backgroundColor;
|
|
r1 = object;
|
|
}
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = {title: channelName, messageCountLabel: value4, messageCountAccessibilityLabel: value5,
|
|
messagePreviewString: intl.string(t.HYtNyE), archived: false, backgroundColor: backgroundColor};
|
|
}
|
|
return r0;
|
|
}
|
|
}
|
|
}
|
|
|
|
function getForumPostActions(a0, a1) { // fn#65651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8369:2134, offset: 0x01bd68a0, size: 309 bytes, params: 3, frame: 19
|
|
var defaultReactionEmoji;
|
|
var r9;
|
|
var r4;
|
|
var channelStoreBinding;
|
|
var value6;
|
|
var moduleValue;
|
|
if (a0.id !== a0.channel_id) {
|
|
return undefined;
|
|
}
|
|
let value = a1.getGuildId();
|
|
const value2 = null;
|
|
if (value2 != value) {
|
|
var lurkingStoreBinding = LurkingStore;
|
|
if (lurkingStoreBinding.isLurking(value)) {
|
|
return undefined;
|
|
}
|
|
}
|
|
const joinedThreadsStoreBinding = JoinedThreadsStore;
|
|
const hasJoined2 = joinedThreadsStoreBinding.hasJoined(a0.channel_id);
|
|
const value4 = a0.reactions.length !== 0;
|
|
const value5 = undefined;
|
|
if (value4) {
|
|
r4 = value5;
|
|
} else {
|
|
channelStoreBinding = ChannelStore;
|
|
value6 = channelStoreBinding.getChannel(a1.parent_id);
|
|
defaultReactionEmoji = value2 == value6 ? value5 : value6.defaultReactionEmoji;
|
|
r9 = value2 != (value2 == defaultReactionEmoji ? value5 : defaultReactionEmoji.emojiId) ? EmojiStore.getUsableCustomEmojiById(defaultReactionEmoji.emojiId) : value2;
|
|
moduleValue = require(8193) /* metro dependency 8193: ForumPostActions */;
|
|
r4 = moduleValue.createDefaultReaction({defaultReactionEmoji: defaultReactionEmoji, customGuildEmoji: r9});
|
|
}
|
|
const mediaPostSharePromptStoreBinding = MediaPostSharePromptStore;
|
|
const shouldDisplayPrompt2 = mediaPostSharePromptStoreBinding.shouldDisplayPrompt(a1.id);
|
|
value = require(8193) /* metro dependency 8193: ForumPostActions */;
|
|
return value.createForumPostActions({isFollowing: hasJoined2, hasReactions: value4, defaultReaction: r4,
|
|
showMediaPostSharePrompt: shouldDisplayPrompt2});
|
|
}
|
|
|
|
function createMessageContent({message, messageForward, roleStyle, isFirst, isEditing, canShowImages, isSystemDM, isInlineReplyPreview, options, pushFeedbackType, renderContentOnly, showContentInventoryEntryFallbackEmbed}) { // fn#65652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8369:2726, offset: 0x01bd69d5, size: 8212 bytes, params: 2, frame: 120
|
|
var r110;
|
|
var r38;
|
|
var r13;
|
|
var r24;
|
|
var r22;
|
|
var r36;
|
|
var r21;
|
|
var r23;
|
|
var r29;
|
|
var r49;
|
|
var r69;
|
|
var r31;
|
|
var r98;
|
|
var r95;
|
|
var r35;
|
|
var r68;
|
|
var r65;
|
|
var r63;
|
|
var r19;
|
|
var r0;
|
|
var r3;
|
|
var r103;
|
|
var r96;
|
|
var saturation;
|
|
var r80;
|
|
var r91;
|
|
var r94;
|
|
var r70;
|
|
var r64;
|
|
var r51;
|
|
var r44;
|
|
var r41;
|
|
var r34;
|
|
var referencedMessageStoreBinding;
|
|
var value15;
|
|
var state;
|
|
var moduleValue4;
|
|
var parseMessageMarkup;
|
|
var push;
|
|
var errorMessage;
|
|
var moduleValue7;
|
|
var application;
|
|
var defaultImport7;
|
|
var getApplicationIconSource;
|
|
var moduleValue12;
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
var value41;
|
|
var message3;
|
|
var value42;
|
|
var relationshipStoreBinding;
|
|
var createMessageContentBinding;
|
|
var object2;
|
|
var messageContent;
|
|
var messageAuthor;
|
|
var nick2;
|
|
var colorString2;
|
|
var processColorBinding;
|
|
var Array;
|
|
var isArray;
|
|
var moduleValue18;
|
|
var moduleValue19;
|
|
var defaultImport8;
|
|
var moduleValue24;
|
|
var moduleValue25;
|
|
var moduleValue29;
|
|
var value76;
|
|
var guildId;
|
|
var tag;
|
|
var moduleValue30;
|
|
var moduleValue32;
|
|
var guild;
|
|
var moduleValue33;
|
|
var officialMessageStyle;
|
|
var value82;
|
|
var moduleValue35;
|
|
var internal;
|
|
var semanticColor;
|
|
var moduleValue36;
|
|
var moduleValue42;
|
|
var defaultImport12;
|
|
var object4;
|
|
var moduleValue54;
|
|
var createSystemMessageContent;
|
|
var object6;
|
|
var object7;
|
|
let value = undefined;
|
|
isInlineReplyPreview = !(isInlineReplyPreview === value) && isInlineReplyPreview;
|
|
const renderEmbeds = options.renderEmbeds;
|
|
const renderReactions = options.renderReactions;
|
|
const inlineEmbedMedia = options.inlineEmbedMedia;
|
|
const inlineAttachmentMedia = options.inlineAttachmentMedia;
|
|
const constrainedWidth = options.constrainedWidth;
|
|
const ignoreMentioned = options.ignoreMentioned;
|
|
const animateEmoji = options.animateEmoji;
|
|
const animatingStickerMessageId = options.animatingStickerMessageId;
|
|
const gifAutoPlay = options.gifAutoPlay;
|
|
const timestampHourCycle = options.timestampHourCycle;
|
|
const renderCodedLinks = options.renderCodedLinks;
|
|
const renderGiftCode = options.renderGiftCode;
|
|
const renderActivityInstanceEmbed = options.renderActivityInstanceEmbed;
|
|
const renderActivityInviteEmbed = options.renderActivityInviteEmbed;
|
|
const renderComponents = options.renderComponents;
|
|
const renderThreadEmbeds = options.renderThreadEmbeds;
|
|
const renderReplies = options.renderReplies;
|
|
const renderCommunicationDisabled = options.renderCommunicationDisabled;
|
|
const renderAttachments = options.renderAttachments;
|
|
const renderExecutedCommands = options.renderExecutedCommands;
|
|
const renderPolls = options.renderPolls;
|
|
const renderSharedClientTheme = options.renderSharedClientTheme;
|
|
const renderForumPostActions = options.renderForumPostActions;
|
|
const forcedTheme = options.forcedTheme;
|
|
const ignoreEmbedDescriptionCache = options.ignoreEmbedDescriptionCache;
|
|
const forceHideSimpleEmbedContent = options.forceHideSimpleEmbedContent;
|
|
const shouldObscureSpoiler = options.shouldObscureSpoiler;
|
|
const shouldDisableInteractiveComponents = options.shouldDisableInteractiveComponents;
|
|
const useAlternateEmbedColors = options.useAlternateEmbedColors;
|
|
const restrictedPreview = options.restrictedPreview;
|
|
const r18 = forcedTheme ?? ThemeStore.theme;
|
|
const value6 = (ResolveMessageContentColors)(r18,
|
|
useAlternateEmbedColors);
|
|
const value7 = canShowImages === true;
|
|
let r27 = value7 && renderEmbeds && message.type !== MessageTypes.CUSTOM_GIFT;
|
|
let r33 = value7 && inlineEmbedMedia;
|
|
let r40 = value7 && inlineAttachmentMedia;
|
|
let channelStoreBinding = ChannelStore;
|
|
let getChannel = channelStoreBinding.getChannel;
|
|
const getChannelId = message.getChannelId;
|
|
const value9 = Reflect.apply(getChannel, channelStoreBinding, [Reflect.apply(getChannelId, message, [])]);
|
|
channelStoreBinding = ChannelStore;
|
|
getChannel = channelStoreBinding.getChannel;
|
|
const defaultImport = SnowflakeUtils;
|
|
const castMessageIdAsChannelId = defaultImport.castMessageIdAsChannelId;
|
|
let id = message.id;
|
|
const value10 = Reflect.apply(getChannel, channelStoreBinding, [Reflect.apply(castMessageIdAsChannelId,
|
|
defaultImport, [id])]);
|
|
const r17 = value9 == null ? value : value9.getGuildId();
|
|
let author = message.author;
|
|
const hasEnhancedRoleColors = (UseHasEnhancedRoleColorsModule).getHasEnhancedRoleColors(r17,
|
|
author.id);
|
|
const r97 = messageForward ?? (require(8199) /* metro dependency 8199: formatMessageForwards */).maybeCreateSingleForwardForMessage(message);
|
|
if (r97 == null) {
|
|
r38 = message;
|
|
} else {
|
|
message = r97.messageSnapshot.message;
|
|
r38 = message;
|
|
}
|
|
let object = [];
|
|
const r172 = renderReactions ? (importDefault(8201) /* metro dependency 8201: transformReactions */)({reactions: message.reactions,
|
|
animateEmoji: animateEmoji}) : object;
|
|
let type = message.type;
|
|
const THREAD_STARTER_MESSAGE = MessageTypes.THREAD_STARTER_MESSAGE;
|
|
if (type !== THREAD_STARTER_MESSAGE) {
|
|
r13 = null;
|
|
} else {
|
|
referencedMessageStoreBinding = ReferencedMessageStore;
|
|
value15 = referencedMessageStoreBinding.getMessageByReference(message.messageReference);
|
|
message = value15.state !== ReferencedMessageState.LOADED ? null : value15.message;
|
|
r13 = message;
|
|
}
|
|
if (r13 != null) {
|
|
object = {};
|
|
createMessageContentBinding = createMessageContent;
|
|
object6 = {message: r13, roleStyle: roleStyle, isFirst: isFirst, isEditing: isEditing,
|
|
canShowImages: canShowImages,
|
|
isSystemDM: isSystemDM, isInlineReplyPreview: isInlineReplyPreview};
|
|
object7 = {};
|
|
copyDataProperties(object7, options, r110);
|
|
object7['renderThreadEmbeds'] = false;
|
|
object7['renderReactions'] = false;
|
|
object7['shouldDisableInteractiveComponents'] = true;
|
|
object6.options = object7;
|
|
copyDataProperties(object, createMessageContentBinding(object6), r110);
|
|
object['id'] = message.id;
|
|
} else {
|
|
if ((importDefault(5216) /* metro dependency 5216: isSystemMessage */)(message)) {
|
|
if (message.type === MessageTypes.THREAD_CREATED) {
|
|
object = {};
|
|
object.threadEmbed = createThreadEmbed(message, roleStyle, isInlineReplyPreview, value10, options, r18);
|
|
value = require(8203) /* metro dependency 8203: SystemMessage */;
|
|
copyDataProperties(object, value.createSystemMessageContent({message: message, theme: r18,
|
|
reactions: r172,
|
|
roleStyle: roleStyle}), isInlineReplyPreview);
|
|
r0 = object;
|
|
} else {
|
|
moduleValue54 = require(8203) /* metro dependency 8203: SystemMessage */;
|
|
createSystemMessageContent = moduleValue54.createSystemMessageContent;
|
|
object = {message: message, theme: r18, reactions: r172, roleStyle: roleStyle};
|
|
object.isForumPost = value9 == null ? value : value9.isForumPost();
|
|
value = Reflect.apply(createSystemMessageContent, moduleValue54, [object]);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
var r67 = isFirst ? renderContentOnly : !isFirst;
|
|
author = message.author;
|
|
var moduleValue3 = require(8334) /* metro dependency 8334: MarkupEligibilityUtils */;
|
|
var isMessageNewerThanImprovedMarkdownEpoch = moduleValue3.isMessageNewerThanImprovedMarkdownEpoch;
|
|
r24 = message.editedTimestamp ?? message.timestamp;
|
|
var isMessageNewerThanImprovedMarkdownEpoch2 = Reflect.apply(isMessageNewerThanImprovedMarkdownEpoch,
|
|
moduleValue3,
|
|
[r24.valueOf()]);
|
|
var content = r38.content;
|
|
if (content == null) {
|
|
r21 = {'content': null, 'hasSpoilerEmbeds': false, 'hasBailedAst': false, content: value};
|
|
} else if (r38.content !== '') {
|
|
moduleValue4 = require(8335) /* metro dependency 8335: MarkupParsers */;
|
|
parseMessageMarkup = moduleValue4.parseMessageMarkup;
|
|
r36 = forceHideSimpleEmbedContent || r27 && r33;
|
|
r21 = Reflect.apply(parseMessageMarkup, moduleValue4, [message, r38, r36, isInlineReplyPreview,
|
|
value10 != null && message.isFirstMessageInForumPost(value10), isMessageNewerThanImprovedMarkdownEpoch2,
|
|
isMessageNewerThanImprovedMarkdownEpoch2]);
|
|
r110 = r36;
|
|
} else {
|
|
r21 = {'content': null, 'hasSpoilerEmbeds': false, 'hasBailedAst': false, content: value};
|
|
}
|
|
content = r21.content;
|
|
var hasSpoilerEmbeds = r21.hasSpoilerEmbeds;
|
|
var hasBailedAst = r21.hasBailedAst;
|
|
r23 = restrictedPreview && content != null ? (importDefault(8350) /* metro dependency 8350: redactRestrictedContent */)(content) : content;
|
|
var enabledHarmTypesForMessage = (require(4838) /* metro dependency 4838: ObscuredMediaUtils */).getEnabledHarmTypesForMessage(message);
|
|
var shouldAgeVerifyForExplicitMedia2 = (require(4821) /* metro dependency 4821: ExplicitMediaRedactionUtils */).shouldAgeVerifyForExplicitMedia();
|
|
var ViewImageDescriptions = (require(3829) /* metro dependency 3829: UserSettings */).ViewImageDescriptions;
|
|
var setting = ViewImageDescriptions.getSetting();
|
|
r27 = r27 && !hasBailedAst;
|
|
r27 = r27 && !restrictedPreview;
|
|
var interaction = InteractionStore.getInteraction(message);
|
|
r22 = r27 ? (importDefault(8351) /* metro dependency 8351: transformEmbeds */)({embeds: r38.embeds,
|
|
channelId: message.channel_id, gifAutoPlay: gifAutoPlay, hasSpoilerEmbeds: hasSpoilerEmbeds,
|
|
ignoreEmbedDescriptionCache: ignoreEmbedDescriptionCache, shouldInlineEmbedMedia: r33, colors: value6,
|
|
showListsAndHeaders: isMessageNewerThanImprovedMarkdownEpoch2,
|
|
showMaskedLinks: isMessageNewerThanImprovedMarkdownEpoch2,
|
|
themedBackgroundColor: value6.embedBackgroundColor,
|
|
enabledContentHarmTypeFlags: enabledHarmTypesForMessage, shouldAgeVerify: shouldAgeVerifyForExplicitMedia2,
|
|
authorIsBot: message.author.bot,
|
|
showContentInventoryEntryFallbackEmbed: showContentInventoryEntryFallbackEmbed,
|
|
transformComponents: transformComponents_65653}) : value;
|
|
var {tagText, tagAccessibilityLabel, tagVerified, tagTextColor, tagBackgroundColor, tagType, tagIconUrl,
|
|
opTagText,
|
|
opTagTextColor,
|
|
opTagBackgroundColor} = (importDefault(8293) /* metro dependency 8293: getTagProperties */)({message: message,
|
|
|
|
isSystemDM: isSystemDM, channel: value9, colors: value6});
|
|
var uploaderFileForMessageId = UploadStore.getUploaderFileForMessageId(message.id);
|
|
var value28 = uploaderFileForMessageId != null;
|
|
state = message.state;
|
|
var SEND_FAILED = MessageStates.SEND_FAILED;
|
|
r21 = state !== SEND_FAILED || message.isCommandType();
|
|
if (r21) {
|
|
r29 = r22;
|
|
} else {
|
|
r21 = r22 ?? [];
|
|
r21.push((importDefault(8393) /* metro dependency 8393: createMessageFailedEmbed */)({uploaderFile: uploaderFileForMessageId,
|
|
|
|
|
|
useAttachmentUploadPreview: value28, colors: value6}));
|
|
r29 = r21;
|
|
}
|
|
var message2 = GuildAutomodMessageStore.getMessage(message.id);
|
|
if (message2 == null) {
|
|
r49 = r29;
|
|
} else {
|
|
r21 = r29 ?? [];
|
|
errorMessage = message2.errorMessage;
|
|
push = r21.push;
|
|
moduleValue7 = require(8393) /* metro dependency 8393: createMessageFailedEmbed */;
|
|
Reflect.apply(push, r21, [moduleValue7.createAutomodBlockedMessageEmbed({errorMessage: errorMessage,
|
|
colors: value6})]);
|
|
r49 = r21;
|
|
}
|
|
var {guildMemberAvatar, guildMemberAvatarDecoration,
|
|
iconRoleId} = (require(4634) /* metro dependency 4634: useMessageAuthor */).getUserAuthor(message.author,
|
|
value9);
|
|
var moduleValue9 = require(1426) /* metro dependency 1426: AvatarUtils */;
|
|
var ensureAvatarSource = moduleValue9.ensureAvatarSource;
|
|
if (message.isInteractionPlaceholder()) {
|
|
if (message.author.avatar != null) {
|
|
r21 = guildMemberAvatar == null ? author.getAvatarSource(value) : r17 != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildMemberAvatarSource({userId: author.id,
|
|
|
|
|
|
|
|
avatar: guildMemberAvatar, guildId: r17}, author) : author.getAvatarSource(value);
|
|
} else if (guildMemberAvatar != null) {
|
|
r21 = guildMemberAvatar == null ? author.getAvatarSource(value) : r17 != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildMemberAvatarSource({userId: author.id,
|
|
|
|
|
|
|
|
avatar: guildMemberAvatar, guildId: r17}, author) : author.getAvatarSource(value);
|
|
} else {
|
|
application = message.application;
|
|
if ((application == null ? value : application.icon) != null) {
|
|
defaultImport7 = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
|
|
getApplicationIconSource = defaultImport7.getApplicationIconSource;
|
|
object = {};
|
|
application = message.application;
|
|
object.id = application.id;
|
|
application = message.application;
|
|
object.icon = application.icon;
|
|
application = message.application;
|
|
object.bot = application.bot;
|
|
r21 = Reflect.apply(getApplicationIconSource, defaultImport7, [object]);
|
|
} else {
|
|
r21 = guildMemberAvatar == null ? author.getAvatarSource(value) : r17 != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildMemberAvatarSource({userId: author.id,
|
|
|
|
|
|
|
|
|
|
avatar: guildMemberAvatar, guildId: r17}, author) : author.getAvatarSource(value);
|
|
}
|
|
}
|
|
} else {
|
|
r21 = guildMemberAvatar == null ? author.getAvatarSource(value) : r17 != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildMemberAvatarSource({userId: author.id,
|
|
|
|
|
|
avatar: guildMemberAvatar, guildId: r17}, author) : author.getAvatarSource(value);
|
|
}
|
|
var value35 = Reflect.apply(ensureAvatarSource, moduleValue9, [r21]);
|
|
var moduleValue10 = require(1423) /* metro dependency 1423: AvatarUtils */;
|
|
var getAvatarDecorationURL = moduleValue10.getAvatarDecorationURL;
|
|
object = {};
|
|
object.avatarDecoration = guildMemberAvatarDecoration ?? author.avatarDecoration;
|
|
var moduleValue11 = require(8396) /* metro dependency 8396: AvatarDecorationUtils */;
|
|
var getDecorationSizeForAvatarSize = moduleValue11.getDecorationSizeForAvatarSize;
|
|
var AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
|
|
var NORMAL = AvatarSizes.NORMAL;
|
|
object.size = Reflect.apply(getDecorationSizeForAvatarSize, moduleValue11, [NORMAL]);
|
|
var value36 = Reflect.apply(getAvatarDecorationURL, moduleValue10, [object]);
|
|
if (iconRoleId != null) {
|
|
if (r17 != null) {
|
|
moduleValue12 = require(6793) /* metro dependency 6793: RoleIconUtils */;
|
|
r69 = moduleValue12.getRoleIcon({guildId: r17, roleId: iconRoleId, size: 18});
|
|
} else {
|
|
r69 = value;
|
|
}
|
|
} else {
|
|
r69 = value;
|
|
}
|
|
var hasFlag = message.hasFlag;
|
|
var SOURCE_MESSAGE_DELETED = MessageFlags.SOURCE_MESSAGE_DELETED;
|
|
r23 = Reflect.apply(hasFlag, message, [SOURCE_MESSAGE_DELETED]) ? intl.string(t.JOtgSw) : r23;
|
|
var {nick, colorString,
|
|
colorStrings} = (require(4634) /* metro dependency 4634: useMessageAuthor */).getMessageAuthor(message);
|
|
type = message.type;
|
|
var INTERACTION_PREMIUM_UPSELL = MessageTypes.INTERACTION_PREMIUM_UPSELL;
|
|
r23 = type === INTERACTION_PREMIUM_UPSELL ? intl.formatToPlainString(t['u4A+xK'], {appName: nick}) : r23;
|
|
type = message.type;
|
|
var REPLY = MessageTypes.REPLY;
|
|
if (type !== REPLY) {
|
|
r98 = value;
|
|
} else if (renderReplies) {
|
|
referencedMessageStoreBinding = ReferencedMessageStore;
|
|
value41 = referencedMessageStoreBinding.getMessageByReference(message.messageReference);
|
|
state = value41.state;
|
|
if (ReferencedMessageState.LOADED === state) {
|
|
message3 = value41.message;
|
|
value42 = (require(8199) /* metro dependency 8199: formatMessageForwards */).maybeCreateSingleForwardForMessage(message3);
|
|
if (Reflect.apply(RelationshipStore.isBlockedForMessage, relationshipStoreBinding, [message3])) {
|
|
r98 = {state: ReferencedMessageRowState.SYSTEM, content: intl.string(t.XAkOo2)};
|
|
} else {
|
|
relationshipStoreBinding = RelationshipStore;
|
|
if (relationshipStoreBinding.isIgnoredForMessage(message3)) {
|
|
object = {};
|
|
object.state = ReferencedMessageRowState.SYSTEM;
|
|
object.content = intl.string(t['G7p6v/']);
|
|
r98 = object;
|
|
} else {
|
|
createMessageContentBinding = createMessageContent;
|
|
object = {'message': null, 'messageForward': null, 'roleStyle': null, 'isFirst': true,
|
|
'isEditing': false,
|
|
'canShowImages': true, 'isSystemDM': false, 'isInlineReplyPreview': true};
|
|
object.message = message3;
|
|
object.messageForward = value42;
|
|
object.roleStyle = roleStyle;
|
|
object2 = {};
|
|
copyDataProperties(object2, options, r110);
|
|
object2['renderReplies'] = false;
|
|
object.options = object2;
|
|
messageContent = createMessageContentBinding(object);
|
|
if (messageContent == null) {
|
|
object = {};
|
|
object.state = ReferencedMessageRowState.SYSTEM;
|
|
object.content = intl.string(t['1i+hMi']);
|
|
r98 = object;
|
|
} else {
|
|
if ('username' in messageContent) {
|
|
messageAuthor = (require(4634) /* metro dependency 4634: useMessageAuthor */).getMessageAuthor(message3);
|
|
nick2 = messageAuthor.nick;
|
|
colorString2 = messageAuthor.colorString;
|
|
r21 = nick2 ?? message3.author.username ?? value;
|
|
messageContent.username = r21;
|
|
if (r67) {
|
|
r21 = messageContent.colorString;
|
|
} else {
|
|
processColorBinding = processColor;
|
|
r21 = colorString2 ?? value;
|
|
r21 = processColorBinding(r21) ?? messageContent.colorString;
|
|
}
|
|
messageContent.colorString = r21;
|
|
if ((importDefault(8425) /* metro dependency 8425: didReplyMention */)(message,
|
|
message3)) {
|
|
messageContent.username = '@' + messageContent.username;
|
|
}
|
|
}
|
|
Array = global.Array;
|
|
isArray = Array.isArray;
|
|
content = messageContent.content;
|
|
r21 = Reflect.apply(isArray, Array, [content]) && messageContent.content.length === 0;
|
|
if (r21) {
|
|
messageContent.content = value;
|
|
}
|
|
message = value42 == null ? value : value42.messageSnapshot.message;
|
|
r31 = message ?? message3;
|
|
content = messageContent.content;
|
|
if (('stickers' in r31 ? (require(4643) /* metro dependency 4643: StickersUtils */).getMessageStickers(r31) : []).length > 0) {
|
|
r21 = intl.string(t['7K5Lma']);
|
|
} else if ('interaction' in r31) {
|
|
if (r31.interaction == null) {
|
|
moduleValue18 = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
if (moduleValue18.hasFlag(r31.flags, MessageFlags.IS_VOICE_MESSAGE)) {
|
|
r21 = intl.string(t['6bhHrc']);
|
|
} else if (r31.type === MessageTypes.POLL_RESULT) {
|
|
r21 = (require(7149) /* metro dependency 7149: PollsUtils */).getPollResultsReplyPreviewMobile(r31);
|
|
} else {
|
|
moduleValue19 = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
r21 = moduleValue19.hasFlag(r31.flags,
|
|
MessageFlags.IS_COMPONENTS_V2) ? intl.string(t.Xxm5i3) : r31.content === '' || content == null ? intl.string(t.JAKsM8) : null;
|
|
}
|
|
} else if (r31.content === '') {
|
|
r21 = intl.string(t['2v7kfl']);
|
|
} else {
|
|
moduleValue18 = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
if (moduleValue18.hasFlag(r31.flags, MessageFlags.IS_VOICE_MESSAGE)) {
|
|
r21 = intl.string(t['6bhHrc']);
|
|
} else if (r31.type === MessageTypes.POLL_RESULT) {
|
|
r21 = (require(7149) /* metro dependency 7149: PollsUtils */).getPollResultsReplyPreviewMobile(r31);
|
|
} else {
|
|
moduleValue19 = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
r21 = moduleValue19.hasFlag(r31.flags,
|
|
MessageFlags.IS_COMPONENTS_V2) ? intl.string(t.Xxm5i3) : r31.content === '' || content == null ? intl.string(t.JAKsM8) : null;
|
|
}
|
|
}
|
|
} else {
|
|
moduleValue18 = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
if (moduleValue18.hasFlag(r31.flags, MessageFlags.IS_VOICE_MESSAGE)) {
|
|
r21 = intl.string(t['6bhHrc']);
|
|
} else if (r31.type === MessageTypes.POLL_RESULT) {
|
|
r21 = (require(7149) /* metro dependency 7149: PollsUtils */).getPollResultsReplyPreviewMobile(r31);
|
|
} else {
|
|
moduleValue19 = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
r21 = moduleValue19.hasFlag(r31.flags,
|
|
MessageFlags.IS_COMPONENTS_V2) ? intl.string(t.Xxm5i3) : r31.content === '' || content == null ? intl.string(t.JAKsM8) : null;
|
|
}
|
|
}
|
|
if (message3.type === MessageTypes.POLL_RESULT) {
|
|
messageContent.content = r21;
|
|
}
|
|
object = {};
|
|
object.state = ReferencedMessageRowState.LOADED;
|
|
object.message = messageContent;
|
|
if (r21 == null) {
|
|
r98 = object;
|
|
} else {
|
|
object.systemContent = r21;
|
|
r98 = object;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (ReferencedMessageState.NOT_LOADED === state) {
|
|
object = {};
|
|
object.state = ReferencedMessageRowState.SYSTEM;
|
|
object.content = intl.string(t['1i+hMi']);
|
|
r98 = object;
|
|
} else if (ReferencedMessageState.DELETED === state) {
|
|
r98 = {state: ReferencedMessageRowState.SYSTEM, content: intl.string(t.mE3KJN)};
|
|
} else {
|
|
(require(1360) /* metro dependency 1360: GlobalUtils */).assertNever(value41);
|
|
r98 = value;
|
|
}
|
|
} else {
|
|
r98 = value;
|
|
}
|
|
r95 = renderThreadEmbeds ? createThreadEmbed(message, roleStyle, isInlineReplyPreview, value10, options,
|
|
r18) : value;
|
|
var interactionStatus = (require(8426) /* metro dependency 8426: InteractionStatus */).createInteractionStatus(message,
|
|
|
|
interaction);
|
|
var r14 = r17 != null ? GuildMemberStore.getMember(r17, author.id) : null;
|
|
var isMemberCommunicationDisabled2 = (require(3773) /* metro dependency 3773: CommunicationDisabledUtils */).isMemberCommunicationDisabled(r14);
|
|
var useReducedMotion = AccessibilityStore.useReducedMotion;
|
|
var alwaysShowLinkDecorations = AccessibilityStore.alwaysShowLinkDecorations;
|
|
r29 = (value9 == null ? value : value9.parent_id) == null || value9 == null ? value9 : value9.isThread() ? ChannelStore.getChannel(value9.parent_id) : value9;
|
|
var visibleConnectionsRole = (require(5043) /* metro dependency 5043: ConnectionsUtils */).getVisibleConnectionsRole({guildMember: r14,
|
|
|
|
channel: r29, onlyChannelConnectionRoles: true});
|
|
var value57 = r38.attachments.length !== 0;
|
|
var value58 = r38.embeds.length !== 0;
|
|
var r143 = value28 && message.attachments.length === 0 && uploaderFileForMessageId != null;
|
|
object = [];
|
|
if (r143) {
|
|
r35 = (importDefault(8427) /* metro dependency 8427: transformUploaderAttachments */)({uploaderFile: uploaderFileForMessageId,
|
|
|
|
|
|
isFailedMessage: message.state === MessageStates.SEND_FAILED, shouldInlineAttachmentMedia: r40});
|
|
} else if (renderAttachments) {
|
|
defaultImport8 = importDefault(8428) /* metro dependency 8428: transformMessageAttachments */;
|
|
uploadStoreBinding = UploadStore;
|
|
r35 = defaultImport8({attachments: r38.attachments,
|
|
uploadAttachments: uploadStoreBinding.getUploadAttachments(message.nonce),
|
|
shouldInlineAttachmentMedia: r40,
|
|
gifAutoPlay: gifAutoPlay, viewImageDescriptions: setting, useReducedMotion: useReducedMotion,
|
|
shouldObscureSpoiler: shouldObscureSpoiler, themedBackgroundColor: value6.embedBackgroundColor,
|
|
enabledContentHarmTypeFlags: enabledHarmTypesForMessage,
|
|
shouldAgeVerify: shouldAgeVerifyForExplicitMedia2,
|
|
colors: value6});
|
|
} else {
|
|
r35 = object;
|
|
}
|
|
if (r143) {
|
|
if (message.state !== MessageStates.SEND_FAILED) {
|
|
r68 = intl.string(t['yXY+5J']);
|
|
} else {
|
|
moduleValue24 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
r68 = moduleValue24.calendarFormat(message.timestamp, true, timestampHourCycle);
|
|
}
|
|
} else {
|
|
moduleValue24 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
r68 = moduleValue24.calendarFormat(message.timestamp, true, timestampHourCycle);
|
|
}
|
|
if (r143) {
|
|
if (message.state !== MessageStates.SEND_FAILED) {
|
|
r65 = intl.string(t['yXY+5J']);
|
|
} else {
|
|
moduleValue25 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
r65 = moduleValue25.accessibilityLabelCalendarFormat(message.timestamp);
|
|
}
|
|
} else {
|
|
moduleValue25 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
r65 = moduleValue25.accessibilityLabelCalendarFormat(message.timestamp);
|
|
}
|
|
var id2 = AuthenticationStore.getId();
|
|
r63 = message.isUnsupported ? intl.string(t.sWi5EU) : r23;
|
|
var isPoll2 = message.isPoll();
|
|
r63 = !((isPoll2 ? !isInlineReplyPreview && renderPolls : !isPoll2) || r23 != null && r23 !== '') ? (require(7149) /* metro dependency 7149: PollsUtils */).getPollReplyPreview(message) : r63;
|
|
r29 = renderPolls ? (importDefault(8431) /* metro dependency 8431: formatPollMessageChatData */)(message, value,
|
|
{theme: r18, animateEmoji: animateEmoji}) : value;
|
|
r24 = renderSharedClientTheme ? (require(8439) /* metro dependency 8439: formatSharedClientThemeData */).formatSharedClientThemeData(message,
|
|
|
|
value35, nick) : value;
|
|
var moduleValue28 = require(8401) /* metro dependency 8401: GuildTagUtils */;
|
|
var shouldDisplayGuildTag = moduleValue28.shouldDisplayGuildTag;
|
|
id = author.id;
|
|
r0 = r17 ?? value;
|
|
if (Reflect.apply(shouldDisplayGuildTag, moduleValue28, [id, r0])) {
|
|
moduleValue29 = require(8401) /* metro dependency 8401: GuildTagUtils */;
|
|
value76 = moduleValue29.getUserPrimaryGuild(author.primaryGuild);
|
|
guildId = value76.guildId;
|
|
tag = value76.tag;
|
|
if (value76.guildId != null) {
|
|
moduleValue30 = require(8401) /* metro dependency 8401: GuildTagUtils */;
|
|
r0 = moduleValue30.getGuildTagBadgeUrl(value76.guildId, value76.badge, GuildTagBadgeSize.SIZE_12);
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
r19 = r0;
|
|
r21 = tag;
|
|
r23 = guildId;
|
|
} else {
|
|
r19 = value;
|
|
r21 = value;
|
|
r23 = value;
|
|
}
|
|
var hasFlag2 = (require(1391) /* metro dependency 1391: FlagUtils */).hasFlag((r38 ?? message).flags,
|
|
MessageFlags.IS_VOICE_MESSAGE);
|
|
var applicationStoreBinding = ApplicationStore;
|
|
var getApplication = applicationStoreBinding.getApplication;
|
|
var applicationId = message.applicationId;
|
|
var value78 = '';
|
|
var value79 = Reflect.apply(getApplication, applicationStoreBinding, [applicationId ?? value78]);
|
|
var value80 = value79 != null;
|
|
if (value80) {
|
|
moduleValue32 = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
r3 = moduleValue32.hasFlag(message.flags, MessageFlags.SENT_BY_SOCIAL_LAYER_INTEGRATION);
|
|
} else {
|
|
r3 = value80;
|
|
}
|
|
id = r3 ? value79.id : value;
|
|
if (r38 != null) {
|
|
if (r38.hasFlag(MessageFlags.IS_GUILD_OFFICIAL)) {
|
|
guild = GuildStore.getGuild(r17);
|
|
if (guild != null) {
|
|
moduleValue33 = require(6858) /* metro dependency 6858: GuildOfficialMessageUtils */;
|
|
if (moduleValue33.isGuildOfficialMessagesEnabled(guild, 'createMessageContent')) {
|
|
r103 = guild.officialMessageColor ?? DEFAULT_GUILD_OFFICIAL_COLOR;
|
|
officialMessageStyle = AccessibilityStore.officialMessageStyle;
|
|
value82 = (require(6858) /* metro dependency 6858: GuildOfficialMessageUtils */).showGuildOfficialMessageGradient(officialMessageStyle);
|
|
r96 = value82 ? r103 | GUILD_OFFICIAL_HIGHLIGHT_ALPHA_COLOR : value;
|
|
moduleValue35 = require(6858) /* metro dependency 6858: GuildOfficialMessageUtils */;
|
|
if (moduleValue35.showGuildOfficialMessageTextColor(officialMessageStyle)) {
|
|
internal = (importDefault(697) /* metro dependency 697: native */).internal;
|
|
semanticColor = internal.resolveSemanticColor(r18,
|
|
(importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER);
|
|
saturation = AccessibilityStore.desaturateUserColors ? AccessibilityStore.saturation : 1;
|
|
moduleValue36 = require(6858) /* metro dependency 6858: GuildOfficialMessageUtils */;
|
|
r3 = moduleValue36.getAccessibleGuildOfficialTextColor(r103, semanticColor, saturation,
|
|
value82 ? GUILD_OFFICIAL_HIGHLIGHT_ALPHA : 0).num();
|
|
} else {
|
|
r3 = value;
|
|
}
|
|
r80 = intl.string(t.GzDTxY);
|
|
r91 = r96;
|
|
r94 = r3;
|
|
} else {
|
|
r80 = value;
|
|
r91 = value;
|
|
r94 = value;
|
|
}
|
|
} else {
|
|
r80 = value;
|
|
r91 = value;
|
|
r94 = value;
|
|
}
|
|
} else {
|
|
r80 = value;
|
|
r91 = value;
|
|
r94 = value;
|
|
}
|
|
} else {
|
|
r80 = value;
|
|
r91 = value;
|
|
r94 = value;
|
|
}
|
|
var moduleValue37 = require(8440) /* metro dependency 8440: VoiceChannelBadge */;
|
|
var voiceChannelBadge = moduleValue37.createVoiceChannelBadge(message.author.id, r17);
|
|
object = {};
|
|
object.id = message.id;
|
|
object.channelId = message.channel_id;
|
|
object.guildId = r17 ?? value;
|
|
object.flags = (r38 ?? message).flags;
|
|
object.type = message.type;
|
|
r96 = message.nonce == null ? message.nonce : typeof message.nonce !== 'string' ? global.String(message.nonce) : message.nonce;
|
|
object.nonce = r96;
|
|
object.state = message.state;
|
|
object.reactions = r172;
|
|
object.referencedMessage = renderContentOnly ? value : r98;
|
|
object.threadEmbed = r95;
|
|
r95 = r97 != null ? r97.getForwardInfo() : value;
|
|
object.forwardInfo = r95;
|
|
var r92 = !ignoreMentioned && message.mentioned;
|
|
object.mentioned = r92;
|
|
r92 = message.isEdited() ? renderContentOnly ? value78 : intl.string(t.C8sXIM) : value78;
|
|
object.edited = r92;
|
|
object.editedColor = value6.editedColor;
|
|
object.textColor = message.isUnsupported ? value6.unsupportedColor : r94 != null ? 4278190080 | r94 : value6.textColor;
|
|
object.officialMessageColor = r91;
|
|
object.linkColor = value6.linkColor;
|
|
object.tagText = tagText;
|
|
object.tagAccessibilityLabel = tagAccessibilityLabel;
|
|
object.tagVerified = tagVerified;
|
|
object.tagTextColor = tagTextColor;
|
|
object.tagBackgroundColor = tagBackgroundColor;
|
|
object.tagType = tagType;
|
|
object.tagIconUrl = tagIconUrl;
|
|
object.opTagText = opTagText;
|
|
object.opTagTextColor = opTagTextColor;
|
|
object.opTagBackgroundColor = opTagBackgroundColor;
|
|
object.stateAccessibilityLabel = r80;
|
|
object.constrainedWidth = constrainedWidth;
|
|
object.gifAutoPlay = gifAutoPlay;
|
|
object.animateEmoji = animateEmoji;
|
|
var r74 = (r67 ? author.username : nick) ?? value;
|
|
object.username = r74;
|
|
object.avatarURL = r67 ? value : value35.uri;
|
|
object.avatarDecorationURL = r67 ? null : value36;
|
|
object.authorId = author.id;
|
|
if (r67) {
|
|
r70 = value6.defaultUsernameColor;
|
|
} else if (roleStyle !== 'username') {
|
|
r70 = value6.defaultUsernameColor;
|
|
} else {
|
|
processColorBinding = processColor;
|
|
r70 = colorString ?? value;
|
|
r70 = processColorBinding(r70) ?? value6.defaultUsernameColor;
|
|
}
|
|
object.usernameColor = r70;
|
|
if (r67) {
|
|
r70 = null;
|
|
} else {
|
|
processColorBinding = processColor;
|
|
r74 = colorString ?? value;
|
|
r74 = processColorBinding(r74) ?? null;
|
|
r70 = r74;
|
|
}
|
|
object.roleColor = r70;
|
|
r70 = hasEnhancedRoleColors ? r67 ? null : (require(8206) /* metro dependency 8206: EnhancedRoleColorUtils */).processColorStrings(colorStrings) : null;
|
|
object.roleColors = r70;
|
|
object.shouldShowRoleDot = roleStyle === 'dot';
|
|
object.shouldShowRoleOnName = roleStyle === 'username';
|
|
object.showLinkDecorations = alwaysShowLinkDecorations;
|
|
if (r67) {
|
|
r64 = value6.defaultUsernameColor;
|
|
} else {
|
|
processColorBinding = processColor;
|
|
r64 = colorString ?? value;
|
|
r64 = processColorBinding(r64) ?? value6.defaultUsernameColor;
|
|
}
|
|
object.colorString = r64;
|
|
object.roleIcon = r67 ? value : r69;
|
|
r64 = visibleConnectionsRole != null ? (require(8442) /* metro dependency 8442: ConnectionsRoleTag */).createConnectionsRoleTag(visibleConnectionsRole) : value;
|
|
object.connectionsRoleTag = r64;
|
|
object.timestamp = r67 ? value : r68;
|
|
object.timestampColor = r67 ? value : value6.timestampColor;
|
|
object.timestampAccessibilityLabel = r67 ? value : r65;
|
|
object.content = r63;
|
|
object.isEditing = isEditing;
|
|
object.renderContentOnly = renderContentOnly;
|
|
r63 = value === pushFeedbackType ? value : (require(8443) /* metro dependency 8443: SurveyIndication */).createSurveyIndication(message,
|
|
|
|
r18, pushFeedbackType);
|
|
object.surveyIndication = r63;
|
|
object.ephemeralIndication = (require(8331) /* metro dependency 8331: EphemeralIndication */).createEphemeralIndication(message);
|
|
object.interactionStatus = interactionStatus;
|
|
if (renderExecutedCommands) {
|
|
moduleValue42 = require(8446) /* metro dependency 8446: ExecutedCommand */;
|
|
r51 = moduleValue42.createExecutedCommand(message, value9, roleStyle, r18, value6.defaultUsernameColor);
|
|
} else {
|
|
r51 = value;
|
|
}
|
|
object.executedCommand = r51;
|
|
r51 = r38.components.length > 0 && renderComponents ? (importDefault(8355) /* metro dependency 8355: transformMessageComponents */)({message: message,
|
|
|
|
guildId: r17, interaction: interaction,
|
|
shouldDisableInteractiveComponents: shouldDisableInteractiveComponents,
|
|
shouldShowMedia: value7, shouldObscureSpoiler: shouldObscureSpoiler,
|
|
enabledContentHarmTypeFlags: enabledHarmTypesForMessage, shouldAgeVerify: shouldAgeVerifyForExplicitMedia2,
|
|
shouldShowMosaicMediaDescriptions: setting, shouldAutoPlayGifs: gifAutoPlay, colors: value6},
|
|
r38.components) : value;
|
|
object.components = r51;
|
|
object.feedbackColor = renderContentOnly ? 0 : value6.feedbackColor;
|
|
object.highlightColor = renderContentOnly ? 0 : value6.highlightColor;
|
|
object.embeds = r49 ?? value;
|
|
object.giftCodes = renderGiftCode ? (require(8449) /* metro dependency 8449: GiftCodeEmbed */).createGiftCodeEmbed(message,
|
|
|
|
r18) : [];
|
|
r44 = renderCodedLinks ? (require(10535) /* metro dependency 10535: CodedLinks */).createCodedLinkEmbeds(message,
|
|
|
|
r38, value9, r18) : [];
|
|
object.codedLinks = r44;
|
|
r44 = renderActivityInstanceEmbed ? (require(10576) /* metro dependency 10576: EmbeddedActivityInstanceEmbed */).createActivityInstanceEmbed(message) : value;
|
|
object.activityInstanceEmbed = r44;
|
|
r44 = renderActivityInviteEmbed ? (require(10578) /* metro dependency 10578: ActivityRichPresenceInviteEmbed */).createActivityRichPresenceInviteEmbed(message,
|
|
|
|
value9) : value;
|
|
object.activityRichPresenceInviteEmbed = r44;
|
|
if (r40) {
|
|
r41 = renderAttachments && (value57 || value58);
|
|
r41 = !r41 ? value28 : r41;
|
|
r40 = r41;
|
|
}
|
|
object.useAttachmentGridLayout = r40;
|
|
object.useAttachmentUploadPreview = value28;
|
|
object.attachments = r35;
|
|
object.attachmentsOpacity = value28 ? message.state !== MessageStates.SEND_FAILED ? 1 : 0.2 : 1;
|
|
if (restrictedPreview) {
|
|
r34 = [];
|
|
} else {
|
|
defaultImport12 = importDefault(10601) /* metro dependency 10601: transformStickers */;
|
|
object4 = {message: r38};
|
|
object4.animateStickersSetting = (require(3829) /* metro dependency 3829: UserSettings */).AnimateStickers.getSetting();
|
|
object4.isUserInteracting = message.id === animatingStickerMessageId;
|
|
r34 = defaultImport12(object4);
|
|
}
|
|
object.stickers = r34;
|
|
var r28 = renderCommunicationDisabled && isMemberCommunicationDisabled2;
|
|
object.communicationDisabled = r28;
|
|
r33 = value9 == null || !value9.isForumPost();
|
|
object.isFirstForumPostMessage = !r33 && message.id === message.channel_id;
|
|
r28 = value9 != null && value9.isForumPost() && renderForumPostActions ? getForumPostActions(message,
|
|
value9) : value;
|
|
object.postActions = r28;
|
|
object.isCurrentUserMessageAuthor = message.author.id === id2;
|
|
object.usingGradientTheme = ClientThemesBackgroundStore.gradientPreset != null;
|
|
object.swipeToReplyIconUrl = (require(8191) /* metro dependency 8191: EmbedUtils */).getAssetUriForEmbed(importDefault(8209) /* metro dependency 8209 */);
|
|
object.swipeToEditIconUrl = (require(8191) /* metro dependency 8191: EmbedUtils */).getAssetUriForEmbed(importDefault(8210) /* metro dependency 8210 */);
|
|
r27 = r27 ? (require(10602) /* metro dependency 10602: PostPreviewEmbeds */).createPostPreviewEmbeds(message,
|
|
roleStyle, useReducedMotion) : [];
|
|
object.postPreviewEmbeds = r27;
|
|
object.obscureLearnMoreLabel = intl.string(t['2aXnfa']);
|
|
object.safetyPolicyNoticeEmbed = (require(10606) /* metro dependency 10606: SafetyPolicyNoticeEmbed */).createSafetyPolicyNoticeEmbed(message);
|
|
object.pollData = r29;
|
|
object.sharedClientTheme = r24;
|
|
object.safetySystemNotificationEmbed = (require(10607) /* metro dependency 10607: SafetySystemNotificationEmbed */).createSafetySystemNotificationEmbed(message);
|
|
var moduleValue52 = require(10608) /* metro dependency 10608: CtaButton */;
|
|
object.ctaButton = moduleValue52.createCtaButton(message.id, message.channel_id, value6);
|
|
object.audioAttachmentBackgroundColor = hasFlag2 ? value6.embedBackgroundColor : value;
|
|
object.accessibilityActions = (require(8216) /* metro dependency 8216: MessageAccessibilityActions */).createMessageAccessibilityActions(message,
|
|
|
|
value9);
|
|
object.clanTagGuildId = r23;
|
|
object.clanTag = r21;
|
|
object.clanBadgeUrl = r19;
|
|
object.isFirst = isFirst;
|
|
object.gameApplicationId = id;
|
|
type = value9 == null ? value : value9.type;
|
|
var GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
|
|
object.isAnnouncementChannel = type === GUILD_ANNOUNCEMENT;
|
|
value = require(10611) /* metro dependency 10611: createDisplayNameStylesMobile */;
|
|
object.displayNameStyles = value.createDisplayNameStylesMobile(message.author, r14);
|
|
object.voiceChannelBadge = voiceChannelBadge;
|
|
}
|
|
return object;
|
|
function createMessageContentTransformComponents(a0) { // fn#65653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8369:5905, owner: createMessageContent.transformComponents, offset: 0x01bd89e9, size: 137 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__;
|
|
return (TransformMessageComponents)({message: message,
|
|
guildId: env0_6, interaction: env0_10, shouldDisableInteractiveComponents: shouldDisableInteractiveComponents,
|
|
shouldShowMedia: env0_5, shouldObscureSpoiler: shouldObscureSpoiler, enabledContentHarmTypeFlags: env0_7,
|
|
shouldAgeVerify: env0_8, shouldShowMosaicMediaDescriptions: env0_9, shouldAutoPlayGifs: gifAutoPlay,
|
|
colors: env0_4}, a0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun65649, 8184, [27, 4502, 4234, 3964, 6540, 8183, 8057, 3785, 8185, 4833, 3786, 6898, 1310, 1226, 1379,
|
|
1945, 1867, 3793, 7223, 1878, 4503, 8178, 661, 8187, 4805, 8189, 21, 8190, 1244, 8191, 8192, 8193, 4643, 1391,
|
|
7149, 8198, 6630, 8199, 8201, 5216, 8203, 8334, 8335, 8350, 4838, 4821, 3829, 8351, 8355, 8293, 8393, 4634,
|
|
1426, 1423, 8396, 1305, 6793, 8425, 1360, 8426, 3773, 5043, 8427, 8428, 3826, 8431, 8439, 8401, 6858, 697, 8440,
|
|
8206, 8442, 8443, 8331, 8446, 8449, 10535, 10576, 10578, 10601, 8209, 8210, 10602, 10606, 10607, 10608, 8216,
|
|
10611,
|
|
2]) /* metro module 8184, dependencies: [27, 4502, 4234, 3964, 6540, 8183, 8057, 3785, 8185, 4833, 3786, 6898, 1310, 1226, 1379, 1945, 1867, 3793, 7223, 1878, 4503, 8178, 661, 8187, 4805, 8189, 21, 8190, 1244, 8191, 8192, 8193, 4643, 1391, 7149, 8198, 6630, 8199, 8201, 5216, 8203, 8334, 8335, 8350, 4838, 4821, 3829, 8351, 8355, 8293, 8393, 4634, 1426, 1423, 8396, 1305, 6793, 8425, 1360, 8426, 3773, 5043, 8427, 8428, 3826, 8431, 8439, 8401, 6858, 697, 8440, 8206, 8442, 8443, 8331, 8446, 8449, 10535, 10576, 10578, 10601, 8209, 8210, 10602, 10606, 10607, 10608, 8216, 10611, 2] */;
|