331 lines
14 KiB
TypeScript
331 lines
14 KiB
TypeScript
/* Metro module 11184; source: modules/saved_messages/SavedMessageUtils.tsx; dependencies: [5, 31, 1383, 1379, 661, 1244, 3738, 566, 4603, 6837, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import Module03738 from '../../by-id/module-03738.js'; /* Metro dependency 3738 */
|
|
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 FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as ChannelRecordModule from '../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
|
|
|
|
function _fun85438(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11370:6, offset: 0x01f6e9ea, size: 284 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {LONG: 0};
|
|
object[0] = 'LONG';
|
|
object.SHORT = 1;
|
|
object[1] = 'SHORT';
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/saved_messages/SavedMessageUtils.tsx');
|
|
exports.DueInStringTypes = object;
|
|
exports.useDueInString = useDueInString;
|
|
exports.useSavedMessageChannel = useSavedMessageChannel;
|
|
exports.savedMessageJumpToMessage = function() {
|
|
return _savedMessageJumpToMessage.apply(this, arguments);
|
|
};
|
|
function _savedMessageJumpToMessage() { // fn#85439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11370:265, offset: 0x01f6eb06, size: 50 bytes, params: 1, frame: 14
|
|
return Module00005(_fun85441).apply(this, arguments);
|
|
function* _fun85441(a0, a1) { // fn#85441, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11370:340, offset: 0x01f6eb43, size: 344 bytes, params: 3, frame: 22
|
|
var environment;
|
|
var type;
|
|
var r5;
|
|
var value3;
|
|
var UNKNOWN;
|
|
var saveData;
|
|
var guildId;
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value4;
|
|
var fetchChannel;
|
|
var channelId;
|
|
var channel;
|
|
var value5;
|
|
var value6;
|
|
var recipients;
|
|
var value7;
|
|
var length;
|
|
var value8;
|
|
var binding3;
|
|
var value9;
|
|
var ensurePrivateChannel;
|
|
var map;
|
|
var closure;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
var value13;
|
|
var error;
|
|
var value14;
|
|
var CHANNEL;
|
|
var messageId;
|
|
var value16;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = undefined;
|
|
reducibleJoin3: while (true) {
|
|
if (a1 == null) {
|
|
type = value;
|
|
break reducibleJoin3;
|
|
}
|
|
type = a1.type;
|
|
break reducibleJoin3;
|
|
}
|
|
reducibleJoin46: while (true) {
|
|
reduciblePort45: while (true) {
|
|
exceptionLanding44: while (true) {
|
|
value3 = environment.__proto__.__proto__;
|
|
UNKNOWN = env2_7.UNKNOWN;
|
|
if (type !== UNKNOWN) {
|
|
break reduciblePort45;
|
|
}
|
|
saveData = a0.saveData;
|
|
guildId = saveData.guildId;
|
|
if (guildId != null) {
|
|
break reduciblePort45;
|
|
}
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
property = binding2[8];
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
value4 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
fetchChannel = value4.fetchChannel;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
saveData = a0.saveData;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
channelId = saveData.channelId;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
channel = Reflect.apply(fetchChannel, value4, [channelId]);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
yield channel;
|
|
try {
|
|
value5 = undefined;
|
|
value6 = false;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
if (value6) {
|
|
return value5;
|
|
}
|
|
try {
|
|
recipients = value5.recipients;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
value7 = recipients == null;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
if (value7) {
|
|
return value;
|
|
}
|
|
try {
|
|
recipients = value5.recipients;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
length = recipients.length;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
value8 = length > 1;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
if (value8) {
|
|
return value;
|
|
}
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
binding3 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
property = binding3[8];
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
value9 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
ensurePrivateChannel = value9.ensurePrivateChannel;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
recipients = value5.recipients;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
map = recipients.map;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
closure = function(a0) {
|
|
return a0.id;
|
|
};
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
value10 = Reflect.apply(map, recipients, [closure]);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
try {
|
|
value11 = Reflect.apply(ensurePrivateChannel, value9, [value10]);
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
yield value11;
|
|
try {
|
|
value12 = undefined;
|
|
value13 = false;
|
|
} catch (error) {
|
|
break exceptionLanding44;
|
|
}
|
|
if (value13) {
|
|
return value12;
|
|
}
|
|
break reduciblePort45;
|
|
}
|
|
break reduciblePort45;
|
|
}
|
|
binding = env2_1;
|
|
value14 = binding(env2_2[9]);
|
|
binding = env2_8;
|
|
CHANNEL = binding.CHANNEL;
|
|
reducibleJoin47: while (true) {
|
|
if (a1 == null) {
|
|
r5 = value;
|
|
break reducibleJoin47;
|
|
}
|
|
break reducibleJoin46;
|
|
}
|
|
saveData = a0.saveData;
|
|
channelId = saveData.channelId;
|
|
saveData = a0.saveData;
|
|
messageId = saveData.messageId;
|
|
value16 = Reflect.apply(CHANNEL, binding, [r5, channelId, messageId]);
|
|
value14(value16, {openChannel: true});
|
|
return value;
|
|
}
|
|
value14(Reflect.apply(CHANNEL, binding, [a1.getGuildId(), a0.saveData.channelId, a0.saveData.messageId]),
|
|
{openChannel: true});
|
|
return value;
|
|
}
|
|
|
|
}
|
|
|
|
function useDueInString({dueAt, now, type}) { // fn#85443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11370:868, offset: 0x01f6ec9b, size: 352 bytes, params: 2, frame: 21
|
|
const t = (IndexNativeModule).t;
|
|
if (dueAt == null) {
|
|
return {'string': '', 'isOverdue': false};
|
|
}
|
|
let LONG = env0_9.LONG;
|
|
let r5 = type === LONG ? t.TjNWNF : t.H4gnX9;
|
|
LONG = env0_9.LONG;
|
|
const r0 = type === LONG ? t.haia16 : t['Uq7Y+7'];
|
|
const value2 = now > dueAt;
|
|
r5 = value2 ? r0 : r5;
|
|
const intl = (IndexNativeModule).intl;
|
|
const formatToPlainString = intl.formatToPlainString;
|
|
const object2 = {};
|
|
let value = Module03738;
|
|
const duration = value.duration;
|
|
let getTime = dueAt.getTime;
|
|
const value3 = Reflect.apply(getTime, dueAt, []);
|
|
getTime = now.getTime;
|
|
value = Reflect.apply(duration, value, [value3 - Reflect.apply(getTime, now, []), 'millisecond']);
|
|
object2.duration = value.humanize();
|
|
return {dueInText: Reflect.apply(formatToPlainString, intl, [r5, object2]), isOverdue: value2};
|
|
}
|
|
|
|
function useSavedMessageChannel(a0) { // fn#85444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11370:1244, offset: 0x01f6edfb, size: 104 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
return ReactModule.useMemo(_fun85446, [(FluxModule).useStateFromStores([ChannelStore],
|
|
_fun85445), a0]);
|
|
function _fun85445() { // fn#85445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11370:1317, offset: 0x01f6ee63, size: 37 bytes, params: 1, frame: 11
|
|
return ChannelStore.getChannel(env0_0.saveData.channelId);
|
|
}
|
|
|
|
function _fun85446() { // fn#85446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11370:1376, offset: 0x01f6ee88, size: 186 bytes, params: 1, frame: 18
|
|
var r0;
|
|
var value3;
|
|
var object;
|
|
var binding;
|
|
var saveData;
|
|
var intl;
|
|
if (channel != null) {
|
|
r0 = channel;
|
|
} else if (env0_0.message != null) {
|
|
value3 = environment.__proto__;
|
|
object = {};
|
|
binding = env0_0;
|
|
saveData = binding.saveData;
|
|
object.id = saveData.channelId;
|
|
saveData = binding.saveData;
|
|
object.guild_id = saveData.guildId;
|
|
object.type = ChannelTypes.UNKNOWN;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object.name = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.J90oLW);
|
|
r0 = new UnknownChannelRecord();
|
|
} else {
|
|
r0 = undefined;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun85438, 11184, [5, 31, 1383, 1379, 661, 1244, 3738, 566, 4603, 6837,
|
|
2]) /* metro module 11184, dependencies: [5, 31, 1383, 1379, 661, 1244, 3738, 566, 4603, 6837, 2] */;
|