111 lines
5.7 KiB
TypeScript
111 lines
5.7 KiB
TypeScript
/* Metro module 7222; source: modules/media_uploads/uploadMessageAttachments.native.tsx; dependencies: [5, 7223, 7224, 4625, 694, 2] */
|
|
function _fun57764(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:6, offset: 0x016b5961, size: 171 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const uploadStore = importDefault(7223) /* metro dependency 7223: UploadStore */;
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media_uploads/uploadMessageAttachments.native.tsx');
|
|
exports.uploadMessageAttachments = function() {
|
|
return _uploadMessageAttachments.apply(this, arguments);
|
|
};
|
|
}
|
|
|
|
function _uploadMessageAttachments() { // fn#57765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:126, offset: 0x016b5a0c, size: 48 bytes, params: 1, frame: 14
|
|
return env0_3(_fun57767).apply(this, arguments);
|
|
}
|
|
|
|
async function _fun57767({channelId, message, nonce, items, shouldUploadFailureSendNotification}) { // fn#57767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:199, offset: 0x016b5a4e, size: 410 bytes, params: 2, frame: 21
|
|
var environment;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
let binding = env2_5;
|
|
if (binding.has(nonce)) {
|
|
return undefined;
|
|
}
|
|
binding = env2_1;
|
|
const binding2 = env2_2;
|
|
const value6 = new binding(binding2[2])();
|
|
const id = value6._file.id;
|
|
const value8 = 'pending-upload-' + id;
|
|
value = env2_0(binding2[3]);
|
|
const createMessageRecord = value.createMessageRecord;
|
|
const object2 = {};
|
|
copyDataProperties(object2, message, id);
|
|
object2['key'] = value8;
|
|
const env0_4 = Reflect.apply(createMessageRecord, value, [object2]);
|
|
value6.on('start', _fun57768);
|
|
value6.on('compression-progress', _fun57769);
|
|
value6.on('progress', _fun57770);
|
|
value6.on('error', _fun57771);
|
|
value6.on('complete', _fun57772);
|
|
value6.on('cancel-upload-item', _fun57774);
|
|
await value6.uploadFiles(items);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
return {attachments: value, uploader: value6};
|
|
}
|
|
|
|
function _fun57768(a0) { // fn#57768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:419, offset: 0x016b5be8, size: 101 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
const binding = env3_5;
|
|
binding.add(nonce);
|
|
env3_1(env3_2[4]).dispatch({type: 'UPLOAD_START', channelId: channelId, file: a0, uploader: env0_3,
|
|
message: env0_4});
|
|
}
|
|
|
|
function _fun57769(a0) { // fn#57769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:544, offset: 0x016b5c4d, size: 68 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
env3_1(env3_2[4]).dispatch({type: 'UPLOAD_COMPRESSION_PROGRESS', channelId: channelId, file: a0});
|
|
}
|
|
|
|
function _fun57770(a0) { // fn#57770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:642, offset: 0x016b5c91, size: 68 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
env3_1(env3_2[4]).dispatch({type: 'UPLOAD_PROGRESS', channelId: channelId, file: a0});
|
|
}
|
|
|
|
function _fun57771(a0) { // fn#57771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:725, offset: 0x016b5cd5, size: 120 bytes, params: 2, frame: 14
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
env3_5.delete(nonce);
|
|
env0_3.cancel();
|
|
env3_1(env3_2[4]).dispatch({type: 'UPLOAD_FAIL', channelId: channelId, file: a0, messageId: env0_4.id,
|
|
shouldSendNotification: shouldUploadFailureSendNotification});
|
|
}
|
|
|
|
function _fun57772(a0) { // fn#57772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:870, offset: 0x016b5d4d, size: 201 bytes, params: 2, frame: 17
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
env3_5.delete(nonce);
|
|
const messageForFile = env3_4.getMessageForFile(a0.id);
|
|
if (messageForFile != null && messageForFile.content === '' && env0_3._aborted) {
|
|
value = env3_1(env3_2[4]);
|
|
value.dispatch({type: 'MESSAGE_DELETE', id: messageForFile.nonce ?? messageForFile.id,
|
|
channelId: messageForFile.channel_id});
|
|
}
|
|
if (env0_3._aborted) {
|
|
global.setTimeout(_fun57773, 0);
|
|
}
|
|
}
|
|
|
|
function _fun57774(a0) { // fn#57774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:1187, offset: 0x016b5e65, size: 68 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
env3_1(env3_2[4]).dispatch({type: 'UPLOAD_FILE_UPDATE', file: a0, channelId: channelId});
|
|
}
|
|
|
|
function _fun57773() { // fn#57773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7400:1074, offset: 0x016b5e16, size: 79 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
env4_1(env4_2[4]).dispatch({type: 'UPLOAD_COMPLETE', channelId: channelId, file: env0_0, aborted: true});
|
|
}
|
|
|