Files
2026-07-28 01:06:53 +03:00

1107 lines
69 KiB
TypeScript

/* Metro module 10919; source: modules/message_previews/useFormattedMessagePreview.tsx; dependencies: [1226, 3793, 1878, 661, 671, 566, 8214, 4634, 1244, 4631, 4845, 22, 8233, 8319, 2] */
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import UseMessageAuthor from '../messages/useMessageAuthor.tsx'; /* Metro dependency 4634 */
import UseIsCallActive from '../calls/mobile/useIsCallActive.tsx'; /* Metro dependency 8214 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as Module00022Module from '../../by-id/module-00022.js'; /* Metro dependency 22 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as MessageTypesModule from '../../external/discord_common/js/shared/shared-constants/MessageTypes.tsx'; /* Metro dependency 671 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as MediaFormatTestersModule from '../messages/MediaFormatTesters.tsx'; /* Metro dependency 4631 */
import * as UseMessageAuthorModule from '../messages/useMessageAuthor.tsx'; /* Metro dependency 4634 */
function _fun83669(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:6, offset: 0x01f233ef, size: 208 bytes, params: 8, frame: 21
const env0_0 = require;
const isMessageContentPreviewable2 = isMessageContentPreviewable;
const formatMessagePreview2 = formatMessagePreview;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/message_previews/useFormattedMessagePreview.tsx');
exports.isMessageContentPreviewable = isMessageContentPreviewable2;
exports.useFormattedMessagePreview = useFormattedMessagePreview;
exports.formatMessagePreview = formatMessagePreview2;
function isMessageContentPreviewable({type}) { // fn#83670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:149, offset: 0x01f234bf, size: 264 bytes, params: 2, frame: 14
const MessageTypes = (MessageTypesModule).MessageTypes;
const DEFAULT = MessageTypes.DEFAULT;
if (DEFAULT === type) {
return true;
}
const CHANGELOG = MessageTypes.CHANGELOG;
if (CHANGELOG === type) {
return true;
}
const REPLY = MessageTypes.REPLY;
if (REPLY === type) {
return true;
}
const CHAT_INPUT_COMMAND = MessageTypes.CHAT_INPUT_COMMAND;
if (CHAT_INPUT_COMMAND === type) {
return true;
}
const CONTEXT_MENU_COMMAND = MessageTypes.CONTEXT_MENU_COMMAND;
if (CONTEXT_MENU_COMMAND === type) {
return true;
}
const POLL_RESULT = MessageTypes.POLL_RESULT;
if (POLL_RESULT === type) {
return true;
}
const AUTO_MODERATION_ACTION = MessageTypes.AUTO_MODERATION_ACTION;
if (AUTO_MODERATION_ACTION === type) {
return true;
}
return false;
}
function formatMessagePreview(a0, a1) { // fn#83671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:512, offset: 0x01f235c7, size: 2732 bytes, params: 3, frame: 30
var r9;
var r4;
var value3;
var currentUserId;
var otherUser;
var otherUserNick;
var isCallActive;
const MessageTypes = (MessageTypesModule).MessageTypes;
var object;
const intl = (IndexNativeModule).intl;
var formatToPlainString;
const t = (IndexNativeModule).t;
const identity = (Module00022Module).identity;
const isBlocked = a1.isBlocked;
const isIgnored = a1.isIgnored;
let authorNick = a1.authorNick;
var value;
if (isBlocked) {
return {type: 'text', text: intl.string(t.XAkOo2)};
}
if (isIgnored) {
object = {type: 'text'};
object.text = intl.string(t['G7p6v/']);
return object;
}
const isMessageContentPreviewableBinding = isMessageContentPreviewable;
const value2 = undefined;
if (isMessageContentPreviewableBinding(a0)) {
value3 = formatMessageContentPreview(a0);
if (value3 != null) {
object = {};
copyDataProperties(object, value3, undefined);
object['authorLabel'] = authorNick;
return object;
}
currentUserId = a1.currentUserId;
authorNick = a1.authorNick;
otherUser = a1.otherUser;
otherUserNick = a1.otherUserNick;
isCallActive = a1.isCallActive;
if (a0.type !== MessageTypes.RECIPIENT_ADD) {
if (a0.type !== MessageTypes.RECIPIENT_REMOVE) {
if (a0.type === MessageTypes.CALL) {
object = {type: 'text'};
r9 = isCallActive ? intl.string(t['NGg/fm']) : a0.call == null || a0.call.participants.includes(currentUserId) ? intl.string(t.v05Xd6) : intl.string(t['2CnhoI']);
object.text = r9;
r9 = isCallActive ? 'text-feedback-positive' : value2;
object.color = r9;
r9 = isCallActive ? 'call-active' : 'call-ended';
object.trailingIcon = r9;
r4 = object;
} else if (a0.type === MessageTypes.CHANNEL_NAME_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.oItgEw, {username: authorNick,
usernameHook: identity,
channelName: a0.content})};
} else if (a0.type === MessageTypes.CHANNEL_ICON_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.OEdU6X, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.CHANNEL_PINNED_MESSAGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vfkjqx, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.USER_JOIN) {
formatToPlainString = intl.formatToPlainString;
value = importDefault(8233) /* metro dependency 8233: SystemMessageUtils */;
value = value.getSystemMessageUserJoin(a0.id);
r4 = {type: 'text', text: Reflect.apply(formatToPlainString, intl, [value, {username: authorNick,
usernameHook: identity}])};
} else if (a0.type === MessageTypes.THREAD_CREATED) {
r4 = {type: 'text', text: intl.formatToPlainString(t.SGaUAU, {actorName: authorNick,
actorHook: identity,
threadName: a0.content, threadOnClick: identity})};
} else if (a0.type === MessageTypes.PREMIUM_REFERRAL) {
r4 = {type: 'text', text: intl.formatToPlainString(t.lieTqU, {username: authorNick})};
} else if (a0.type === MessageTypes.STAGE_START) {
r4 = {type: 'text', text: intl.formatToPlainString(t.aZtRW8, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_END) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vMJhvG, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_SPEAKER) {
r4 = {type: 'text', text: intl.formatToPlainString(t.V4uCm4, {username: authorNick,
usernameOnClick: identity})};
} else if (a0.type === MessageTypes.STAGE_TOPIC) {
r4 = {type: 'text', text: intl.formatToPlainString(t.ro3RM0, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type !== MessageTypes.VOICE_SESSION) {
r4 = value2;
} else {
object = {type: 'text'};
object.text = (require(8319) /* metro dependency 8319: VoiceSessionUtils */).getVoiceSessionMessageContent(a0);
r4 = object;
}
} else if (otherUserNick != null) {
r4 = {type: 'text',
text: a0.author.id === (otherUser == null ? value2 : otherUser.id) ? intl.formatToPlainString(t['5v2xa8'],
{username: authorNick, usernameHook: identity}) : intl.formatToPlainString(t.L2FyVq,
{username: authorNick,
usernameHook: identity, otherUsername: otherUserNick, otherUsernameHook: identity})};
} else if (a0.type === MessageTypes.CALL) {
object = {type: 'text'};
r9 = isCallActive ? intl.string(t['NGg/fm']) : a0.call == null || a0.call.participants.includes(currentUserId) ? intl.string(t.v05Xd6) : intl.string(t['2CnhoI']);
object.text = r9;
r9 = isCallActive ? 'text-feedback-positive' : value2;
object.color = r9;
r9 = isCallActive ? 'call-active' : 'call-ended';
object.trailingIcon = r9;
r4 = object;
} else if (a0.type === MessageTypes.CHANNEL_NAME_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.oItgEw, {username: authorNick,
usernameHook: identity,
channelName: a0.content})};
} else if (a0.type === MessageTypes.CHANNEL_ICON_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.OEdU6X, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.CHANNEL_PINNED_MESSAGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vfkjqx, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.USER_JOIN) {
formatToPlainString = intl.formatToPlainString;
value = importDefault(8233) /* metro dependency 8233: SystemMessageUtils */;
value = value.getSystemMessageUserJoin(a0.id);
r4 = {type: 'text', text: Reflect.apply(formatToPlainString, intl, [value, {username: authorNick,
usernameHook: identity}])};
} else if (a0.type === MessageTypes.THREAD_CREATED) {
r4 = {type: 'text', text: intl.formatToPlainString(t.SGaUAU, {actorName: authorNick,
actorHook: identity,
threadName: a0.content, threadOnClick: identity})};
} else if (a0.type === MessageTypes.PREMIUM_REFERRAL) {
r4 = {type: 'text', text: intl.formatToPlainString(t.lieTqU, {username: authorNick})};
} else if (a0.type === MessageTypes.STAGE_START) {
r4 = {type: 'text', text: intl.formatToPlainString(t.aZtRW8, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_END) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vMJhvG, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_SPEAKER) {
r4 = {type: 'text', text: intl.formatToPlainString(t.V4uCm4, {username: authorNick,
usernameOnClick: identity})};
} else if (a0.type === MessageTypes.STAGE_TOPIC) {
r4 = {type: 'text', text: intl.formatToPlainString(t.ro3RM0, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type !== MessageTypes.VOICE_SESSION) {
r4 = value2;
} else {
object = {type: 'text'};
object.text = (require(8319) /* metro dependency 8319: VoiceSessionUtils */).getVoiceSessionMessageContent(a0);
r4 = object;
}
} else if (otherUserNick != null) {
r4 = {type: 'text', text: intl.formatToPlainString(t.MMN2Jq, {username: authorNick, usernameHook: identity,
otherUsername: otherUserNick, otherUsernameHook: identity})};
} else if (a0.type !== MessageTypes.RECIPIENT_REMOVE) {
if (a0.type === MessageTypes.CALL) {
object = {type: 'text'};
r9 = isCallActive ? intl.string(t['NGg/fm']) : a0.call == null || a0.call.participants.includes(currentUserId) ? intl.string(t.v05Xd6) : intl.string(t['2CnhoI']);
object.text = r9;
r9 = isCallActive ? 'text-feedback-positive' : value2;
object.color = r9;
r9 = isCallActive ? 'call-active' : 'call-ended';
object.trailingIcon = r9;
r4 = object;
} else if (a0.type === MessageTypes.CHANNEL_NAME_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.oItgEw, {username: authorNick,
usernameHook: identity,
channelName: a0.content})};
} else if (a0.type === MessageTypes.CHANNEL_ICON_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.OEdU6X, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.CHANNEL_PINNED_MESSAGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vfkjqx, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.USER_JOIN) {
formatToPlainString = intl.formatToPlainString;
value = importDefault(8233) /* metro dependency 8233: SystemMessageUtils */;
value = value.getSystemMessageUserJoin(a0.id);
r4 = {type: 'text', text: Reflect.apply(formatToPlainString, intl, [value, {username: authorNick,
usernameHook: identity}])};
} else if (a0.type === MessageTypes.THREAD_CREATED) {
r4 = {type: 'text', text: intl.formatToPlainString(t.SGaUAU, {actorName: authorNick,
actorHook: identity,
threadName: a0.content, threadOnClick: identity})};
} else if (a0.type === MessageTypes.PREMIUM_REFERRAL) {
r4 = {type: 'text', text: intl.formatToPlainString(t.lieTqU, {username: authorNick})};
} else if (a0.type === MessageTypes.STAGE_START) {
r4 = {type: 'text', text: intl.formatToPlainString(t.aZtRW8, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_END) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vMJhvG, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_SPEAKER) {
r4 = {type: 'text', text: intl.formatToPlainString(t.V4uCm4, {username: authorNick,
usernameOnClick: identity})};
} else if (a0.type === MessageTypes.STAGE_TOPIC) {
r4 = {type: 'text', text: intl.formatToPlainString(t.ro3RM0, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type !== MessageTypes.VOICE_SESSION) {
r4 = value2;
} else {
object = {type: 'text'};
object.text = (require(8319) /* metro dependency 8319: VoiceSessionUtils */).getVoiceSessionMessageContent(a0);
r4 = object;
}
} else if (otherUserNick != null) {
r4 = {type: 'text',
text: a0.author.id === (otherUser == null ? value2 : otherUser.id) ? intl.formatToPlainString(t['5v2xa8'],
{username: authorNick, usernameHook: identity}) : intl.formatToPlainString(t.L2FyVq,
{username: authorNick,
usernameHook: identity, otherUsername: otherUserNick, otherUsernameHook: identity})};
} else if (a0.type === MessageTypes.CALL) {
object = {type: 'text'};
r9 = isCallActive ? intl.string(t['NGg/fm']) : a0.call == null || a0.call.participants.includes(currentUserId) ? intl.string(t.v05Xd6) : intl.string(t['2CnhoI']);
object.text = r9;
r9 = isCallActive ? 'text-feedback-positive' : value2;
object.color = r9;
r9 = isCallActive ? 'call-active' : 'call-ended';
object.trailingIcon = r9;
r4 = object;
} else if (a0.type === MessageTypes.CHANNEL_NAME_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.oItgEw, {username: authorNick, usernameHook: identity,
channelName: a0.content})};
} else if (a0.type === MessageTypes.CHANNEL_ICON_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.OEdU6X, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.CHANNEL_PINNED_MESSAGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vfkjqx, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.USER_JOIN) {
formatToPlainString = intl.formatToPlainString;
value = importDefault(8233) /* metro dependency 8233: SystemMessageUtils */;
value = value.getSystemMessageUserJoin(a0.id);
r4 = {type: 'text', text: Reflect.apply(formatToPlainString, intl, [value, {username: authorNick,
usernameHook: identity}])};
} else if (a0.type === MessageTypes.THREAD_CREATED) {
r4 = {type: 'text', text: intl.formatToPlainString(t.SGaUAU, {actorName: authorNick, actorHook: identity,
threadName: a0.content, threadOnClick: identity})};
} else if (a0.type === MessageTypes.PREMIUM_REFERRAL) {
r4 = {type: 'text', text: intl.formatToPlainString(t.lieTqU, {username: authorNick})};
} else if (a0.type === MessageTypes.STAGE_START) {
r4 = {type: 'text', text: intl.formatToPlainString(t.aZtRW8, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_END) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vMJhvG, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_SPEAKER) {
r4 = {type: 'text', text: intl.formatToPlainString(t.V4uCm4, {username: authorNick,
usernameOnClick: identity})};
} else if (a0.type === MessageTypes.STAGE_TOPIC) {
r4 = {type: 'text', text: intl.formatToPlainString(t.ro3RM0, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type !== MessageTypes.VOICE_SESSION) {
r4 = value2;
} else {
object = {type: 'text'};
object.text = (require(8319) /* metro dependency 8319: VoiceSessionUtils */).getVoiceSessionMessageContent(a0);
r4 = object;
}
} else {
currentUserId = a1.currentUserId;
authorNick = a1.authorNick;
otherUser = a1.otherUser;
otherUserNick = a1.otherUserNick;
isCallActive = a1.isCallActive;
if (a0.type !== MessageTypes.RECIPIENT_ADD) {
if (a0.type !== MessageTypes.RECIPIENT_REMOVE) {
if (a0.type === MessageTypes.CALL) {
object = {type: 'text'};
r9 = isCallActive ? intl.string(t['NGg/fm']) : a0.call == null || a0.call.participants.includes(currentUserId) ? intl.string(t.v05Xd6) : intl.string(t['2CnhoI']);
object.text = r9;
r9 = isCallActive ? 'text-feedback-positive' : value2;
object.color = r9;
r9 = isCallActive ? 'call-active' : 'call-ended';
object.trailingIcon = r9;
r4 = object;
} else if (a0.type === MessageTypes.CHANNEL_NAME_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.oItgEw, {username: authorNick,
usernameHook: identity,
channelName: a0.content})};
} else if (a0.type === MessageTypes.CHANNEL_ICON_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.OEdU6X, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.CHANNEL_PINNED_MESSAGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vfkjqx, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.USER_JOIN) {
formatToPlainString = intl.formatToPlainString;
value = importDefault(8233) /* metro dependency 8233: SystemMessageUtils */;
value = value.getSystemMessageUserJoin(a0.id);
r4 = {type: 'text', text: Reflect.apply(formatToPlainString, intl, [value, {username: authorNick,
usernameHook: identity}])};
} else if (a0.type === MessageTypes.THREAD_CREATED) {
r4 = {type: 'text', text: intl.formatToPlainString(t.SGaUAU, {actorName: authorNick,
actorHook: identity,
threadName: a0.content, threadOnClick: identity})};
} else if (a0.type === MessageTypes.PREMIUM_REFERRAL) {
r4 = {type: 'text', text: intl.formatToPlainString(t.lieTqU, {username: authorNick})};
} else if (a0.type === MessageTypes.STAGE_START) {
r4 = {type: 'text', text: intl.formatToPlainString(t.aZtRW8, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_END) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vMJhvG, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_SPEAKER) {
r4 = {type: 'text', text: intl.formatToPlainString(t.V4uCm4, {username: authorNick,
usernameOnClick: identity})};
} else if (a0.type === MessageTypes.STAGE_TOPIC) {
r4 = {type: 'text', text: intl.formatToPlainString(t.ro3RM0, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type !== MessageTypes.VOICE_SESSION) {
r4 = value2;
} else {
object = {type: 'text'};
object.text = (require(8319) /* metro dependency 8319: VoiceSessionUtils */).getVoiceSessionMessageContent(a0);
r4 = object;
}
} else if (otherUserNick != null) {
r4 = {type: 'text',
text: a0.author.id === (otherUser == null ? value2 : otherUser.id) ? intl.formatToPlainString(t['5v2xa8'],
{username: authorNick, usernameHook: identity}) : intl.formatToPlainString(t.L2FyVq,
{username: authorNick,
usernameHook: identity, otherUsername: otherUserNick, otherUsernameHook: identity})};
} else if (a0.type === MessageTypes.CALL) {
object = {type: 'text'};
r9 = isCallActive ? intl.string(t['NGg/fm']) : a0.call == null || a0.call.participants.includes(currentUserId) ? intl.string(t.v05Xd6) : intl.string(t['2CnhoI']);
object.text = r9;
r9 = isCallActive ? 'text-feedback-positive' : value2;
object.color = r9;
r9 = isCallActive ? 'call-active' : 'call-ended';
object.trailingIcon = r9;
r4 = object;
} else if (a0.type === MessageTypes.CHANNEL_NAME_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.oItgEw, {username: authorNick,
usernameHook: identity,
channelName: a0.content})};
} else if (a0.type === MessageTypes.CHANNEL_ICON_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.OEdU6X, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.CHANNEL_PINNED_MESSAGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vfkjqx, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.USER_JOIN) {
formatToPlainString = intl.formatToPlainString;
value = importDefault(8233) /* metro dependency 8233: SystemMessageUtils */;
value = value.getSystemMessageUserJoin(a0.id);
r4 = {type: 'text', text: Reflect.apply(formatToPlainString, intl, [value, {username: authorNick,
usernameHook: identity}])};
} else if (a0.type === MessageTypes.THREAD_CREATED) {
r4 = {type: 'text', text: intl.formatToPlainString(t.SGaUAU, {actorName: authorNick,
actorHook: identity,
threadName: a0.content, threadOnClick: identity})};
} else if (a0.type === MessageTypes.PREMIUM_REFERRAL) {
r4 = {type: 'text', text: intl.formatToPlainString(t.lieTqU, {username: authorNick})};
} else if (a0.type === MessageTypes.STAGE_START) {
r4 = {type: 'text', text: intl.formatToPlainString(t.aZtRW8, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_END) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vMJhvG, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_SPEAKER) {
r4 = {type: 'text', text: intl.formatToPlainString(t.V4uCm4, {username: authorNick,
usernameOnClick: identity})};
} else if (a0.type === MessageTypes.STAGE_TOPIC) {
r4 = {type: 'text', text: intl.formatToPlainString(t.ro3RM0, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type !== MessageTypes.VOICE_SESSION) {
r4 = value2;
} else {
object = {type: 'text'};
object.text = (require(8319) /* metro dependency 8319: VoiceSessionUtils */).getVoiceSessionMessageContent(a0);
r4 = object;
}
} else if (otherUserNick != null) {
r4 = {type: 'text', text: intl.formatToPlainString(t.MMN2Jq, {username: authorNick, usernameHook: identity,
otherUsername: otherUserNick, otherUsernameHook: identity})};
} else if (a0.type !== MessageTypes.RECIPIENT_REMOVE) {
if (a0.type === MessageTypes.CALL) {
object = {type: 'text'};
r9 = isCallActive ? intl.string(t['NGg/fm']) : a0.call == null || a0.call.participants.includes(currentUserId) ? intl.string(t.v05Xd6) : intl.string(t['2CnhoI']);
object.text = r9;
r9 = isCallActive ? 'text-feedback-positive' : value2;
object.color = r9;
r9 = isCallActive ? 'call-active' : 'call-ended';
object.trailingIcon = r9;
r4 = object;
} else if (a0.type === MessageTypes.CHANNEL_NAME_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.oItgEw, {username: authorNick,
usernameHook: identity,
channelName: a0.content})};
} else if (a0.type === MessageTypes.CHANNEL_ICON_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.OEdU6X, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.CHANNEL_PINNED_MESSAGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vfkjqx, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.USER_JOIN) {
formatToPlainString = intl.formatToPlainString;
value = importDefault(8233) /* metro dependency 8233: SystemMessageUtils */;
value = value.getSystemMessageUserJoin(a0.id);
r4 = {type: 'text', text: Reflect.apply(formatToPlainString, intl, [value, {username: authorNick,
usernameHook: identity}])};
} else if (a0.type === MessageTypes.THREAD_CREATED) {
r4 = {type: 'text', text: intl.formatToPlainString(t.SGaUAU, {actorName: authorNick,
actorHook: identity,
threadName: a0.content, threadOnClick: identity})};
} else if (a0.type === MessageTypes.PREMIUM_REFERRAL) {
r4 = {type: 'text', text: intl.formatToPlainString(t.lieTqU, {username: authorNick})};
} else if (a0.type === MessageTypes.STAGE_START) {
r4 = {type: 'text', text: intl.formatToPlainString(t.aZtRW8, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_END) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vMJhvG, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_SPEAKER) {
r4 = {type: 'text', text: intl.formatToPlainString(t.V4uCm4, {username: authorNick,
usernameOnClick: identity})};
} else if (a0.type === MessageTypes.STAGE_TOPIC) {
r4 = {type: 'text', text: intl.formatToPlainString(t.ro3RM0, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type !== MessageTypes.VOICE_SESSION) {
r4 = value2;
} else {
object = {type: 'text'};
object.text = (require(8319) /* metro dependency 8319: VoiceSessionUtils */).getVoiceSessionMessageContent(a0);
r4 = object;
}
} else if (otherUserNick != null) {
r4 = {type: 'text',
text: a0.author.id === (otherUser == null ? value2 : otherUser.id) ? intl.formatToPlainString(t['5v2xa8'],
{username: authorNick, usernameHook: identity}) : intl.formatToPlainString(t.L2FyVq,
{username: authorNick,
usernameHook: identity, otherUsername: otherUserNick, otherUsernameHook: identity})};
} else if (a0.type === MessageTypes.CALL) {
object = {type: 'text'};
r9 = isCallActive ? intl.string(t['NGg/fm']) : a0.call == null || a0.call.participants.includes(currentUserId) ? intl.string(t.v05Xd6) : intl.string(t['2CnhoI']);
object.text = r9;
r9 = isCallActive ? 'text-feedback-positive' : value2;
object.color = r9;
r9 = isCallActive ? 'call-active' : 'call-ended';
object.trailingIcon = r9;
r4 = object;
} else if (a0.type === MessageTypes.CHANNEL_NAME_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.oItgEw, {username: authorNick, usernameHook: identity,
channelName: a0.content})};
} else if (a0.type === MessageTypes.CHANNEL_ICON_CHANGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.OEdU6X, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.CHANNEL_PINNED_MESSAGE) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vfkjqx, {username: authorNick,
usernameHook: identity})};
} else if (a0.type === MessageTypes.USER_JOIN) {
formatToPlainString = intl.formatToPlainString;
value = importDefault(8233) /* metro dependency 8233: SystemMessageUtils */;
value = value.getSystemMessageUserJoin(a0.id);
r4 = {type: 'text', text: Reflect.apply(formatToPlainString, intl, [value, {username: authorNick,
usernameHook: identity}])};
} else if (a0.type === MessageTypes.THREAD_CREATED) {
r4 = {type: 'text', text: intl.formatToPlainString(t.SGaUAU, {actorName: authorNick, actorHook: identity,
threadName: a0.content, threadOnClick: identity})};
} else if (a0.type === MessageTypes.PREMIUM_REFERRAL) {
r4 = {type: 'text', text: intl.formatToPlainString(t.lieTqU, {username: authorNick})};
} else if (a0.type === MessageTypes.STAGE_START) {
r4 = {type: 'text', text: intl.formatToPlainString(t.aZtRW8, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_END) {
r4 = {type: 'text', text: intl.formatToPlainString(t.vMJhvG, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type === MessageTypes.STAGE_SPEAKER) {
r4 = {type: 'text', text: intl.formatToPlainString(t.V4uCm4, {username: authorNick,
usernameOnClick: identity})};
} else if (a0.type === MessageTypes.STAGE_TOPIC) {
r4 = {type: 'text', text: intl.formatToPlainString(t.ro3RM0, {username: authorNick,
usernameOnClick: identity,
topic: a0.content})};
} else if (a0.type !== MessageTypes.VOICE_SESSION) {
r4 = value2;
} else {
object = {type: 'text'};
object.text = (require(8319) /* metro dependency 8319: VoiceSessionUtils */).getVoiceSessionMessageContent(a0);
r4 = object;
}
}
return r4 ?? value2;
function formatMessageContentPreview(a0) { // fn#83672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:774, owner: formatMessagePreview.formatMessageContentPreview, offset: 0x01f24073, size: 1721 bytes, params: 2, frame: 23
var environment;
var r5;
var r0;
var r4;
var content;
var hasFlag;
var value;
var object;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var formatToPlainString;
var ImizdM;
var poll;
var value2;
var value3;
var value7;
var value8;
let embeds = a0.embeds;
let length = embeds.length;
if (length !== 1) {
content = a0.content;
if (content == null) {
hasFlag = a0.hasFlag;
value = environment.__proto__;
if (Reflect.apply(hasFlag, a0, [MessageFlags.IS_VOICE_MESSAGE])) {
return {type: 'text', text: intl.string(t.slFYgi)};
}
length = a0.attachments.length;
if (length > 0) {
value7 = a0.attachments.every(_fun83673);
value8 = !value7;
r4 = value7 ? value8 : a0.attachments.every(_fun83674);
r0 = value7 ? value8 : !r4;
r0 = r0 && a0.attachments.every(_fun83675);
r0 = value7 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.attachments.length})} : r4 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.attachments.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.attachments.length})} : {'type': 'text', 'text': null, 'trailingIcon': 'attachment',
text: intl.formatToPlainString(t['89ihS8'], {count: a0.attachments.length})};
return r0;
}
length = a0.embeds.length;
if (length > 0) {
value2 = a0.embeds.every(_fun83676);
value3 = !value2;
r5 = value2 ? value3 : a0.embeds.every(_fun83677);
r0 = value2 ? value3 : !r5;
r0 = r0 && a0.embeds.every(_fun83678);
r0 = value2 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.embeds.length})} : r5 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.embeds.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.embeds.length})} : a0.embeds.length > 0 && a0.embeds[0].rawTitle != null ? {type: 'markup',
markup: a0.embeds[0].rawTitle} : a0.embeds.length > 0 && a0.embeds[0].rawDescription != null ? {type: 'markup',
markup: a0.embeds[0].rawDescription} : {'type': 'text', 'text': null, 'trailingIcon': 'link',
text: intl.formatToPlainString(t['9XuYjs'], {count: a0.embeds.length})};
return r0;
}
length = a0.stickerItems.length;
if (length > 0) {
return {'type': 'text', 'text': null, 'trailingIcon': 'sticker', text: a0.stickerItems[0].name};
}
if (a0.isPoll()) {
value = undefined;
formatToPlainString = intl.formatToPlainString;
ImizdM = t.ImizdM;
poll = a0.poll;
return {type: 'text', text: Reflect.apply(formatToPlainString, intl, [ImizdM,
{question: poll == null ? value : poll.question.text}])};
}
if ((importDefault(4845) /* metro dependency 4845: isForwardMessage */)(a0)) {
object = {type: 'text'};
object.text = intl.string(t['9ddYKt']);
return object;
}
return undefined;
}
content = a0.content;
if (content !== '') {
return {type: 'message', message: a0};
}
hasFlag = a0.hasFlag;
value = environment.__proto__;
if (Reflect.apply(hasFlag, a0, [MessageFlags.IS_VOICE_MESSAGE])) {
return {type: 'text', text: intl.string(t.slFYgi)};
}
length = a0.attachments.length;
if (length > 0) {
value7 = a0.attachments.every(_fun83673);
value8 = !value7;
r4 = value7 ? value8 : a0.attachments.every(_fun83674);
r0 = value7 ? value8 : !r4;
r0 = r0 && a0.attachments.every(_fun83675);
r0 = value7 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.attachments.length})} : r4 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.attachments.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.attachments.length})} : {'type': 'text', 'text': null, 'trailingIcon': 'attachment',
text: intl.formatToPlainString(t['89ihS8'], {count: a0.attachments.length})};
return r0;
}
length = a0.embeds.length;
if (length > 0) {
value2 = a0.embeds.every(_fun83676);
value3 = !value2;
r5 = value2 ? value3 : a0.embeds.every(_fun83677);
r0 = value2 ? value3 : !r5;
r0 = r0 && a0.embeds.every(_fun83678);
r0 = value2 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.embeds.length})} : r5 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.embeds.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.embeds.length})} : a0.embeds.length > 0 && a0.embeds[0].rawTitle != null ? {type: 'markup',
markup: a0.embeds[0].rawTitle} : a0.embeds.length > 0 && a0.embeds[0].rawDescription != null ? {type: 'markup',
markup: a0.embeds[0].rawDescription} : {'type': 'text', 'text': null, 'trailingIcon': 'link',
text: intl.formatToPlainString(t['9XuYjs'], {count: a0.embeds.length})};
return r0;
}
length = a0.stickerItems.length;
if (length > 0) {
return {'type': 'text', 'text': null, 'trailingIcon': 'sticker', text: a0.stickerItems[0].name};
}
if (a0.isPoll()) {
value = undefined;
formatToPlainString = intl.formatToPlainString;
ImizdM = t.ImizdM;
poll = a0.poll;
return {type: 'text', text: Reflect.apply(formatToPlainString, intl, [ImizdM,
{question: poll == null ? value : poll.question.text}])};
}
if ((importDefault(4845) /* metro dependency 4845: isForwardMessage */)(a0)) {
object = {type: 'text'};
object.text = intl.string(t['9ddYKt']);
return object;
}
} else {
embeds = a0.embeds;
var url = embeds[0].url;
content = a0.content;
if (url !== content) {
content = a0.content;
if (content == null) {
hasFlag = a0.hasFlag;
value = environment.__proto__;
if (Reflect.apply(hasFlag, a0, [MessageFlags.IS_VOICE_MESSAGE])) {
return {type: 'text', text: intl.string(t.slFYgi)};
}
length = a0.attachments.length;
if (length > 0) {
value7 = a0.attachments.every(_fun83673);
value8 = !value7;
r4 = value7 ? value8 : a0.attachments.every(_fun83674);
r0 = value7 ? value8 : !r4;
r0 = r0 && a0.attachments.every(_fun83675);
r0 = value7 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.attachments.length})} : r4 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX,
{count: a0.attachments.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.attachments.length})} : {'type': 'text', 'text': null, 'trailingIcon': 'attachment',
text: intl.formatToPlainString(t['89ihS8'], {count: a0.attachments.length})};
return r0;
}
length = a0.embeds.length;
if (length > 0) {
value2 = a0.embeds.every(_fun83676);
value3 = !value2;
r5 = value2 ? value3 : a0.embeds.every(_fun83677);
r0 = value2 ? value3 : !r5;
r0 = r0 && a0.embeds.every(_fun83678);
r0 = value2 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.embeds.length})} : r5 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.embeds.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.embeds.length})} : a0.embeds.length > 0 && a0.embeds[0].rawTitle != null ? {type: 'markup',
markup: a0.embeds[0].rawTitle} : a0.embeds.length > 0 && a0.embeds[0].rawDescription != null ? {type: 'markup',
markup: a0.embeds[0].rawDescription} : {'type': 'text', 'text': null, 'trailingIcon': 'link',
text: intl.formatToPlainString(t['9XuYjs'], {count: a0.embeds.length})};
return r0;
}
length = a0.stickerItems.length;
if (length > 0) {
return {'type': 'text', 'text': null, 'trailingIcon': 'sticker', text: a0.stickerItems[0].name};
}
if (a0.isPoll()) {
value = undefined;
formatToPlainString = intl.formatToPlainString;
ImizdM = t.ImizdM;
poll = a0.poll;
return {type: 'text', text: Reflect.apply(formatToPlainString, intl, [ImizdM,
{question: poll == null ? value : poll.question.text}])};
}
if ((importDefault(4845) /* metro dependency 4845: isForwardMessage */)(a0)) {
object = {type: 'text'};
object.text = intl.string(t['9ddYKt']);
return object;
}
return undefined;
}
content = a0.content;
if (content !== '') {
return {type: 'message', message: a0};
}
hasFlag = a0.hasFlag;
value = environment.__proto__;
if (Reflect.apply(hasFlag, a0, [MessageFlags.IS_VOICE_MESSAGE])) {
return {type: 'text', text: intl.string(t.slFYgi)};
}
length = a0.attachments.length;
if (length > 0) {
value7 = a0.attachments.every(_fun83673);
value8 = !value7;
r4 = value7 ? value8 : a0.attachments.every(_fun83674);
r0 = value7 ? value8 : !r4;
r0 = r0 && a0.attachments.every(_fun83675);
r0 = value7 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.attachments.length})} : r4 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.attachments.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.attachments.length})} : {'type': 'text', 'text': null, 'trailingIcon': 'attachment',
text: intl.formatToPlainString(t['89ihS8'], {count: a0.attachments.length})};
return r0;
}
length = a0.embeds.length;
if (length > 0) {
value2 = a0.embeds.every(_fun83676);
value3 = !value2;
r5 = value2 ? value3 : a0.embeds.every(_fun83677);
r0 = value2 ? value3 : !r5;
r0 = r0 && a0.embeds.every(_fun83678);
r0 = value2 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.embeds.length})} : r5 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.embeds.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.embeds.length})} : a0.embeds.length > 0 && a0.embeds[0].rawTitle != null ? {type: 'markup',
markup: a0.embeds[0].rawTitle} : a0.embeds.length > 0 && a0.embeds[0].rawDescription != null ? {type: 'markup',
markup: a0.embeds[0].rawDescription} : {'type': 'text', 'text': null, 'trailingIcon': 'link',
text: intl.formatToPlainString(t['9XuYjs'], {count: a0.embeds.length})};
return r0;
}
length = a0.stickerItems.length;
if (length > 0) {
return {'type': 'text', 'text': null, 'trailingIcon': 'sticker', text: a0.stickerItems[0].name};
}
if (a0.isPoll()) {
value = undefined;
formatToPlainString = intl.formatToPlainString;
ImizdM = t.ImizdM;
poll = a0.poll;
return {type: 'text', text: Reflect.apply(formatToPlainString, intl, [ImizdM,
{question: poll == null ? value : poll.question.text}])};
}
if ((importDefault(4845) /* metro dependency 4845: isForwardMessage */)(a0)) {
object = {type: 'text'};
object.text = intl.string(t['9ddYKt']);
return object;
}
return undefined;
}
embeds = a0.embeds;
if (embeds[0].rawTitle != null) {
return {type: 'markup', markup: a0.embeds[0].rawTitle};
}
content = a0.content;
if (content == null) {
hasFlag = a0.hasFlag;
value = environment.__proto__;
if (Reflect.apply(hasFlag, a0, [MessageFlags.IS_VOICE_MESSAGE])) {
return {type: 'text', text: intl.string(t.slFYgi)};
}
length = a0.attachments.length;
if (length > 0) {
value7 = a0.attachments.every(_fun83673);
value8 = !value7;
r4 = value7 ? value8 : a0.attachments.every(_fun83674);
r0 = value7 ? value8 : !r4;
r0 = r0 && a0.attachments.every(_fun83675);
r0 = value7 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.attachments.length})} : r4 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.attachments.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.attachments.length})} : {'type': 'text', 'text': null, 'trailingIcon': 'attachment',
text: intl.formatToPlainString(t['89ihS8'], {count: a0.attachments.length})};
return r0;
}
length = a0.embeds.length;
if (length > 0) {
value2 = a0.embeds.every(_fun83676);
value3 = !value2;
r5 = value2 ? value3 : a0.embeds.every(_fun83677);
r0 = value2 ? value3 : !r5;
r0 = r0 && a0.embeds.every(_fun83678);
r0 = value2 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.embeds.length})} : r5 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.embeds.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.embeds.length})} : a0.embeds.length > 0 && a0.embeds[0].rawTitle != null ? {type: 'markup',
markup: a0.embeds[0].rawTitle} : a0.embeds.length > 0 && a0.embeds[0].rawDescription != null ? {type: 'markup',
markup: a0.embeds[0].rawDescription} : {'type': 'text', 'text': null, 'trailingIcon': 'link',
text: intl.formatToPlainString(t['9XuYjs'], {count: a0.embeds.length})};
return r0;
}
length = a0.stickerItems.length;
if (length > 0) {
return {'type': 'text', 'text': null, 'trailingIcon': 'sticker', text: a0.stickerItems[0].name};
}
if (a0.isPoll()) {
value = undefined;
formatToPlainString = intl.formatToPlainString;
ImizdM = t.ImizdM;
poll = a0.poll;
return {type: 'text', text: Reflect.apply(formatToPlainString, intl, [ImizdM,
{question: poll == null ? value : poll.question.text}])};
}
if ((importDefault(4845) /* metro dependency 4845: isForwardMessage */)(a0)) {
object = {type: 'text'};
object.text = intl.string(t['9ddYKt']);
return object;
}
return undefined;
}
content = a0.content;
if (content !== '') {
return {type: 'message', message: a0};
}
hasFlag = a0.hasFlag;
value = environment.__proto__;
if (Reflect.apply(hasFlag, a0, [MessageFlags.IS_VOICE_MESSAGE])) {
return {type: 'text', text: intl.string(t.slFYgi)};
}
length = a0.attachments.length;
if (length > 0) {
value7 = a0.attachments.every(_fun83673);
value8 = !value7;
r4 = value7 ? value8 : a0.attachments.every(_fun83674);
r0 = value7 ? value8 : !r4;
r0 = r0 && a0.attachments.every(_fun83675);
r0 = value7 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.attachments.length})} : r4 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.attachments.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.attachments.length})} : {'type': 'text', 'text': null, 'trailingIcon': 'attachment',
text: intl.formatToPlainString(t['89ihS8'], {count: a0.attachments.length})};
return r0;
}
embeds = a0.embeds;
length = embeds.length;
if (length > 0) {
value2 = a0.embeds.every(_fun83676);
value3 = !value2;
r5 = value2 ? value3 : a0.embeds.every(_fun83677);
r0 = value2 ? value3 : !r5;
r0 = r0 && a0.embeds.every(_fun83678);
r0 = value2 ? {'type': 'text', 'text': null, 'trailingIcon': 'image',
text: intl.formatToPlainString(t.h4pFfU,
{count: a0.embeds.length})} : r5 ? {'type': 'text', 'text': null, 'trailingIcon': 'video',
text: intl.formatToPlainString(t.SJ6pPX, {count: a0.embeds.length})} : r0 ? {'type': 'text',
'text': null,
'trailingIcon': 'audio', text: intl.formatToPlainString(t.fnO3hK,
{count: a0.embeds.length})} : a0.embeds.length > 0 && a0.embeds[0].rawTitle != null ? {type: 'markup',
markup: a0.embeds[0].rawTitle} : a0.embeds.length > 0 && a0.embeds[0].rawDescription != null ? {type: 'markup',
markup: a0.embeds[0].rawDescription} : {'type': 'text', 'text': null, 'trailingIcon': 'link',
text: intl.formatToPlainString(t['9XuYjs'], {count: a0.embeds.length})};
return r0;
}
length = a0.stickerItems.length;
if (length > 0) {
return {'type': 'text', 'text': null, 'trailingIcon': 'sticker', text: a0.stickerItems[0].name};
}
if (a0.isPoll()) {
value = undefined;
formatToPlainString = intl.formatToPlainString;
ImizdM = t.ImizdM;
poll = a0.poll;
return {type: 'text', text: Reflect.apply(formatToPlainString, intl, [ImizdM,
{question: poll == null ? value : poll.question.text}])};
}
if ((importDefault(4845) /* metro dependency 4845: isForwardMessage */)(a0)) {
object = {type: 'text'};
object.text = intl.string(t['9ddYKt']);
return object;
}
}
function _fun83673({filename}) { // fn#83673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:1162, offset: 0x01f2472c, size: 47 bytes, params: 2, frame: 11
const value = environment.__proto__.__proto__;
return (MediaFormatTestersModule).isImageFile(filename);
}
function _fun83674({filename}) { // fn#83674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:1226, offset: 0x01f2475b, size: 47 bytes, params: 2, frame: 11
const value = environment.__proto__.__proto__;
return (MediaFormatTestersModule).isVideoFile(filename);
}
function _fun83675({filename}) { // fn#83675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:1294, offset: 0x01f2478a, size: 47 bytes, params: 2, frame: 11
const value = environment.__proto__.__proto__;
return (MediaFormatTestersModule).isAudioFile(filename);
}
function _fun83676(a0) { // fn#83676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:1876, offset: 0x01f247b9, size: 60 bytes, params: 2, frame: 13
var r0;
let value = a0.url != null;
if (value) {
value = environment.__proto__.__proto__;
value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
value = value.isImageUrl(a0.url);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun83677(a0) { // fn#83677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:1942, offset: 0x01f247f5, size: 60 bytes, params: 2, frame: 13
var r0;
let value = a0.url != null;
if (value) {
value = environment.__proto__.__proto__;
value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
value = value.isVideoUrl(a0.url);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun83678(a0) { // fn#83678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:2012, offset: 0x01f24831, size: 60 bytes, params: 2, frame: 13
var r0;
let value = a0.url != null;
if (value) {
value = environment.__proto__.__proto__;
value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
value = value.isAudioFile(a0.url);
r0 = value;
} else {
r0 = value;
}
return r0;
}
}
}
function useFormattedMessagePreview(a0, a1) { // fn#83679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:6260, offset: 0x01f2486d, size: 434 bytes, params: 3, frame: 27
var r9;
var intl;
const env0_0 = a0;
const useStateFromStoresObject = FluxModule.useStateFromStoresObject;
let id = a0.author.id;
const {isBlocked, isIgnored} = Reflect.apply(useStateFromStoresObject, FluxModule, [[RelationshipStore], _fun83680,
[id]]);
const value3 = (UseIsCallActive)(a1.id, a0.id);
id = FluxModule.useStateFromStores([AuthenticationStore], function() {
return AuthenticationStore.getId();
});
const nick = (UseMessageAuthor)(a0).nick;
const type = a0.type;
const MessageTypes = (MessageTypesModule).MessageTypes;
const USER_JOIN = MessageTypes.USER_JOIN;
if (type === USER_JOIN) {
r9 = nick;
} else if (a0.author.id !== id) {
r9 = nick;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r9 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.LuZzxn);
}
const value5 = FluxModule.useStateFromStores([UserStore], _fun83682);
const useNullableUserAuthor = UseMessageAuthorModule.useNullableUserAuthor;
return formatMessagePreview(a0, {message: a0, channel: a1, currentUserId: id, authorNick: r9, otherUser: value5,
otherUserNick: Reflect.apply(useNullableUserAuthor, UseMessageAuthorModule, [value5, a1]).nick,
isBlocked: isBlocked, isIgnored: isIgnored, isCallActive: value3});
function _fun83680() { // fn#83680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:6345, offset: 0x01f24a1f, size: 72 bytes, params: 1, frame: 13
const relationshipStoreBinding = RelationshipStore;
const isBlocked = relationshipStoreBinding.isBlocked;
const binding = env0_0;
return {isBlocked: Reflect.apply(isBlocked, relationshipStoreBinding, [binding.author.id]),
isIgnored: relationshipStoreBinding.isIgnored(binding.author.id)};
}
function _fun83682() { // fn#83682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11105:6689, offset: 0x01f24a67, size: 63 bytes, params: 1, frame: 13
return env0_0.mentions.length > 0 ? UserStore.getUser(env0_0.mentions[0]) : undefined;
}
}
}
global.__d(_fun83669, 10919, [1226, 3793, 1878, 661, 671, 566, 8214, 4634, 1244, 4631, 4845, 22, 8233, 8319,
2]) /* metro module 10919, dependencies: [1226, 3793, 1878, 661, 671, 566, 8214, 4634, 1244, 4631, 4845, 22, 8233, 8319, 2] */;