decord/source/modules/messages/native/renderer/createMessageFailedEmbed.tsx

65 lines
3 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 8411
// Function ID: 8412
2026-07-20 16:05:17 +00:00
// Name: createMessageFailedEmbed
2026-08-25 06:04:03 +00:00
// Dependencies: [8193, 676, 8206, 8412, 1236, 8413, 4959, 2]
2026-07-20 16:05:17 +00:00
// Exports: createAutomodBlockedMessageEmbed, default
2026-08-25 06:04:03 +00:00
// Module 8411 (createMessageFailedEmbed)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import ME from "ME" /* 676 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
2026-08-25 06:04:03 +00:00
import Changeset from "Changeset" /* 8193 */;
import frozen from "frozen" /* 8206 */;
import registerAssetDefault from "registerAsset" /* 8412 */;
import registerAssetDefault2 from "registerAsset" /* 8413 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const MessageFailureState = Changeset.MessageFailureState;
const MessageEmbedTypes = ME.MessageEmbedTypes;
const result = set.fileFinishedImporting("modules/messages/native/renderer/createMessageFailedEmbed.tsx");
2026-07-20 16:05:17 +00:00
export default function createMessageFailedEmbed(useAttachmentUploadPreview) {
({ uploaderFile, colors } = useAttachmentUploadPreview);
if (null != uploaderFile) {
if (useAttachmentUploadPreview.useAttachmentUploadPreview) {
2026-07-29 08:29:29 +00:00
let obj = { type: null, messageSendError: null, failureState: null, disableBackgroundColor: true, bodyTextColor: null, iconURL: null };
obj[0] = MessageEmbedTypes.TEXT;
2026-08-24 06:08:38 +00:00
const intl3 = getSystemLocale.intl;
obj[1] = intl3.string(getSystemLocale.t.lBLP4u);
2026-07-29 08:29:29 +00:00
obj[2] = MessageFailureState.UNSPECIFIED;
obj[4] = colors.failedMessageBodyTextColor;
2026-08-24 06:08:38 +00:00
colors = frozen.getAssetUriForEmbed;
obj[5] = colors(registerAssetDefault2);
const tmp14 = frozen;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { type: null, numAttachments: null, failureState: null, attachmentsSize: null, bodyTextColor: null };
obj[0] = MessageEmbedTypes.TEXT;
2026-08-24 06:08:38 +00:00
const intl2 = getSystemLocale.intl;
obj1 = { count: null };
2026-07-29 08:29:29 +00:00
obj1[0] = uploaderFile.attachmentsCount;
2026-08-24 06:08:38 +00:00
obj[1] = intl2.formatToPlainString(getSystemLocale.t.D0noUt, obj1);
2026-07-29 08:29:29 +00:00
obj[2] = MessageFailureState.UPLOAD_FAILED;
2026-07-20 16:05:17 +00:00
let str = "";
if (0 !== uploaderFile.currentSize) {
const _HermesInternal = HermesInternal;
2026-08-25 06:04:03 +00:00
str = " (" + tmp6(4959).sizeString(uploaderFile.currentSize) + ")";
const tmp6Result = tmp6(4959);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = "" + str;
obj[4] = colors.embedBodyTextColor;
tmp6 = require;
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
obj = { type: null, messageSendError: null, failureState: null, disableBackgroundColor: true, bodyTextColor: null };
obj[0] = MessageEmbedTypes.TEXT;
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[1] = intl.string(getSystemLocale.t.lBLP4u);
2026-07-29 08:29:29 +00:00
obj[2] = MessageFailureState.UNSPECIFIED;
obj[4] = colors.failedMessageBodyTextColor;
2026-07-20 16:05:17 +00:00
return obj;
}
};
export const createAutomodBlockedMessageEmbed = function createAutomodBlockedMessageEmbed(errorMessage) {
2026-08-24 06:08:38 +00:00
const obj = { type: MessageEmbedTypes.TEXT, messageSendError: errorMessage.errorMessage, failureState: MessageFailureState.AUTO_MODERATION_BLOCKED_MESSAGE, disableBackgroundColor: true, bodyTextColor: errorMessage.colors.automodBlockedBodyTextColor, iconURL: frozen.getAssetUriForEmbed(registerAssetDefault) };
2026-07-20 16:05:17 +00:00
return obj;
};