decord/source/modules/threads/native/useCreateThread.tsx

135 lines
4.7 KiB
TypeScript
Raw Normal View History

2026-08-14 17:33:39 +00:00
// Module ID: 9964
// Function ID: 9965
2026-07-20 16:05:17 +00:00
// Name: useCreateThread
2026-08-14 17:33:39 +00:00
// Dependencies: [5, 19, 4703, 4335, 5789, 8424, 6986, 7210, 8428, 8427, 7365, 4960, 4919, 8429, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, useCreateForumPost
2026-08-14 17:33:39 +00:00
// Module 9964 (useCreateThread)
2026-07-23 10:11:24 +00:00
import getIsPrivate from "getIsPrivate";
2026-07-29 08:29:29 +00:00
import noop from "noop";
import { DraftType } from "handleChanged";
2026-07-23 10:11:24 +00:00
import { MessageSendLocation } from "MESSAGE_GROUP_SPACING";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("handleChanged").fileFinishedImporting("modules/threads/native/useCreateThread.tsx");
2026-07-20 16:05:17 +00:00
export default function useCreateThread(arg0) {
let _location;
let onThreadCreated;
let parentChannel;
let parentMessageId;
let privateThreadMode;
let threadSettings;
let useDefaultThreadName;
2026-07-29 08:29:29 +00:00
let analyticsLocations;
2026-07-20 16:05:17 +00:00
({ parentChannel, parentMessageId, threadSettings, privateThreadMode, location: _location, onThreadCreated, useDefaultThreadName } = arg0);
2026-08-14 17:33:39 +00:00
analyticsLocations = importDefault(5789)().analyticsLocations;
let obj = analyticsLocations(8424);
2026-07-20 16:05:17 +00:00
obj = {
parentChannel,
parentMessageId,
threadSettings,
privateThreadMode,
location: _location,
onThreadCreated,
useDefaultThreadName,
uploadHandler(id, attachmentsToUpload) {
2026-07-23 10:11:24 +00:00
let closure_0 = id;
let closure_1 = attachmentsToUpload;
let obj = outer1_1(outer1_2[6]);
2026-07-20 16:05:17 +00:00
obj = {
2026-07-23 10:11:24 +00:00
location: outer1_6.THREAD_CREATION,
2026-07-20 16:05:17 +00:00
attachmentsToUpload,
onAttachmentUploadError(file, code, reason) {
2026-07-23 10:11:24 +00:00
let obj = analyticsLocations(outer2_2[8]);
obj = { file, guildId: guildId.getGuildId(), analyticsLocations: guildId, code, reason };
2026-07-20 16:05:17 +00:00
if (obj.handleUploadMessageAttachmentsErrors(obj)) {
2026-07-29 08:29:29 +00:00
obj = { channelId: null, uploads: null, draftType: null, resetState: true };
obj[0] = guildId.id;
obj[1] = closure_1;
obj[2] = outer2_5.FirstThreadMessage;
2026-07-23 10:11:24 +00:00
outer2_1(outer2_2[9]).setUploads(obj);
const obj3 = outer2_1(outer2_2[9]);
2026-07-20 16:05:17 +00:00
}
}
};
2026-07-23 10:11:24 +00:00
obj.sendMessage(id.id, outer1_1(outer1_2[7]).parse(id, arg2), undefined, obj);
2026-07-20 16:05:17 +00:00
}
};
return obj.useCreateThreadCommon(obj);
};
export const useCreateForumPost = function useCreateForumPost(parentChannel) {
let appliedTags;
let onThreadCreated;
parentChannel = parentChannel.parentChannel;
2026-07-29 08:29:29 +00:00
let _require = parentChannel;
2026-07-20 16:05:17 +00:00
const threadSettings = parentChannel.threadSettings;
2026-07-29 08:29:29 +00:00
let analyticsLocations;
2026-07-20 16:05:17 +00:00
({ appliedTags, onThreadCreated } = parentChannel);
2026-08-14 17:33:39 +00:00
analyticsLocations = analyticsLocations(5789)().analyticsLocations;
2026-07-29 08:29:29 +00:00
_require = undefined;
_require = callback((arg0) => {
let closure_0 = arg0;
let c2 = 0;
let c3 = 0;
return (function*(arg0) {
2026-08-04 21:03:28 +00:00
let obj7 = tmp4;
obj7 = new analyticsLocations(outer2_2[10])();
const kestrelConfig = guildId(outer2_2[11]).getKestrelConfig({ location: "native.useCreateForumPost" });
const obj8 = guildId(outer2_2[11]);
const maxFileSizeResult = guildId(outer2_2[12]).maxFileSize(guildId.getGuildId());
const obj9 = guildId(outer2_2[12]);
obj7.on("progress", (currentSize) => {
if (currentSize.currentSize > c3) {
obj7.cancel();
2026-08-14 17:33:39 +00:00
let obj = outer2_1(8427);
2026-08-04 21:03:28 +00:00
obj = { channelId: null, uploads: null, draftType: null, resetState: true };
obj[0] = guildId.id;
obj[1] = guildId;
obj[2] = outer2_5.FirstThreadMessage;
obj.setUploads(obj);
obj = { file: null, maxSize: null, baseMaxSize: null, guildId: null, analyticsLocations: null };
obj[0] = currentSize;
obj[1] = tmp;
obj[2] = dependencyMap;
obj[3] = guildId.getGuildId();
obj[4] = obj7;
2026-08-14 17:33:39 +00:00
outer2_1(8429)(obj);
const tmp10 = outer2_1(8429);
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
});
let noop = yield obj7.uploadFiles(guildId);
let obj = { uploaderFile: null, files: null };
obj[0] = obj7._file;
obj[1] = noop;
return obj;
2026-07-29 08:29:29 +00:00
})();
});
2026-07-20 16:05:17 +00:00
const items = [analyticsLocations, parentChannel];
2026-07-29 08:29:29 +00:00
callback = React.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);
2026-08-14 17:33:39 +00:00
let obj = _require(8424);
2026-07-29 08:29:29 +00:00
obj = { parentChannel, name: null, appliedTags: null, analyticsLocations: null, onThreadCreated: null, upload: null };
let str;
if (threadSettings != null) {
str = threadSettings.name;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = str;
obj[2] = appliedTags;
obj[3] = analyticsLocations;
obj[4] = onThreadCreated;
obj[5] = callback;
2026-07-20 16:05:17 +00:00
return obj.useCreateForumPostCommon(obj);
};