decord/alpha/source/modules/messages/useDMMessageToReport.tsx

137 lines
4.6 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 12285
// Function ID: 12286
2026-07-20 16:05:17 +00:00
// Name: useDMMessageToReport
2026-10-09 10:00:15 +00:00
// Dependencies: [558, 576, 12286, 12287, 12288, 12124, 12289, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 12285 (useDMMessageToReport)
2026-10-03 08:58:59 +00:00
import react from "react" /* 576 */;
2026-10-09 10:00:15 +00:00
import useLongestChannelMessageBeforeReply from "useLongestChannelMessageBeforeReply" /* 12124 */;
import useIsRelationshipTypeSpamReportable from "useIsRelationshipTypeSpamReportable" /* 12286 */;
import getApplicationFromBotUserIdDefault from "getApplicationFromBotUserId" /* 12287 */;
import useMessageRequestPreview from "useMessageRequestPreview" /* 12289 */;
2026-10-03 08:58:59 +00:00
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
2026-10-03 08:58:59 +00:00
let tmp5;
2026-10-09 10:00:15 +00:00
const useIsOwnedConjureApplicationDefault = tmp5(12288);
2026-10-08 09:57:35 +00:00
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useDMMessageToReport(id, arg1, arg2) {
2026-10-03 08:58:59 +00:00
let error;
let loaded;
let message;
2026-10-09 10:00:15 +00:00
let tmp14;
2026-10-03 08:58:59 +00:00
const obj = react;
const cResult = obj.c(6);
const obj2 = useIsRelationshipTypeSpamReportable;
let isRelationshipTypeSpamReportable = obj2.useIsRelationshipTypeSpamReportable(arg1);
let tmp7 = null;
const tmp6 = getApplicationFromBotUserIdDefault;
if (arg2) {
tmp7 = arg1;
}
const tmp6Result = tmp6(tmp7);
2026-10-09 10:00:15 +00:00
useIsOwnedConjureApplicationDefault;
2026-10-03 08:58:59 +00:00
if (arg2) {
id = undefined;
if (tmp6Result != null) {
id = tmp6Result.id;
}
if (id == null) {
id = arg1;
}
}
if (arg2) {
2026-10-09 10:00:15 +00:00
isRelationshipTypeSpamReportable = true !== tmp12;
2026-10-03 08:58:59 +00:00
}
const tmpResult = useLongestChannelMessageBeforeReply;
let longestChannelMessageBeforeReply = tmpResult.useLongestChannelMessageBeforeReply(id.id, arg1);
if (cResult[0] !== isRelationshipTypeSpamReportable) {
const obj3 = { enabled: isRelationshipTypeSpamReportable };
cResult[0] = isRelationshipTypeSpamReportable;
cResult[1] = obj3;
2026-10-09 10:00:15 +00:00
tmp14 = obj3;
2026-10-03 08:58:59 +00:00
} else {
2026-10-09 10:00:15 +00:00
tmp14 = cResult[1];
2026-10-03 08:58:59 +00:00
}
const tmpResult2 = useMessageRequestPreview;
2026-10-09 10:00:15 +00:00
const messageRequestPreview = tmpResult2.useMessageRequestPreview(id, tmp14);
2026-10-03 08:58:59 +00:00
({ message, loaded, error } = messageRequestPreview);
if (longestChannelMessageBeforeReply == null) {
let id1;
if (message != null) {
const author = message.author;
if (author != null) {
id1 = author.id;
}
}
2026-10-09 10:00:15 +00:00
let tmp17 = null;
2026-10-03 08:58:59 +00:00
if (id1 === arg1) {
2026-10-09 10:00:15 +00:00
tmp17 = message;
2026-10-03 08:58:59 +00:00
}
2026-10-09 10:00:15 +00:00
longestChannelMessageBeforeReply = tmp17;
2026-10-03 08:58:59 +00:00
}
if (cResult[2] === (null != longestChannelMessageBeforeReply || loaded || error)) {
if (cResult[3] === isRelationshipTypeSpamReportable) {
2026-10-09 10:00:15 +00:00
let tmp19;
2026-10-03 08:58:59 +00:00
if (cResult[4] === longestChannelMessageBeforeReply) {
2026-10-09 10:00:15 +00:00
tmp19 = cResult[5];
2026-10-03 08:58:59 +00:00
}
2026-10-09 10:00:15 +00:00
return tmp19;
2026-10-03 08:58:59 +00:00
}
}
const obj4 = { message: longestChannelMessageBeforeReply, isReportable: isRelationshipTypeSpamReportable, isLoaded: null != longestChannelMessageBeforeReply || loaded || error };
cResult[2] = null != longestChannelMessageBeforeReply || loaded || error;
cResult[3] = isRelationshipTypeSpamReportable;
cResult[4] = longestChannelMessageBeforeReply;
cResult[5] = obj4;
2026-10-09 10:00:15 +00:00
tmp19 = obj4;
2026-10-08 09:57:35 +00:00
}) : (function useDMMessageToReport(id, arg1, arg2) {
2026-10-03 08:58:59 +00:00
let error;
let loaded;
const obj = useIsRelationshipTypeSpamReportable;
let isRelationshipTypeSpamReportable = obj.useIsRelationshipTypeSpamReportable(arg1);
let tmp6 = null;
const tmp5 = getApplicationFromBotUserIdDefault;
if (arg2) {
tmp6 = arg1;
}
const tmp5Result = tmp5(tmp6);
2026-10-09 10:00:15 +00:00
useIsOwnedConjureApplicationDefault;
2026-10-03 08:58:59 +00:00
if (arg2) {
id = undefined;
if (tmp5Result != null) {
id = tmp5Result.id;
}
if (id == null) {
id = arg1;
}
}
if (arg2) {
2026-10-09 10:00:15 +00:00
isRelationshipTypeSpamReportable = true !== tmp11;
2026-10-03 08:58:59 +00:00
}
const tmpResult = useLongestChannelMessageBeforeReply;
const longestChannelMessageBeforeReply = tmpResult.useLongestChannelMessageBeforeReply(id.id, arg1);
const tmpResult2 = useMessageRequestPreview;
const messageRequestPreview = tmpResult2.useMessageRequestPreview(id, { enabled: isRelationshipTypeSpamReportable });
const message = messageRequestPreview.message;
2026-10-09 10:00:15 +00:00
let tmp14 = longestChannelMessageBeforeReply;
2026-07-20 16:05:17 +00:00
({ loaded, error } = messageRequestPreview);
2026-07-29 08:29:29 +00:00
if (longestChannelMessageBeforeReply == null) {
2026-10-03 08:58:59 +00:00
let id1;
2026-07-29 08:29:29 +00:00
if (message != null) {
2026-07-20 16:05:17 +00:00
const author = message.author;
2026-07-29 08:29:29 +00:00
if (author != null) {
2026-10-03 08:58:59 +00:00
id1 = author.id;
2026-07-20 16:05:17 +00:00
}
}
2026-10-09 10:00:15 +00:00
let tmp16 = null;
2026-10-03 08:58:59 +00:00
if (id1 === arg1) {
2026-10-09 10:00:15 +00:00
tmp16 = message;
2026-07-20 16:05:17 +00:00
}
2026-10-09 10:00:15 +00:00
tmp14 = tmp16;
2026-07-20 16:05:17 +00:00
}
2026-10-09 10:00:15 +00:00
return { message: tmp14, isReportable: isRelationshipTypeSpamReportable, isLoaded: null != tmp14 || loaded || error };
2026-10-03 08:58:59 +00:00
});
const result = size.fileFinishedImporting("modules/messages/useDMMessageToReport.tsx");
export const useDMMessageToReport = tmp2;