Files
2026-07-28 01:06:53 +03:00

126 lines
8.7 KiB
TypeScript

/* Metro module 11010; source: modules/threads/native/useCreateThread.tsx; dependencies: [5, 31, 4645, 4503, 6771, 7876, 7067, 7076, 7880, 7879, 7224, 4697, 4655, 7881, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
import MessageActionCreators from '../../../actions/MessageActionCreators.tsx'; /* Metro dependency 7067 */
import MessageParser from '../../messages/MessageParser.tsx'; /* Metro dependency 7076 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as MessageConstantsModule from '../../messages/MessageConstants.tsx'; /* Metro dependency 4503 */
import * as DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import * as ThreadCreationHooksModule from '../ThreadCreationHooks.tsx'; /* Metro dependency 7876 */
import * as HandleUploadAttachmentErrorsNativeModule from '../../media_uploads/handleUploadAttachmentErrors.native.tsx'; /* Metro dependency 7880 */
function _fun84350(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:6, offset: 0x01f46ada, size: 194 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/threads/native/useCreateThread.tsx');
exports.default = useCreateThread;
exports.useCreateForumPost = useCreateForumPost;
function useCreateThread({parentChannel, parentMessageId, threadSettings, privateThreadMode, location, onThreadCreated, useDefaultThreadName}) { // fn#84351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:253, offset: 0x01f46b9c, size: 162 bytes, params: 2, frame: 21
const env0_0 = (UseAnalyticsLocations)().analyticsLocations;
return (ThreadCreationHooksModule).useCreateThreadCommon({parentChannel: parentChannel,
parentMessageId: parentMessageId, threadSettings: threadSettings, privateThreadMode: privateThreadMode,
location: location, onThreadCreated: onThreadCreated, useDefaultThreadName: useDefaultThreadName,
uploadHandler: uploadHandler});
function uploadHandler(a0, a1, a2) { // fn#84352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:614, owner: useCreateThread.uploadHandler, offset: 0x01f46c3e, size: 129 bytes, params: 4, frame: 22
const env0_0 = a0;
const env0_1 = a1;
const defaultImport = MessageActionCreators;
const sendMessage = defaultImport.sendMessage;
const id = a0.id;
const value2 = (MessageParser).parse(a0, a2);
const THREAD_CREATION = MessageSendLocation.THREAD_CREATION;
Reflect.apply(sendMessage, defaultImport, [id, value2, undefined, {location: THREAD_CREATION,
attachmentsToUpload: a1, onAttachmentUploadError: onAttachmentUploadError}]);
function onAttachmentUploadError(a0, a1, a2) { // fn#84353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:749, owner: useCreateThread.uploadHandler.onAttachmentUploadError, offset: 0x01f46cbf, size: 176 bytes, params: 4, frame: 16
const handleUploadMessageAttachmentsErrors = HandleUploadAttachmentErrorsNativeModule.handleUploadMessageAttachmentsErrors;
const object = {file: a0};
object.guildId = env0_0.getGuildId();
object.analyticsLocations = analyticsLocations;
object.code = a1;
object.reason = a2;
if (Reflect.apply(handleUploadMessageAttachmentsErrors, HandleUploadAttachmentErrorsNativeModule, [object])) {
(importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */).setUploads({channelId: env0_0.id,
uploads: require, draftType: DraftType.FirstThreadMessage, resetState: true});
}
}
}
}
function useCreateForumPost({parentChannel, threadSettings, appliedTags, onThreadCreated}) { // fn#84354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:995, offset: 0x01f46d6f, size: 198 bytes, params: 2, frame: 22
const analyticsLocations = (UseAnalyticsLocations)().analyticsLocations;
return (require(7876) /* metro dependency 7876: ThreadCreationHooks */).useCreateForumPostCommon({parentChannel: parentChannel,
name: threadSettings?.name ?? '', appliedTags: appliedTags, analyticsLocations: analyticsLocations,
onThreadCreated: onThreadCreated, upload: ReactModule.useCallback(_fun84355(), [analyticsLocations, parentChannel])});
function _fun84355() { // fn#84355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:1144, offset: 0x01f46e35, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_3(_fun84357);
return _fun84359;
function* _fun84357(a0) { // fn#84357, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:1164, offset: 0x01f46e64, size: 251 bytes, params: 2, frame: 21
var environment;
if (false) {
return undefined;
}
const env0_0 = a0;
value = environment.__proto__.__proto__.__proto__;
let binding = env3_1;
const binding2 = env3_2;
const value5 = new binding(binding2[10])();
binding = env3_0;
value = binding(binding2[11]);
value = value.getKestrelConfig({location: 'native.useCreateForumPost'});
const value7 = binding(binding2[11]);
const getEffectiveKestrelLimit = value7.getEffectiveKestrelLimit;
const value8 = binding(binding2[12]);
const maxFileSize = value8.maxFileSize;
const getGuildId = require.getGuildId;
const env0_2 = Reflect.apply(getEffectiveKestrelLimit, value7, [value, Reflect.apply(maxFileSize, value8,
[Reflect.apply(getGuildId, require, [])])]);
value5.on('progress', _fun84358);
yield value5.uploadFiles(a0);
value = undefined;
if (false) {
return value;
}
return {uploaderFile: value5._file, files: value};
function _fun84358(a0) { // fn#84358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:1358, offset: 0x01f46f5f, size: 168 bytes, params: 2, frame: 19
var binding;
var value2;
var binding2;
var value3;
var setUploads;
var value4;
if (a0.currentSize > env0_2) {
binding = env0_1;
binding.cancel();
value2 = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_1;
binding2 = env4_2;
value3 = binding(binding2[9]);
setUploads = value3.setUploads;
value4 = environment.__proto__.__proto__.__proto__;
Reflect.apply(setUploads, value3, [{channelId: require.id, uploads: env0_0,
draftType: env4_5.FirstThreadMessage,
resetState: true}]);
binding(binding2[13])({file: a0, maxSize: env0_2, analyticsLocations: importDefault});
}
}
}
function _fun84359() { // fn#84359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:1613, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
}
}
global.__d(_fun84350, 11010, [5, 31, 4645, 4503, 6771, 7876, 7067, 7076, 7880, 7879, 7224, 4697, 4655, 7881,
2]) /* metro module 11010, dependencies: [5, 31, 4645, 4503, 6771, 7876, 7067, 7076, 7880, 7879, 7224, 4697, 4655, 7881, 2] */;