Files
discord-decomp/sources/modules/share/native/ShareUtils.tsx
T
2026-07-27 16:20:00 +03:00

108 lines
5.1 KiB
TypeScript

/* Metro module 12676; source: modules/share/native/ShareUtils.tsx; dependencies: [5, 4645, 4503, 3857, 9836, 7879, 7165, 4650, 4648, 7076, 7864, 7067, 2] */
function _fun97128(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12866:6, offset: 0x02173b51, size: 186 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const env0_5 = (require(4503) /* metro dependency 4503: MessageConstants */).MessageSendLocation;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/share/native/ShareUtils.tsx');
exports.showInformationToast = showInformationToast;
exports.sendShareMessage = function() {
return _sendShareMessage.apply(this, arguments);
};
}
function _sendShareMessage() { // fn#97129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12866:156, offset: 0x02173c0b, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun97131).apply(this, arguments);
}
function showInformationToast(a0) { // fn#97134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12866:1110, offset: 0x02173f0d, size: 91 bytes, params: 2, frame: 17
const value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
const open = value.open;
const object2 = {};
object2.key = 'INFORMATION_TOAST-' + a0;
object2.content = a0;
object2.icon = importDefault(9836) /* metro dependency 9836 */;
Reflect.apply(open, value, [object2]);
}
async function _fun97131({attachments, channel, comment}) { // fn#97131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12866:213, offset: 0x02173c51, size: 371 bytes, params: 2, frame: 24
var value8;
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
let id = channel.id;
value = attachments.map(_fun97132);
let binding = env2_1;
const value5 = binding(env2_2[9]);
const value7 = value5.parse(channel, comment ?? '');
if (value.length > 0) {
value8 = env2_1(env2_2[5]);
value8.clearAll(id, env2_4.ChannelMessage);
}
binding = env2_0;
const binding2 = env2_2;
const Future = binding(binding2[10]).Future;
const future = new Future();
const value11 = env2_1(binding2[11]);
const sendMessage = value11.sendMessage;
id = channel.id;
const SHARE_MODAL = env2_5.SHARE_MODAL;
await Reflect.apply(sendMessage, value11, [id, value7, false, {location: SHARE_MODAL, doNotNotifyOnError: true,
attachmentsToUpload: value, onAttachmentUploadError: onAttachmentUploadError_97133}]);
if (false) {
return undefined;
}
future.resolve(undefined);
return future.promise;
}
function _fun97132(a0) { // fn#97132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12866:280, offset: 0x02173dc4, size: 160 bytes, params: 2, frame: 15
const object2 = {};
object2.uri = a0.uri;
object2.originalUri = a0.uri;
object2.mimeType = a0.mimeType;
object2.filename = a0.name;
let value = environment.__proto__.__proto__.__proto__;
const binding = env3_0;
const binding2 = env3_2;
const UploadPlatform = binding(binding2[7]).UploadPlatform;
const REACT_NATIVE = UploadPlatform.REACT_NATIVE;
object2.platform = REACT_NATIVE;
object2.width = a0.width;
object2.height = a0.height;
const CloudUpload = binding(binding2[8]).CloudUpload;
const id = channel.id;
value = Object.create(CloudUpload.prototype, {constructor: {value: CloudUpload}});
const cloudUpload = new CloudUpload(object2, id);
return cloudUpload instanceof Object ? cloudUpload : value;
}
function onAttachmentUploadError_97133() { // fn#97133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12866:718, offset: 0x02173e64, size: 169 bytes, params: 1, frame: 21
let binding = env0_4;
binding.reject(undefined);
const object2 = {uploads: env0_3};
object2.channelId = id;
object2.comment = comment;
const uploads = object2.uploads;
const channelId = object2.channelId;
const comment2 = object2.comment;
binding = env3_1;
const binding2 = env3_2;
const value2 = binding(binding2[5]);
const setUploads = value2.setUploads;
let ChannelMessage = env3_4.ChannelMessage;
Reflect.apply(setUploads, value2, [{channelId: channelId, uploads: uploads, draftType: ChannelMessage,
resetState: true}]);
const value3 = binding(binding2[6]);
const saveDraft = value3.saveDraft;
ChannelMessage = env3_4.ChannelMessage;
Reflect.apply(saveDraft, value3, [channelId, comment2, ChannelMessage]);
}