124 lines
6.3 KiB
TypeScript
124 lines
6.3 KiB
TypeScript
/* Metro module 11178; source: modules/saved_messages/SavedMessagesActions.tsx; dependencies: [5, 11174, 661, 507, 11175, 4625, 694, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import SavedMessagesStore from './SavedMessagesStore.tsx'; /* Metro dependency 11174 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun85382(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11364:6, offset: 0x01f6ce19, size: 215 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/saved_messages/SavedMessagesActions.tsx');
|
|
exports.upsertSavedMessage = function() {
|
|
return _upsertSavedMessage.apply(this, arguments);
|
|
};
|
|
exports.deleteSavedMessage = function() {
|
|
return _deleteSavedMessage.apply(this, arguments);
|
|
};
|
|
exports.fetchAndUpdateSavedMessages = function() {
|
|
return _fetchAndUpdateSavedMessages.apply(this, arguments);
|
|
};
|
|
function _upsertSavedMessage() { // fn#85383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11364:136, offset: 0x01f6cef0, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun85385).apply(this, arguments);
|
|
function* _fun85385({channelId, messageId, dueAt}) { // fn#85385, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11364:197, offset: 0x01f6cf2d, size: 176 bytes, params: 2, frame: 20
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var HTTP = env2_0(env2_2[3]).HTTP;
|
|
var put = HTTP.put;
|
|
var object = {};
|
|
object.url = env2_5.PUT_SAVED_MESSAGE(channelId, messageId);
|
|
object.body = {due_at: dueAt};
|
|
object.rejectWithError = false;
|
|
yield Reflect.apply(put, HTTP, [object]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
if (undefined.ok) {
|
|
value = env2_0(env2_2[4]);
|
|
return value.savedMessageCreateObjectToClient(undefined.body);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _deleteSavedMessage() { // fn#85386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11364:422, offset: 0x01f6cfdd, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun85388).apply(this, arguments);
|
|
function* _fun85388({channelId, messageId}) { // fn#85388, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11364:483, offset: 0x01f6d01a, size: 122 bytes, params: 2, frame: 18
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var HTTP = env2_0(env2_2[3]).HTTP;
|
|
var del = HTTP.del;
|
|
var object = {};
|
|
object.url = env2_5.DELETE_SAVED_MESSAGE(channelId, messageId);
|
|
object.rejectWithError = false;
|
|
yield Reflect.apply(del, HTTP, [object]);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
if (value.ok) {
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fetchAndUpdateSavedMessages() { // fn#85389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11364:636, offset: 0x01f6d094, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun85391).apply(this, arguments);
|
|
function* _fun85391() { // fn#85391, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11364:715, offset: 0x01f6d0d1, size: 203 bytes, params: 1, frame: 16
|
|
var environment;
|
|
var HTTP;
|
|
var value3;
|
|
var value5;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
let binding = env2_4;
|
|
const getIsStale = binding.getIsStale;
|
|
if (Reflect.apply(getIsStale, binding, [])) {
|
|
binding = env2_0;
|
|
HTTP = binding(env2_2[3]).HTTP;
|
|
yield HTTP.get({url: env2_5.GET_SAVED_MESSAGES, rejectWithError: false});
|
|
value3 = undefined;
|
|
if (false) {
|
|
return value3;
|
|
}
|
|
value5 = value3.body.results.map(_fun85392);
|
|
binding = env2_1;
|
|
binding(env2_2[6]).dispatch({type: 'SAVED_MESSAGES_UPDATE', savedMessages: value5});
|
|
return undefined;
|
|
}
|
|
const Promise = global.Promise;
|
|
return Promise.resolve();
|
|
function _fun85392(a0) { // fn#85392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11364:867, offset: 0x01f6d19c, size: 113 bytes, params: 2, frame: 14
|
|
var r2;
|
|
const object = {};
|
|
const message = a0.message;
|
|
let value = null;
|
|
if (value != message) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
value = env3_0(env3_2[5]);
|
|
value = value.createMessageRecord(a0.message);
|
|
r2 = value;
|
|
} else {
|
|
r2 = value;
|
|
}
|
|
object.message = r2;
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
value = env3_0(env3_2[4]);
|
|
object.saveData = value.savedMessageDataToClient(a0.save_data);
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun85382, 11178, [5, 11174, 661, 507, 11175, 4625, 694,
|
|
2]) /* metro module 11178, dependencies: [5, 11174, 661, 507, 11175, 4625, 694, 2] */;
|