2026-09-26 17:57:22 +00:00
|
|
|
// Module ID: 10552
|
|
|
|
|
// Function ID: 10553
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useCreateThread
|
2026-09-26 17:57:22 +00:00
|
|
|
// Dependencies: [5, 19, 5137, 4781, 7439, 9451, 7730, 7950, 9455, 9453, 8113, 5382, 5410, 9456, 2]
|
|
|
|
|
// Exports: default, useCreateForumPost
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
// Module 10552 (useCreateThread)
|
|
|
|
|
import useAnalyticsLocationsDefault from "useAnalyticsLocations" /* 7439 */;
|
|
|
|
|
import MessageActionCreatorsDefault from "MessageActionCreators" /* 7730 */;
|
|
|
|
|
import MessageParserDefault from "MessageParser" /* 7950 */;
|
|
|
|
|
import UploadAttachmentActionCreatorsDefault from "UploadAttachmentActionCreators" /* 9453 */;
|
|
|
|
|
import handleUploadAttachmentErrors from "handleUploadAttachmentErrors" /* 9455 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
|
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
|
|
|
|
|
|
const require = globalThis.__r;
|
|
|
|
|
|
|
|
|
|
require = fn;
|
2026-09-26 17:57:22 +00:00
|
|
|
const DraftType = fn(5137).DraftType;
|
|
|
|
|
const MessageSendLocation = fn(4781).MessageSendLocation;
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/threads/native/useCreateThread.tsx");
|
|
|
|
|
|
|
|
|
|
export default function useCreateThread(arg0) {
|
2026-09-18 19:45:33 +00:00
|
|
|
({ parentChannel, parentMessageId, threadSettings, privateThreadMode, location: _location, onThreadCreated, useDefaultThreadName } = arg0);
|
|
|
|
|
const analyticsLocations = useAnalyticsLocationsDefault().analyticsLocations;
|
2026-09-26 17:57:22 +00:00
|
|
|
return analyticsLocations(9451).useCreateThreadCommon({
|
2026-09-18 19:45:33 +00:00
|
|
|
parentChannel,
|
|
|
|
|
parentMessageId,
|
|
|
|
|
threadSettings,
|
|
|
|
|
privateThreadMode,
|
|
|
|
|
location: _location,
|
|
|
|
|
onThreadCreated,
|
|
|
|
|
useDefaultThreadName,
|
|
|
|
|
uploadHandler(id, attachmentsToUpload, arg2) {
|
|
|
|
|
const guildId = id;
|
|
|
|
|
const uploads = attachmentsToUpload;
|
|
|
|
|
let obj = MessageActionCreatorsDefault;
|
|
|
|
|
obj.sendMessage(id.id, MessageParserDefault.parse(id, arg2), undefined, {
|
|
|
|
|
location: constants.THREAD_CREATION,
|
|
|
|
|
attachmentsToUpload,
|
|
|
|
|
onAttachmentUploadError(file, code, reason) {
|
|
|
|
|
const obj = handleUploadAttachmentErrors;
|
|
|
|
|
if (obj.handleUploadMessageAttachmentsErrors(obj2)) {
|
|
|
|
|
const obj4 = { channelId: guildId.id, uploads, draftType: DraftType.FirstThreadMessage, resetState: true };
|
|
|
|
|
UploadAttachmentActionCreatorsDefault.setUploads(obj4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|
|
|
|
|
export const useCreateForumPost = function useCreateForumPost(parentChannel) {
|
2026-09-18 19:45:33 +00:00
|
|
|
parentChannel = parentChannel.parentChannel;
|
|
|
|
|
const threadSettings = parentChannel.threadSettings;
|
|
|
|
|
let analyticsLocations;
|
|
|
|
|
({ appliedTags, onThreadCreated } = parentChannel);
|
2026-09-26 17:57:22 +00:00
|
|
|
analyticsLocations = analyticsLocations(7439)().analyticsLocations;
|
2026-09-18 19:45:33 +00:00
|
|
|
_require = asyncGeneratorStep(async (arg0) => {
|
|
|
|
|
const guildId = arg0;
|
|
|
|
|
c2 = 0;
|
|
|
|
|
c3 = 0;
|
|
|
|
|
return (async (arg0) => {
|
|
|
|
|
analyticsLocations = tmp4;
|
|
|
|
|
closure_129_0 = guildId;
|
2026-09-26 17:57:22 +00:00
|
|
|
const obj7 = new analyticsLocations(8113)();
|
2026-09-18 19:45:33 +00:00
|
|
|
closure_129_1 = obj7;
|
2026-09-26 17:57:22 +00:00
|
|
|
const maxFileSizeResult = guildId(5382).maxFileSize(guildId.getGuildId());
|
2026-09-18 19:45:33 +00:00
|
|
|
closure_129_2 = maxFileSizeResult;
|
2026-09-26 17:57:22 +00:00
|
|
|
const effectiveUploadLimit = guildId(5410).getEffectiveUploadLimit(maxFileSizeResult);
|
2026-09-18 19:45:33 +00:00
|
|
|
obj7.on("progress", (currentSize) => {
|
|
|
|
|
if (currentSize.currentSize > closure_1_3) {
|
|
|
|
|
analyticsLocations.cancel();
|
|
|
|
|
const obj2 = { channelId: uploads.id, uploads, draftType: FirstThreadMessage.FirstThreadMessage, resetState: true };
|
2026-09-26 17:57:22 +00:00
|
|
|
analyticsLocations(9453).setUploads(obj2);
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj3 = { file: currentSize, maxSize: tmp, baseMaxSize, guildId: null, analyticsLocations: null };
|
2026-09-26 17:57:22 +00:00
|
|
|
const obj = analyticsLocations(9453);
|
2026-09-18 19:45:33 +00:00
|
|
|
obj3.guildId = uploads.getGuildId();
|
|
|
|
|
obj3.analyticsLocations = analyticsLocations;
|
2026-09-26 17:57:22 +00:00
|
|
|
analyticsLocations(9456)(obj3);
|
|
|
|
|
const tmp10 = analyticsLocations(9456);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
closure_129_4 = await obj7.uploadFiles(guildId);
|
|
|
|
|
return { uploaderFile: closure_129_1._file, files: closure_129_4 };
|
|
|
|
|
})();
|
|
|
|
|
});
|
|
|
|
|
const items = [analyticsLocations, parentChannel];
|
|
|
|
|
const callback = noop.useCallback(function() {
|
|
|
|
|
const self = this;
|
|
|
|
|
const apply = closure_0.apply;
|
|
|
|
|
if (typeof apply === "unknown") {
|
|
|
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
|
|
|
} else {
|
|
|
|
|
applyArgumentsResult = apply(self, arguments);
|
|
|
|
|
}
|
|
|
|
|
return applyArgumentsResult;
|
|
|
|
|
}, items);
|
|
|
|
|
let obj2 = { parentChannel, name: null, appliedTags: null, analyticsLocations: null, onThreadCreated: null, upload: null };
|
|
|
|
|
let str;
|
|
|
|
|
if (threadSettings != null) {
|
|
|
|
|
str = threadSettings.name;
|
|
|
|
|
}
|
|
|
|
|
if (str == null) {
|
|
|
|
|
str = "";
|
|
|
|
|
}
|
|
|
|
|
obj2.name = str;
|
|
|
|
|
obj2.appliedTags = appliedTags;
|
|
|
|
|
obj2.analyticsLocations = analyticsLocations;
|
|
|
|
|
obj2.onThreadCreated = onThreadCreated;
|
|
|
|
|
obj2.upload = callback;
|
|
|
|
|
return require("ThreadCreationHooks").useCreateForumPostCommon(obj2);
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|