268 lines
14 KiB
TypeScript
268 lines
14 KiB
TypeScript
/* Metro module 11173; source: modules/saved_messages/SavedMessageHelpers.native.tsx; dependencies: [5, 11174, 661, 11176, 11177, 7890, 7892, 11178, 4647, 1244, 5080, 11179, 1962, 3857, 7684, 4076, 11190, 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 */
|
|
import * as SavedMessagesConstantsModule from '../../external/discord_common/js/shared/shared-constants/SavedMessagesConstants.tsx'; /* Metro dependency 11176 */
|
|
|
|
function _fun85320(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11359:6, offset: 0x01f6b459, size: 213 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/saved_messages/SavedMessageHelpers.native.tsx');
|
|
exports.addOrUpdateSavedMessage = function() {
|
|
return _addOrUpdateSavedMessage.apply(this, arguments);
|
|
};
|
|
exports.removeSavedMessage = function() {
|
|
return _removeSavedMessage.apply(this, arguments);
|
|
};
|
|
function _addOrUpdateSavedMessage() { // fn#85321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11359:166, offset: 0x01f6b52e, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun85323).apply(this, arguments);
|
|
async function _fun85323(a0) { // fn#85323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11359:237, offset: 0x01f6b574, size: 506 bytes, params: 2, frame: 23
|
|
var r7;
|
|
var r8;
|
|
var value8;
|
|
var dueAt;
|
|
var binding3;
|
|
var intl;
|
|
var binding4;
|
|
if (true) {
|
|
var displayToast = a0.displayToast;
|
|
Object.create(null).displayToast = 0;
|
|
value = copyDataProperties({}, a0, value, undefined);
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
var binding = env2_4;
|
|
var getSavedMessage = binding.getSavedMessage;
|
|
if (Reflect.apply(getSavedMessage, binding, [value.channelId, value.messageId]) != null) {
|
|
binding = env2_0;
|
|
await binding(env2_2[7]).upsertSavedMessage(value).catch(_fun85324);
|
|
value8 = undefined;
|
|
if (false) {
|
|
return value8;
|
|
}
|
|
if (value8 != null) {
|
|
if (displayToast) {
|
|
dueAt = value.dueAt;
|
|
if (dueAt != null) {
|
|
binding = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding(binding4[9]).intl;
|
|
r7 = intl.string(binding(binding4[9]).t.i1IsOy);
|
|
} else {
|
|
binding = env2_0;
|
|
binding3 = env2_2;
|
|
intl = binding(binding3[9]).intl;
|
|
r7 = intl.string(binding(binding3[9]).t.DQjes4);
|
|
}
|
|
dueAt = value.dueAt;
|
|
r8 = dueAt != null ? env2_0(env2_2[15]).ClockIcon : env2_0(env2_2[16]).BookmarkIcon;
|
|
binding = env2_1;
|
|
value = binding(env2_2[13]);
|
|
value.open({key: 'SAVED_MESSAGE_CREATE_SUCCESS', IconComponent: r8, content: r7});
|
|
}
|
|
}
|
|
} else {
|
|
binding = env2_1;
|
|
if (binding(env2_2[4])()) {
|
|
binding = env2_0;
|
|
await binding(env2_2[7]).upsertSavedMessage(value).catch(_fun85324);
|
|
value8 = undefined;
|
|
if (false) {
|
|
return value8;
|
|
}
|
|
if (value8 != null) {
|
|
if (displayToast) {
|
|
dueAt = value.dueAt;
|
|
if (dueAt != null) {
|
|
binding = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding(binding4[9]).intl;
|
|
r7 = intl.string(binding(binding4[9]).t.i1IsOy);
|
|
} else {
|
|
binding = env2_0;
|
|
binding3 = env2_2;
|
|
intl = binding(binding3[9]).intl;
|
|
r7 = intl.string(binding(binding3[9]).t.DQjes4);
|
|
}
|
|
dueAt = value.dueAt;
|
|
r8 = dueAt != null ? env2_0(env2_2[15]).ClockIcon : env2_0(env2_2[16]).BookmarkIcon;
|
|
binding = env2_1;
|
|
value = binding(env2_2[13]);
|
|
value.open({key: 'SAVED_MESSAGE_CREATE_SUCCESS', IconComponent: r8, content: r7});
|
|
}
|
|
}
|
|
return undefined;
|
|
}
|
|
binding = env2_1;
|
|
var binding2 = env2_2;
|
|
value = binding(binding2[5]);
|
|
binding = env2_0;
|
|
var EntitlementFeatureNames = binding(binding2[6]).EntitlementFeatureNames;
|
|
var SAVED_MESSAGES = EntitlementFeatureNames.SAVED_MESSAGES;
|
|
value(SAVED_MESSAGES);
|
|
}
|
|
}
|
|
function _fun85324(a0) { // fn#85324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11359:387, offset: 0x01f6b76e, size: 487 bytes, params: 2, frame: 22
|
|
var message;
|
|
var r4;
|
|
var binding;
|
|
var binding2;
|
|
var value3;
|
|
var open;
|
|
var object;
|
|
var binding3;
|
|
var intl;
|
|
var string;
|
|
var t;
|
|
var binding4;
|
|
var value4;
|
|
var show;
|
|
var formatToPlainString;
|
|
const value = undefined;
|
|
const code = a0 == null || a0.body == null ? value : a0.body.code;
|
|
const TOO_MANY_SAVED_MESSAGES = env3_5.TOO_MANY_SAVED_MESSAGES;
|
|
if (code === TOO_MANY_SAVED_MESSAGES) {
|
|
binding = env3_1;
|
|
binding4 = env3_2;
|
|
value4 = binding(binding4[8]);
|
|
show = value4.show;
|
|
object = {};
|
|
binding = env3_0;
|
|
intl = binding(binding4[9]).intl;
|
|
string = intl.string;
|
|
t = binding(binding4[9]).t;
|
|
object.title = Reflect.apply(string, intl, [t.mlbiZW]);
|
|
intl = binding(binding4[9]).intl;
|
|
formatToPlainString = intl.formatToPlainString;
|
|
t = binding(binding4[9]).t;
|
|
object.body = Reflect.apply(formatToPlainString, intl, [t['1zVbEG'], {max: env3_6}]);
|
|
intl = binding(binding4[9]).intl;
|
|
string = intl.string;
|
|
t = binding(binding4[9]).t;
|
|
object.confirmText = Reflect.apply(string, intl, [t.BddRzS]);
|
|
intl = binding(binding4[9]).intl;
|
|
string = intl.string;
|
|
t = binding(binding4[9]).t;
|
|
object.cancelText = Reflect.apply(string, intl, [t.ZGbTcy]);
|
|
object.onCancel = onCancel_85325;
|
|
Reflect.apply(show, value4, [object]);
|
|
} else {
|
|
binding = env3_1;
|
|
binding2 = env3_2;
|
|
value3 = binding(binding2[13]);
|
|
open = value3.open;
|
|
object = {key: 'SAVED_MESSAGE_CREATE_ERROR'};
|
|
binding = env3_0;
|
|
object.IconComponent = binding(binding2[14]).CircleErrorIcon;
|
|
message = a0 == null || a0.body == null ? value : a0.body.message;
|
|
if (message != null) {
|
|
r4 = message;
|
|
} else {
|
|
binding = env3_0;
|
|
binding3 = env3_2;
|
|
intl = binding(binding3[9]).intl;
|
|
r4 = intl.string(binding(binding3[9]).t.R0RpRX);
|
|
}
|
|
object.content = r4;
|
|
Reflect.apply(open, value3, [object]);
|
|
}
|
|
return null;
|
|
function onCancel_85325() { // fn#85325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11359:711, offset: 0x01f6b955, size: 72 bytes, params: 1, frame: 15
|
|
const value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
const binding = env4_1;
|
|
const binding2 = env4_2;
|
|
const value2 = binding(binding2[10]);
|
|
return value2.pushLazy(env4_0(binding2[12])(binding2[11], binding2.paths));
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _removeSavedMessage() { // fn#85326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11359:1290, offset: 0x01f6b99d, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun85328).apply(this, arguments);
|
|
async function _fun85328(a0) { // fn#85328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11359:1351, offset: 0x01f6b9e3, size: 391 bytes, params: 2, frame: 23
|
|
var r7;
|
|
var r8;
|
|
var dueAt;
|
|
var binding2;
|
|
var intl;
|
|
var binding3;
|
|
if (true) {
|
|
var displayToast = a0.displayToast;
|
|
Object.create(null).displayToast = 0;
|
|
value = copyDataProperties({}, a0, value, undefined);
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
var binding = env2_0;
|
|
await binding(env2_2[7]).deleteSavedMessage(value).catch(_fun85329);
|
|
var value8 = undefined;
|
|
if (false) {
|
|
return value8;
|
|
}
|
|
if (value8 != null) {
|
|
if (displayToast) {
|
|
dueAt = value.dueAt;
|
|
if (dueAt != null) {
|
|
binding = env2_0;
|
|
binding3 = env2_2;
|
|
intl = binding(binding3[9]).intl;
|
|
r7 = intl.string(binding(binding3[9]).t.D0tS02);
|
|
} else {
|
|
binding = env2_0;
|
|
binding2 = env2_2;
|
|
intl = binding(binding2[9]).intl;
|
|
r7 = intl.string(binding(binding2[9]).t['5KOMiV']);
|
|
}
|
|
dueAt = value.dueAt;
|
|
r8 = dueAt != null ? env2_0(env2_2[15]).ClockIcon : env2_0(env2_2[16]).BookmarkIcon;
|
|
binding = env2_1;
|
|
value = binding(env2_2[13]);
|
|
value.open({key: 'SAVED_MESSAGE_REMOVE_SUCCESS', IconComponent: r8, content: r7});
|
|
}
|
|
}
|
|
}
|
|
function _fun85329(a0) { // fn#85329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11359:1437, offset: 0x01f6bb6a, size: 172 bytes, params: 2, frame: 19
|
|
var r4;
|
|
var binding3;
|
|
var intl;
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
let binding = env3_1;
|
|
const binding2 = env3_2;
|
|
const value2 = undefined;
|
|
const value3 = binding(binding2[13]);
|
|
const open = value3.open;
|
|
const object = {key: 'SAVED_MESSAGE_REMOVE_ERROR'};
|
|
const CircleErrorIcon = env3_0(binding2[14]).CircleErrorIcon;
|
|
object.IconComponent = CircleErrorIcon;
|
|
const message = a0 == null || a0.body == null ? value2 : a0.body.message;
|
|
if (message != null) {
|
|
r4 = message;
|
|
} else {
|
|
binding = env3_0;
|
|
binding3 = env3_2;
|
|
intl = binding(binding3[9]).intl;
|
|
r4 = intl.string(binding(binding3[9]).t.R0RpRX);
|
|
}
|
|
object.content = r4;
|
|
Reflect.apply(open, value3, [object]);
|
|
return null;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun85320, 11173, [5, 11174, 661, 11176, 11177, 7890, 7892, 11178, 4647, 1244, 5080, 11179, 1962, 3857,
|
|
7684, 4076, 11190,
|
|
2]) /* metro module 11173, dependencies: [5, 11174, 661, 11176, 11177, 7890, 7892, 11178, 4647, 1244, 5080, 11179, 1962, 3857, 7684, 4076, 11190, 2] */;
|