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

115 lines
3.5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8358
// Function ID: 8359
2026-07-20 16:05:17 +00:00
// Name: nodeToText
2026-07-23 10:11:24 +00:00
// Dependencies: [2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 8358 (nodeToText)
import set from "set" /* 2 */;
2026-07-20 16:05:17 +00:00
function nodeToText(content) {
let str = "";
if (null != content) {
2026-08-04 21:03:28 +00:00
if (typeof content === "string") {
2026-07-20 16:05:17 +00:00
str = content;
} else {
const _Array = Array;
if (Array.isArray(content)) {
const mapped = content.map(nodeToText);
2026-07-29 08:29:29 +00:00
let str2 = mapped.join("");
2026-08-04 21:03:28 +00:00
} else if (typeof content.content === "string") {
2026-07-29 08:29:29 +00:00
str2 = content.content;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
str2 = "";
2026-07-20 16:05:17 +00:00
if (null != content.content) {
2026-07-29 08:29:29 +00:00
str2 = nodeToText(content.content);
2026-07-20 16:05:17 +00:00
}
}
}
}
return str;
}
2026-08-24 06:08:38 +00:00
const result = set.fileFinishedImporting("modules/messages/native/renderer/redactRestrictedContent.tsx");
2026-07-20 16:05:17 +00:00
function redactRestrictedContent(content) {
if (null != content) {
2026-08-04 21:03:28 +00:00
if (typeof content !== "string") {
2026-07-20 16:05:17 +00:00
const _Array = Array;
if (Array.isArray(content)) {
return content.map(redactRestrictedContent);
} else {
if ("link" !== content.type) {
if ("attachmentLink" !== content.type) {
if ("customEmoji" === content.type) {
2026-07-29 08:29:29 +00:00
let obj = { type: "text", content: null };
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
obj[1] = ":" + content.alt + ":";
2026-07-20 16:05:17 +00:00
return obj;
} else {
let tmp = content;
if (null != content.content) {
obj = {};
const merged = Object.assign(content);
2026-07-29 08:29:29 +00:00
obj.content = redactRestrictedContent(content.content);
2026-07-20 16:05:17 +00:00
tmp = obj;
}
let tmp6 = tmp;
if (null != content.items) {
obj = {};
const merged1 = Object.assign(tmp);
2026-07-29 08:29:29 +00:00
obj.items = redactRestrictedContent(content.items);
2026-07-20 16:05:17 +00:00
tmp6 = obj;
}
return tmp6;
}
}
}
2026-07-29 08:29:29 +00:00
content = content.content;
let str4 = "";
if (null != content) {
2026-08-04 21:03:28 +00:00
if (typeof content === "string") {
2026-07-29 08:29:29 +00:00
str4 = content;
} else {
const _Array2 = Array;
if (Array.isArray(content)) {
const mapped = content.map(nodeToText);
let str7 = mapped.join("");
2026-08-04 21:03:28 +00:00
} else if (typeof content.content === "string") {
2026-07-29 08:29:29 +00:00
str7 = content.content;
} else {
str7 = "";
if (null != content.content) {
const content1 = content.content;
let str5 = "";
if (null != content1) {
2026-08-04 21:03:28 +00:00
if (typeof content1 === "string") {
2026-07-29 08:29:29 +00:00
str5 = content1;
} else {
const _Array3 = Array;
if (Array.isArray(content1)) {
const mapped1 = content1.map(nodeToText);
let str6 = mapped1.join("");
2026-08-04 21:03:28 +00:00
} else if (typeof content1.content === "string") {
2026-07-29 08:29:29 +00:00
str6 = content1.content;
} else {
str6 = "";
if (null != content1.content) {
str6 = nodeToText(content1.content);
}
}
}
}
str7 = str5;
}
}
}
}
2026-08-24 06:08:38 +00:00
obj1 = { type: "inlineCode", content: null };
2026-07-29 08:29:29 +00:00
obj1[1] = str4;
2026-07-20 16:05:17 +00:00
return obj1;
}
}
}
return content;
}
export default redactRestrictedContent;