732 lines
32 KiB
TypeScript
732 lines
32 KiB
TypeScript
/* Metro module 12533; source: utils/ReadyPayloadUtils.tsx; dependencies: [1383, 1910, 5231, 5237, 1930, 5238, 1926, 22, 44, 2] */
|
|
import Module00044 from '../by-id/module-00044.js'; /* Metro dependency 44 */
|
|
import DatabaseDaos from '../modules/app_database/DatabaseDaos.tsx'; /* Metro dependency 1910 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ChannelRecordModule from '../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
|
|
import * as IsCacheEnabledNativeModule from '../modules/cache/isCacheEnabled.native.tsx'; /* Metro dependency 5231 */
|
|
|
|
function _fun95762(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#95762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:6, offset: 0x0214d6f7, size: 258 bytes, params: 8, frame: 19
|
|
let env0_0 = require;
|
|
const _arrayLikeToArray_95765 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const restoreUsers = function(a0, a1) {
|
|
var env0_0 = a0;
|
|
if (a1 != null) {
|
|
a1.forEach(_fun95769);
|
|
}
|
|
return [];
|
|
};
|
|
const hydratePreviouslyUnavailableGuild2 = hydratePreviouslyUnavailableGuild;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_5 = {};
|
|
(FileImportTrackerModule).fileFinishedImporting('utils/ReadyPayloadUtils.tsx');
|
|
exports.hydrateReadySupplementalPayload = hydrateReadySupplementalPayload;
|
|
exports.preloadReadyPayloadData = preloadReadyPayloadData;
|
|
exports.hydrateReadyPayloadPrioritized = hydrateReadyPayloadPrioritized;
|
|
exports.hydrateInitialGuild = function(a0, a1) {
|
|
var value2 = hydratePreviouslyUnavailableGuild(a0);
|
|
env0_4 = {guild: a0, identifyTime: a1};
|
|
return value2;
|
|
};
|
|
exports.hydratePreviouslyUnavailableGuild = hydratePreviouslyUnavailableGuild2;
|
|
function _createForOfIteratorHelperLoose_95763(a0, a1) { // fn#95763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:142, offset: 0x0214d7f9, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun95764;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_95765(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_95765(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_95765(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun95764;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun95764() { // fn#95764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:713, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function maybeIncludeInitialGuild(a0, a1, a2) { // fn#95766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1068, offset: 0x0214d96d, size: 90 bytes, params: 4, frame: 14
|
|
const value2 = null;
|
|
return value2 == env0_4 || env0_4.identifyTime !== a0 ? value2 : value2 == a1 ? a2(env0_4.guild) : a1.some(_fun95767) ? value2 : a2(env0_4.guild);
|
|
function _fun95767({id}) { // fn#95767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1162, offset: 0x0214d9c7, size: 31 bytes, params: 2, frame: 2
|
|
return id === env1_4.guild.id;
|
|
}
|
|
|
|
}
|
|
|
|
function restoreUsers(a0, a1) { // fn#95768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1201, offset: 0x0214d9e6, size: 45 bytes, params: 3, frame: 12
|
|
const env0_0 = a0;
|
|
if (a1 != null) {
|
|
a1.forEach(_fun95769);
|
|
}
|
|
return [];
|
|
function _fun95769(a0) { // fn#95769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1264, offset: 0x0214da13, size: 132 bytes, params: 2, frame: 18
|
|
var user_id;
|
|
var value;
|
|
var binding;
|
|
if (a0 != null) {
|
|
user_id = a0.user_id;
|
|
if (user_id != null) {
|
|
value = environment.__proto__;
|
|
value = importDefault(44) /* metro dependency 44 */;
|
|
binding = env0_0;
|
|
value(binding[user_id] != null, 'Missing user[' + user_id + '] in compressed ready payload');
|
|
a0.user = binding[user_id];
|
|
}
|
|
delete a0.user_id;
|
|
binding = env0_1;
|
|
binding.push(a0);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function hydrateGuild(a0) { // fn#95770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1422, offset: 0x0214da97, size: 885 bytes, params: 2, frame: 19
|
|
var r7;
|
|
var r1;
|
|
var r6;
|
|
var r3;
|
|
var r0;
|
|
var object;
|
|
var object2;
|
|
var partial_updates;
|
|
var channels;
|
|
var value;
|
|
var value2;
|
|
var deleted_channel_ids;
|
|
var object3;
|
|
var emojis;
|
|
var deleted_emoji_ids;
|
|
var properties;
|
|
var object4;
|
|
var roles;
|
|
var deleted_role_ids;
|
|
var object5;
|
|
var stickers;
|
|
var deleted_sticker_ids;
|
|
var threads;
|
|
var collectThreadMessagesBinding;
|
|
var object9;
|
|
const env0_0 = a0;
|
|
if (a0.data_mode !== 'partial') {
|
|
object = {};
|
|
object.id = a0.id;
|
|
object.dataMode = a0.data_mode;
|
|
object.emojis = {op: 'full_sync', items: a0.emojis};
|
|
object.guild_scheduled_events = a0.guild_scheduled_events;
|
|
object.experiments = a0.experiments;
|
|
object.joined_at = a0.joined_at;
|
|
object.lastMessages = a0.last_messages;
|
|
object.member_count = a0.member_count;
|
|
object.members = a0.members;
|
|
object.premium_subscription_count = a0.premium_subscription_count;
|
|
object.properties = a0.properties;
|
|
object.roles = {op: 'full_sync', items: a0.roles};
|
|
object.stage_instances = a0.stage_instances;
|
|
object.stickers = {op: 'full_sync', items: a0.stickers};
|
|
threads = a0.threads;
|
|
r3 = threads?.map(_fun95771);
|
|
r3 = r3 ?? [];
|
|
object.threads = r3;
|
|
collectThreadMessagesBinding = collectThreadMessages;
|
|
threads = a0.threads;
|
|
object.threadMessages = collectThreadMessagesBinding(threads);
|
|
object9 = {op: 'full_sync'};
|
|
object9.items = a0.channels.map(_fun95772);
|
|
object.channels = object9;
|
|
object.version = a0.version;
|
|
object.hasThreadsSubscription = a0.has_threads_subscription;
|
|
r0 = object;
|
|
} else {
|
|
object = {};
|
|
object.id = a0.id;
|
|
object.dataMode = a0.data_mode;
|
|
object2 = {op: 'update'};
|
|
partial_updates = a0.partial_updates;
|
|
channels = partial_updates.channels;
|
|
value = null;
|
|
value2 = undefined;
|
|
r7 = value == channels ? value2 : channels.map(_fun95773);
|
|
r7 = value == r7 ? [] : r7;
|
|
object2.writes = r7;
|
|
partial_updates = a0.partial_updates;
|
|
deleted_channel_ids = partial_updates.deleted_channel_ids;
|
|
r7 = value != deleted_channel_ids ? deleted_channel_ids : [];
|
|
object2.deletes = r7;
|
|
object.channels = object2;
|
|
object.channelTimestampUpdates = a0.channel_updates;
|
|
object3 = {op: 'update'};
|
|
partial_updates = a0.partial_updates;
|
|
emojis = partial_updates.emojis;
|
|
r7 = value != emojis ? emojis : [];
|
|
object3.writes = r7;
|
|
partial_updates = a0.partial_updates;
|
|
deleted_emoji_ids = partial_updates.deleted_emoji_ids;
|
|
r7 = value != deleted_emoji_ids ? deleted_emoji_ids : [];
|
|
object3.deletes = r7;
|
|
object.emojis = object3;
|
|
object.guild_scheduled_events = a0.guild_scheduled_events;
|
|
object.experiments = a0.experiments;
|
|
object.joined_at = a0.joined_at;
|
|
object.lastMessages = a0.last_messages;
|
|
object.member_count = a0.member_count;
|
|
object.members = a0.members;
|
|
object.premium_subscription_count = a0.premium_subscription_count;
|
|
properties = a0.properties;
|
|
r1 = value != properties ? properties : value;
|
|
object.properties = r1;
|
|
object4 = {op: 'update'};
|
|
partial_updates = a0.partial_updates;
|
|
roles = partial_updates.roles;
|
|
r7 = value != roles ? roles : [];
|
|
object4.writes = r7;
|
|
partial_updates = a0.partial_updates;
|
|
deleted_role_ids = partial_updates.deleted_role_ids;
|
|
r7 = value != deleted_role_ids ? deleted_role_ids : [];
|
|
object4.deletes = r7;
|
|
object.roles = object4;
|
|
object.stage_instances = a0.stage_instances;
|
|
object5 = {op: 'update'};
|
|
partial_updates = a0.partial_updates;
|
|
stickers = partial_updates.stickers;
|
|
r6 = value != stickers ? stickers : [];
|
|
object5.writes = r6;
|
|
partial_updates = a0.partial_updates;
|
|
deleted_sticker_ids = partial_updates.deleted_sticker_ids;
|
|
r6 = value != deleted_sticker_ids ? deleted_sticker_ids : [];
|
|
object5.deletes = r6;
|
|
object.stickers = object5;
|
|
object.unableToSyncDeletes = a0.unable_to_sync_deletes;
|
|
threads = a0.threads;
|
|
r1 = value == threads ? value2 : threads.map(_fun95774);
|
|
r1 = value == r1 ? [] : r1;
|
|
object.threads = r1;
|
|
collectThreadMessagesBinding = collectThreadMessages;
|
|
threads = a0.threads;
|
|
object.threadMessages = collectThreadMessagesBinding(threads);
|
|
object.version = a0.version;
|
|
object.hasThreadsSubscription = a0.has_threads_subscription;
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
function _fun95771(a0) { // fn#95771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:1994, offset: 0x0214de0c, size: 32 bytes, params: 2, frame: 13
|
|
return createChannelRecordFromServer(a0, env0_0.id);
|
|
}
|
|
|
|
function _fun95772(a0) { // fn#95772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:2110, offset: 0x0214de2c, size: 43 bytes, params: 2, frame: 13
|
|
const binding = env0_0;
|
|
a0.guild_id = binding.id;
|
|
return createChannelRecordFromServer(a0, binding.id);
|
|
}
|
|
|
|
function _fun95773(a0) { // fn#95773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:2332, offset: 0x0214de0c, size: 32 bytes, params: 2, frame: 13
|
|
return createChannelRecordFromServer(a0, env0_0.id);
|
|
}
|
|
|
|
function _fun95774(a0) { // fn#95774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:3239, offset: 0x0214de0c, size: 32 bytes, params: 2, frame: 13
|
|
return createChannelRecordFromServer(a0, env0_0.id);
|
|
}
|
|
|
|
}
|
|
|
|
function hydratePreviouslyUnavailableGuild(a0) { // fn#95775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:3377, offset: 0x0214de57, size: 929 bytes, params: 2, frame: 19
|
|
var r7;
|
|
var r1;
|
|
var r6;
|
|
var r2;
|
|
var r0;
|
|
var object;
|
|
var object2;
|
|
var partial_updates;
|
|
var channels;
|
|
var value;
|
|
var value2;
|
|
var deleted_channel_ids;
|
|
var object3;
|
|
var emojis;
|
|
var deleted_emoji_ids;
|
|
var properties;
|
|
var object4;
|
|
var roles;
|
|
var deleted_role_ids;
|
|
var object5;
|
|
var stickers;
|
|
var deleted_sticker_ids;
|
|
var threads;
|
|
var collectThreadMessagesBinding;
|
|
var object9;
|
|
const env0_0 = a0;
|
|
if (a0.data_mode !== 'partial') {
|
|
object = {};
|
|
object.id = a0.id;
|
|
object.guild_scheduled_events = a0.guild_scheduled_events;
|
|
object.experiments = a0.experiments;
|
|
object.joined_at = a0.joined_at;
|
|
object.lastMessages = a0.last_messages;
|
|
object.member_count = a0.member_count;
|
|
object.members = a0.members;
|
|
object.premium_subscription_count = a0.premium_subscription_count;
|
|
object.properties = a0.properties;
|
|
object.roles = {op: 'full_sync', items: a0.roles};
|
|
object.stage_instances = a0.stage_instances;
|
|
threads = a0.threads;
|
|
r2 = threads?.map(_fun95776);
|
|
r2 = r2 ?? [];
|
|
object.threads = r2;
|
|
collectThreadMessagesBinding = collectThreadMessages;
|
|
threads = a0.threads;
|
|
object.threadMessages = collectThreadMessagesBinding(threads);
|
|
object.presences = a0.presences;
|
|
object.activity_instances = a0.activity_instances;
|
|
object.voice_states = a0.voice_states;
|
|
object.version = a0.version;
|
|
object.hasThreadsSubscription = a0.has_threads_subscription;
|
|
object.emojis = {op: 'full_sync', items: a0.emojis};
|
|
object.stickers = {op: 'full_sync', items: a0.stickers};
|
|
object9 = {op: 'full_sync'};
|
|
object9.items = a0.channels.map(_fun95777);
|
|
object.channels = object9;
|
|
r0 = object;
|
|
} else {
|
|
object = {};
|
|
object.id = a0.id;
|
|
object2 = {op: 'update'};
|
|
partial_updates = a0.partial_updates;
|
|
channels = partial_updates.channels;
|
|
value = null;
|
|
value2 = undefined;
|
|
r7 = value == channels ? value2 : channels.map(_fun95778);
|
|
r7 = value == r7 ? [] : r7;
|
|
object2.writes = r7;
|
|
partial_updates = a0.partial_updates;
|
|
deleted_channel_ids = partial_updates.deleted_channel_ids;
|
|
r7 = value != deleted_channel_ids ? deleted_channel_ids : [];
|
|
object2.deletes = r7;
|
|
object.channels = object2;
|
|
object.channelTimestampUpdates = a0.channel_updates;
|
|
object.activity_instances = a0.activity_instances;
|
|
object3 = {op: 'update'};
|
|
partial_updates = a0.partial_updates;
|
|
emojis = partial_updates.emojis;
|
|
r7 = value != emojis ? emojis : [];
|
|
object3.writes = r7;
|
|
partial_updates = a0.partial_updates;
|
|
deleted_emoji_ids = partial_updates.deleted_emoji_ids;
|
|
r7 = value != deleted_emoji_ids ? deleted_emoji_ids : [];
|
|
object3.deletes = r7;
|
|
object.emojis = object3;
|
|
object.guild_scheduled_events = a0.guild_scheduled_events;
|
|
object.experiments = a0.experiments;
|
|
object.joined_at = a0.joined_at;
|
|
object.lastMessages = a0.last_messages;
|
|
object.member_count = a0.member_count;
|
|
object.members = a0.members;
|
|
object.premium_subscription_count = a0.premium_subscription_count;
|
|
object.presences = a0.presences;
|
|
properties = a0.properties;
|
|
r1 = value != properties ? properties : value;
|
|
object.properties = r1;
|
|
object4 = {op: 'update'};
|
|
partial_updates = a0.partial_updates;
|
|
roles = partial_updates.roles;
|
|
r7 = value != roles ? roles : [];
|
|
object4.writes = r7;
|
|
partial_updates = a0.partial_updates;
|
|
deleted_role_ids = partial_updates.deleted_role_ids;
|
|
r7 = value != deleted_role_ids ? deleted_role_ids : [];
|
|
object4.deletes = r7;
|
|
object.roles = object4;
|
|
object.stage_instances = a0.stage_instances;
|
|
object5 = {op: 'update'};
|
|
partial_updates = a0.partial_updates;
|
|
stickers = partial_updates.stickers;
|
|
r6 = value != stickers ? stickers : [];
|
|
object5.writes = r6;
|
|
partial_updates = a0.partial_updates;
|
|
deleted_sticker_ids = partial_updates.deleted_sticker_ids;
|
|
r6 = value != deleted_sticker_ids ? deleted_sticker_ids : [];
|
|
object5.deletes = r6;
|
|
object.stickers = object5;
|
|
object.unableToSyncDeletes = a0.unable_to_sync_deletes;
|
|
threads = a0.threads;
|
|
r1 = value == threads ? value2 : threads.map(_fun95779);
|
|
r1 = value == r1 ? [] : r1;
|
|
object.threads = r1;
|
|
collectThreadMessagesBinding = collectThreadMessages;
|
|
threads = a0.threads;
|
|
object.threadMessages = collectThreadMessagesBinding(threads);
|
|
object.voice_states = a0.voice_states;
|
|
object.version = a0.version;
|
|
object.hasThreadsSubscription = a0.has_threads_subscription;
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
function _fun95776(a0) { // fn#95776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:3867, offset: 0x0214de0c, size: 32 bytes, params: 2, frame: 13
|
|
return createChannelRecordFromServer(a0, env0_0.id);
|
|
}
|
|
|
|
function _fun95777(a0) { // fn#95777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:4223, offset: 0x0214de2c, size: 43 bytes, params: 2, frame: 13
|
|
const binding = env0_0;
|
|
a0.guild_id = binding.id;
|
|
return createChannelRecordFromServer(a0, binding.id);
|
|
}
|
|
|
|
function _fun95778(a0) { // fn#95778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:4356, offset: 0x0214de0c, size: 32 bytes, params: 2, frame: 13
|
|
return createChannelRecordFromServer(a0, env0_0.id);
|
|
}
|
|
|
|
function _fun95779(a0) { // fn#95779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:5325, offset: 0x0214de0c, size: 32 bytes, params: 2, frame: 13
|
|
return createChannelRecordFromServer(a0, env0_0.id);
|
|
}
|
|
|
|
}
|
|
|
|
function collectThreadMessages(a0) { // fn#95780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:5491, offset: 0x0214e1f8, size: 87 bytes, params: 2, frame: 15
|
|
var r2;
|
|
var value;
|
|
var value2;
|
|
var done;
|
|
var value3;
|
|
var most_recent_message;
|
|
var push;
|
|
var value4;
|
|
const items2 = [];
|
|
if (a0 != null) {
|
|
value = _createForOfIteratorHelperLoose_95763(a0);
|
|
value2 = value();
|
|
done = value2.done;
|
|
if (!done) {
|
|
r2 = value2;
|
|
while (true) {
|
|
value3 = r2.value;
|
|
most_recent_message = value3.most_recent_message;
|
|
if (most_recent_message != null) {
|
|
push = items2.push;
|
|
most_recent_message = value3.most_recent_message;
|
|
Reflect.apply(push, items2, [most_recent_message]);
|
|
}
|
|
value4 = value();
|
|
done = value4.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value4;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function hydrateReadySupplementalPayload(a0, a1) { // fn#95781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:5787, offset: 0x0214e24f, size: 209 bytes, params: 3, frame: 21
|
|
var object6;
|
|
const guilds = a0.guilds;
|
|
const env0_0 = a0.merged_members;
|
|
const merged_presences = a0.merged_presences;
|
|
const object = {'guilds': 0, 'merged_members': 0, 'merged_presences': 0};
|
|
silentSetPrototypeOf(object, null, undefined);
|
|
const value = copyDataProperties({}, a0, object, undefined);
|
|
const restoreUsersBinding = restoreUsers;
|
|
const binding = object6;
|
|
const value3 = undefined;
|
|
const value4 = restoreUsersBinding(binding, merged_presences == null ? value3 : merged_presences.friends);
|
|
let r2 = guilds == null ? value3 : guilds.map(_fun95782);
|
|
r2 = r2 ?? [];
|
|
const value6 = maybeIncludeInitialGuild(a1, guilds, function(a0) {
|
|
return {id: a0.id, members: a0.members, presences: a0.presences, activity_instances: a0.activity_instances,
|
|
voice_states: a0.voice_states, unavailable: false};
|
|
});
|
|
if (value6 != null) {
|
|
r2.push(value6);
|
|
}
|
|
object6 = {};
|
|
const object2 = {};
|
|
copyDataProperties(object2, value, object);
|
|
object2['presences'] = value4;
|
|
object2['guilds'] = r2;
|
|
return object2;
|
|
function _fun95782(a0, a1) { // fn#95782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:5965, offset: 0x0214e320, size: 143 bytes, params: 3, frame: 19
|
|
var r2;
|
|
var r9;
|
|
var guilds;
|
|
let value = environment.__proto__;
|
|
const restoreUsersBinding = restoreUsers;
|
|
const binding = env1_5;
|
|
const value3 = merged_presences == null;
|
|
const value4 = undefined;
|
|
if (value3) {
|
|
r2 = value4;
|
|
r9 = value3;
|
|
} else {
|
|
guilds = merged_presences.guilds;
|
|
r2 = guilds[a1];
|
|
r9 = guilds;
|
|
}
|
|
const value5 = restoreUsersBinding(binding, r2);
|
|
value = restoreUsers(env1_5, merged_members == null ? value4 : merged_members[a1]);
|
|
const object = {};
|
|
copyDataProperties(object, a0, r9);
|
|
object['unavailable'] = value4 === a0.voice_states;
|
|
object['presences'] = value5;
|
|
object['members'] = value;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function preloadReadyPayloadData() { // fn#95784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:6399, offset: 0x0214e3f2, size: 337 bytes, params: 1, frame: 16
|
|
var r4;
|
|
var r3;
|
|
var Promise;
|
|
var resolve;
|
|
var Set;
|
|
var value5;
|
|
var set;
|
|
var value;
|
|
let value2 = (DatabaseDaos).database();
|
|
const r5 = IsCacheEnabledNativeModule.isCacheEnabled() ? (importDefault(5237) /* metro dependency 5237: GuildVersions */).getCommittedVersions() : global.Promise.resolve({});
|
|
if (IsCacheEnabledNativeModule.isCacheEnabled()) {
|
|
r4 = (importDefault(1930) /* metro dependency 1930: ChannelReader */).getGuildIds();
|
|
} else {
|
|
Promise = global.Promise;
|
|
resolve = Promise.resolve;
|
|
Set = global.Set;
|
|
value5 = Object.create(Set.prototype, {constructor: {value: Set}});
|
|
set = new Set();
|
|
r4 = Reflect.apply(resolve, Promise, [set instanceof Object ? set : value5]);
|
|
}
|
|
if (value2 != null) {
|
|
value = importDefault(5238) /* metro dependency 5238: KvCacheVersion */;
|
|
value = value.okAsync(value2);
|
|
r3 = value;
|
|
} else {
|
|
r3 = global.Promise.resolve(false);
|
|
}
|
|
Promise = global.Promise;
|
|
return Promise.all([r5, r4, r3]).then(function(a0) {
|
|
var r0;
|
|
var r2;
|
|
var r4;
|
|
var r1;
|
|
var item3;
|
|
var value3;
|
|
var item4;
|
|
var value4;
|
|
var iterator = a0[Symbol.iterator]();
|
|
var iterator2 = iterator.next;
|
|
var item2 = Reflect.apply(iterator2, iterator, []);
|
|
var item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
var value = undefined;
|
|
var value2 = item2 === value;
|
|
var r3 = value2 ? value : item;
|
|
if (value2) {
|
|
r0 = item2;
|
|
r2 = value;
|
|
r4 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value3 = item3 === value;
|
|
if (value3) {
|
|
r0 = item3;
|
|
r2 = value;
|
|
r4 = value3;
|
|
} else {
|
|
r0 = item3;
|
|
r2 = item;
|
|
r4 = value3;
|
|
}
|
|
}
|
|
if (r4) {
|
|
r1 = value;
|
|
} else {
|
|
item4 = Reflect.apply(iterator2, r0, []);
|
|
item = item4.value;
|
|
item4 = item4.done ? undefined : r0;
|
|
value4 = item4 === value;
|
|
if (value4) {
|
|
r0 = item4;
|
|
r1 = value;
|
|
r4 = value4;
|
|
} else {
|
|
r0 = item4;
|
|
r1 = item;
|
|
r4 = value4;
|
|
}
|
|
}
|
|
if (!r4) {
|
|
r0.return();
|
|
}
|
|
return {guildVersions: r3, guildChannels: r2, databaseOk: r1};
|
|
});
|
|
}
|
|
|
|
function hydrateReadyPayloadPrioritized(a0, a1, a2) { // fn#95786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:6797, offset: 0x0214e5b3, size: 362 bytes, params: 4, frame: 21
|
|
const users = a0.users;
|
|
const private_channels = a0.private_channels;
|
|
const env0_0 = a0.merged_members;
|
|
const guilds = a0.guilds;
|
|
const object = {'users': 0, 'private_channels': 0, 'merged_members': 0, 'guilds': 0};
|
|
silentSetPrototypeOf(object, null, undefined);
|
|
const value = copyDataProperties({}, a0, object, undefined);
|
|
const value3 = undefined;
|
|
const defaultImport = DatabaseDaos;
|
|
let r4 = defaultImport.database() != null && a2.databaseOk === false;
|
|
if (r4) {
|
|
(importDefault(1926) /* metro dependency 1926: DatabaseManager */).replaceDisableAllDatabases('ReadyPayloadUtils: database was not ok');
|
|
}
|
|
env0_5 = (importDefault(22) /* metro dependency 22 */).keyBy(users, function(a0) {
|
|
return a0.id;
|
|
});
|
|
if (private_channels != null) {
|
|
private_channels.forEach(function(a0) {
|
|
var recipient_ids = a0.recipient_ids;
|
|
if (recipient_ids != null) {
|
|
a0.recipients = recipient_ids.map(_fun95789);
|
|
}
|
|
delete a0.recipient_ids;
|
|
});
|
|
}
|
|
r4 = guilds == null ? value3 : guilds.map(_fun95790);
|
|
r4 = r4 ?? [];
|
|
const value7 = maybeIncludeInitialGuild(a1, guilds, function(a0) {
|
|
return hydrateGuild(a0);
|
|
});
|
|
if (value7 != null) {
|
|
r4.push(value7);
|
|
}
|
|
const object2 = {};
|
|
copyDataProperties(object2, value, object);
|
|
object2['users'] = users;
|
|
object2['presences'] = [];
|
|
object2['guilds'] = r4;
|
|
object2['private_channels'] = private_channels ?? [];
|
|
return object2;
|
|
function _fun95788(a0) { // fn#95788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:7082, offset: 0x0214e71d, size: 49 bytes, params: 2, frame: 12
|
|
const recipient_ids = a0.recipient_ids;
|
|
if (recipient_ids != null) {
|
|
a0.recipients = recipient_ids.map(_fun95789);
|
|
}
|
|
delete a0.recipient_ids;
|
|
function _fun95789(a0) { // fn#95789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:7138, offset: 0x0214e74e, size: 64 bytes, params: 2, frame: 15
|
|
(Module00044)(env2_5[a0] != null, 'Missing user in compressed ready payload');
|
|
return env2_5[a0];
|
|
}
|
|
|
|
}
|
|
|
|
function _fun95790(a0, a1) { // fn#95790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12723:7278, offset: 0x0214e78e, size: 83 bytes, params: 3, frame: 18
|
|
var r0;
|
|
var value2;
|
|
let value = a0;
|
|
if (value.unavailable === true) {
|
|
r0 = value;
|
|
} else {
|
|
value2 = environment.__proto__;
|
|
value.members = restoreUsers(env1_5, merged_members?.[a1]);
|
|
value = hydrateGuild(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun95762, 12533, [1383, 1910, 5231, 5237, 1930, 5238, 1926, 22, 44,
|
|
2]) /* metro module 12533, dependencies: [1383, 1910, 5231, 5237, 1930, 5238, 1926, 22, 44, 2] */;
|