691 lines
32 KiB
TypeScript
691 lines
32 KiB
TypeScript
/* Metro module 16194; source: modules/native_intents/NativeIntentsManager.tsx; dependencies: [6, 7, 15, 17, 18, 57, 1379, 1867, 3784, 3793, 1934, 1878, 661, 16195, 16196, 4805, 10254, 1423, 1360, 3995, 4860, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
|
|
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import NativeIntentsExperiment from './NativeIntentsExperiment.tsx'; /* Metro dependency 16195 */
|
|
import IntentsBindingsAndroid from './IntentsBindings.android.tsx'; /* Metro dependency 16196 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as GetChannelIconModule from '../channel/getChannelIcon.tsx'; /* Metro dependency 10254 */
|
|
|
|
function _fun125140(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#125140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:6, offset: 0x025cf2b6, size: 593 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_125146 = 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 handleRelativeURL = function(a0) {
|
|
var value = a0;
|
|
return value == null || value.startsWith == null ? value ?? undefined : value.startsWith('/') ? global.location.origin + value : value ?? undefined;
|
|
};
|
|
const getGuildThumbnail = function(a0) {
|
|
return a0 != null ? handleRelativeURL(importDefault(dependencyMap[17]).getGuildIconURL({id: a0.id,
|
|
icon: a0.icon,
|
|
size: 128})) : undefined;
|
|
};
|
|
const updateUserId_125155 = function(a0) {
|
|
var value2 = ChannelStore.getDMChannelFromUserId(a0);
|
|
if (value2 != null) {
|
|
indexChannelUpdates([value2]);
|
|
}
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ConstantsModule;
|
|
const env0_15 = value.ME;
|
|
const env0_16 = value.ChannelTypes;
|
|
const env0_17 = value.Links;
|
|
const env0_18 = value.Permissions;
|
|
const env0_19 = value.Routes;
|
|
object = {GUILD: 100};
|
|
object[100] = 'GUILD';
|
|
object.DM = 75;
|
|
object[75] = 'DM';
|
|
object.OTHER_CHANNEL = 50;
|
|
object[50] = 'OTHER_CHANNEL';
|
|
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
|
value = _fun125157(value);
|
|
value = new value();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/native_intents/NativeIntentsManager.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_125141() { // fn#125141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:295, offset: 0x025cf507, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_125141_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_125144(a0, a1) { // fn#125144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:488, offset: 0x025cf569, 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 _fun125145;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_125146(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_125146(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_125146(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun125145;
|
|
}
|
|
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 _fun125145() { // fn#125145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:1059, 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 indexingEnabled() { // fn#125147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:1510, offset: 0x025cf6dd, size: 96 bytes, params: 1, frame: 17
|
|
const getCurrentConfig = NativeIntentsExperiment.getCurrentConfig;
|
|
const defaultImport = IntentsBindingsAndroid;
|
|
return Reflect.apply(getCurrentConfig, NativeIntentsExperiment, [{location: 'NativeIntentsManager'}, {autoTrackExposure: true,
|
|
disable: !defaultImport.hasSearch()}]).searchEnabled;
|
|
}
|
|
|
|
function clearEnabled() { // fn#125148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:1672, offset: 0x025cf73d, size: 96 bytes, params: 1, frame: 17
|
|
const getCurrentConfig = NativeIntentsExperiment.getCurrentConfig;
|
|
const defaultImport = IntentsBindingsAndroid;
|
|
return Reflect.apply(getCurrentConfig, NativeIntentsExperiment, [{location: 'NativeIntentsManager'}, {autoTrackExposure: true,
|
|
disable: !defaultImport.hasSearch()}]).clearEnabled;
|
|
}
|
|
|
|
function makeSearchItem(a0, a1) { // fn#125150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:1949, offset: 0x025cf7e4, size: 592 bytes, params: 3, frame: 31
|
|
var push;
|
|
var channelName3;
|
|
var channelName4;
|
|
var name;
|
|
const value = a2;
|
|
const value2 = undefined;
|
|
const r1 = value !== value2 ? value : false;
|
|
const channelName = (require(4805) /* metro dependency 4805: useChannelName */).computeChannelName(a0, UserStore,
|
|
RelationshipStore, true);
|
|
const useChannelNameModule = require(4805) /* metro dependency 4805: useChannelName */;
|
|
const channelName2 = useChannelNameModule.computeChannelName(a0, UserStore, RelationshipStore, false);
|
|
let object = [];
|
|
const items3 = [channelName, channelName2];
|
|
const items2 = [];
|
|
if (a0.isGuildVocal()) {
|
|
items3.push('!' + channelName2);
|
|
}
|
|
const channel = ChannelStore.getChannel(a0.parent_id);
|
|
if (channel != null) {
|
|
channelName3 = useChannelNameModule.computeChannelName(channel, UserStore, RelationshipStore, true);
|
|
channelName4 = (require(4805) /* metro dependency 4805: useChannelName */).computeChannelName(channel,
|
|
UserStore,
|
|
RelationshipStore, false);
|
|
items2.push(channelName3);
|
|
items2.push(channelName4);
|
|
object.push(channelName3);
|
|
}
|
|
if (a1 != null) {
|
|
push = items2.push;
|
|
name = a1.name;
|
|
Reflect.apply(push, items2, [name]);
|
|
push = object.push;
|
|
name = a1.name;
|
|
Reflect.apply(push, object, [name]);
|
|
}
|
|
const value7 = channelName + (object.length > 0 ? ' (' + object.join(', ') + ')' : '');
|
|
const value8 = Routes.CHANNEL((a1 == null ? value2 : a1.id) ?? ME, a0.id);
|
|
object = {id: value8, relatedUniqueIdentifier: value8, type: 'url', title: value7, displayName: value7};
|
|
const handleRelativeURLBinding = handleRelativeURL;
|
|
const getChannelIconURL = GetChannelIconModule.getChannelIconURL;
|
|
object.thumbnailURL = handleRelativeURLBinding(Reflect.apply(getChannelIconURL, GetChannelIconModule, [a0, 128,
|
|
false]));
|
|
const type = a0.type;
|
|
const DM = ChannelTypes.DM;
|
|
object.rankingHint = type === DM ? env0_20.DM : env0_20.OTHER_CHANNEL;
|
|
object.keywords = items2;
|
|
object.alternateNames = items3;
|
|
object.isUpdate = r1;
|
|
return object;
|
|
}
|
|
|
|
function makeGuildDomain(a0) { // fn#125152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:2777, offset: 0x025cfa8c, size: 384 bytes, params: 2, frame: 26
|
|
var r6;
|
|
var r5;
|
|
var propertyName;
|
|
var propertyName2;
|
|
var property;
|
|
var permissionStoreBinding;
|
|
var can;
|
|
var VIEW_CHANNEL;
|
|
var value8;
|
|
var value9;
|
|
const value = a1;
|
|
const r1 = value !== undefined ? value : false;
|
|
const guildThumbnail = getGuildThumbnail(a0);
|
|
const value3 = Routes.CHANNEL(a0.id);
|
|
const GUILD = env0_20.GUILD;
|
|
const items2 = [{id: value3, relatedUniqueIdentifier: value3, type: 'url', title: a0.name, displayName: a0.name,
|
|
alternateNames: ['*' + a0.name], rankingHint: GUILD}];
|
|
const mutableGuildChannelsForGuild = ChannelStore.getMutableGuildChannelsForGuild(a0.id);
|
|
for (propertyName in mutableGuildChannelsForGuild) {
|
|
property = mutableGuildChannelsForGuild[propertyName];
|
|
permissionStoreBinding = PermissionStore;
|
|
can = permissionStoreBinding.can;
|
|
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
|
|
if (!Reflect.apply(can, permissionStoreBinding, [VIEW_CHANNEL, property])) {
|
|
r6 = propertyName2;
|
|
continue;
|
|
}
|
|
items2.push(makeSearchItem(property, a0, r1));
|
|
r6 = propertyName2;
|
|
}
|
|
const _createForOfIteratorHelperLoose_125144Binding = _createForOfIteratorHelperLoose_125144;
|
|
channelStoreBinding = ChannelStore;
|
|
const getAllThreadsForGuild = channelStoreBinding.getAllThreadsForGuild;
|
|
const value6 = _createForOfIteratorHelperLoose_125144Binding(Reflect.apply(getAllThreadsForGuild,
|
|
channelStoreBinding, [a0.id]));
|
|
const value7 = value6();
|
|
let done = value7.done;
|
|
if (!done) {
|
|
r5 = value7;
|
|
while (true) {
|
|
value8 = r5.value;
|
|
permissionStoreBinding = PermissionStore;
|
|
can = permissionStoreBinding.can;
|
|
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
|
|
if (Reflect.apply(can, permissionStoreBinding, [VIEW_CHANNEL, value8])) {
|
|
items2.push(makeSearchItem(value8, a0, r1));
|
|
}
|
|
value9 = value6();
|
|
done = value9.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r5 = value9;
|
|
continue;
|
|
}
|
|
}
|
|
return {id: a0.id, items: items2, defaultThumbnailURL: guildThumbnail, isUpdate: r1};
|
|
}
|
|
|
|
function getChannelKeywords(a0) { // fn#125153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:3326, offset: 0x025cfc0c, size: 380 bytes, params: 2, frame: 19
|
|
var push;
|
|
var Object;
|
|
var value;
|
|
var items2;
|
|
var recipients;
|
|
var value2;
|
|
var property;
|
|
var globalName;
|
|
var username;
|
|
var relationshipStoreBinding;
|
|
var value6;
|
|
const items3 = [];
|
|
if (a0.name !== '') {
|
|
items3.push(a0.name);
|
|
}
|
|
if (a0.nicks != null) {
|
|
push = items3.push;
|
|
Object = global.Object;
|
|
value = Object.values(a0.nicks);
|
|
items2 = [];
|
|
arraySpread(items2, value, 0, undefined);
|
|
apply(push, items2, items3, undefined);
|
|
}
|
|
const type = a0.type;
|
|
const DM = ChannelTypes.DM;
|
|
if (type === DM) {
|
|
recipients = a0.recipients;
|
|
value2 = recipients.map(UserStore.getUser);
|
|
property = Module00057(value2.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish), 1)[0];
|
|
if (property != null) {
|
|
globalName = (importDefault(3995) /* metro dependency 3995: UserUtils */).getGlobalName(property);
|
|
if (globalName != null) {
|
|
items3.push(globalName);
|
|
}
|
|
push = items3.push;
|
|
username = property.username;
|
|
Reflect.apply(push, items3, [username]);
|
|
push = items3.push;
|
|
username = property.username;
|
|
Reflect.apply(push, items3, ['@' + username]);
|
|
relationshipStoreBinding = RelationshipStore;
|
|
value6 = relationshipStoreBinding.getNickname(property.id);
|
|
if (value6 != null) {
|
|
items3.push(value6);
|
|
}
|
|
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
|
|
value = value.getName(property);
|
|
if (value != null) {
|
|
items3.push(value);
|
|
}
|
|
}
|
|
}
|
|
return items3;
|
|
}
|
|
|
|
function setChannelActivity(a0) { // fn#125154, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:3743, offset: 0x025cfd88, size: 489 bytes, params: 2, frame: 23
|
|
var r3;
|
|
var guildStoreBinding;
|
|
var getGuild;
|
|
var guild_id;
|
|
var value4;
|
|
var moduleValue;
|
|
var channelName;
|
|
var value5;
|
|
var value7;
|
|
var Set;
|
|
var set;
|
|
var CHANNEL;
|
|
var value11;
|
|
const value2 = undefined;
|
|
const defaultImport = NativeIntentsExperiment;
|
|
const getCurrentConfig = defaultImport.getCurrentConfig;
|
|
let object = {location: 'NativeIntentsManager'};
|
|
const object2 = {autoTrackExposure: true};
|
|
const defaultImport2 = importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */;
|
|
object2.disable = !defaultImport2.hasUserActivity();
|
|
if (Reflect.apply(getCurrentConfig, defaultImport, [object, object2]).activityEnabled) {
|
|
r3 = a0 != null ? ChannelStore.getChannel(a0) : value2;
|
|
if (r3 != null) {
|
|
guildStoreBinding = GuildStore;
|
|
getGuild = guildStoreBinding.getGuild;
|
|
guild_id = r3.guild_id;
|
|
value4 = Reflect.apply(getGuild, guildStoreBinding, [guild_id]);
|
|
moduleValue = require(4805) /* metro dependency 4805: useChannelName */;
|
|
channelName = moduleValue.computeChannelName(r3, UserStore, RelationshipStore, true);
|
|
value5 = '';
|
|
value7 = channelName + (value4 != null ? ' (' + value4.name + ')' : value5);
|
|
Set = global.Set;
|
|
object = [channelName];
|
|
arraySpread(object, getChannelKeywords(r3), 1, true);
|
|
set = new Set(object);
|
|
object = [];
|
|
arraySpread(object, set, 0, true);
|
|
CHANNEL = Routes.CHANNEL;
|
|
guild_id = r3.guild_id;
|
|
value11 = Reflect.apply(CHANNEL, Routes, [guild_id, r3.id]);
|
|
defaultImport2.setActivity({webpageURL: value5 + Links.BASE_URL + value11, relatedUniqueIdentifier: value11,
|
|
eligibleForHandoff: true, eligibleForSearch: true, title: value7, keywords: object, displayName: value7,
|
|
type: 'com.discord.view-channel'});
|
|
} else {
|
|
(importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */).resignActivity();
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function indexChannelUpdates(a0) { // fn#125156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:4494, offset: 0x025cffa3, size: 382 bytes, params: 2, frame: 34
|
|
var r10;
|
|
var id;
|
|
var r16;
|
|
var items4;
|
|
var items2;
|
|
var object;
|
|
var value3;
|
|
var value4;
|
|
var done;
|
|
var value5;
|
|
var permissionStoreBinding;
|
|
var can;
|
|
var VIEW_CHANNEL;
|
|
var push;
|
|
var guildStoreBinding;
|
|
var getGuild;
|
|
var guild_id;
|
|
var value6;
|
|
var searchItem;
|
|
var property;
|
|
var guildThumbnail;
|
|
var items3;
|
|
var value8;
|
|
var length;
|
|
const indexingEnabledBinding = indexingEnabled;
|
|
const value2 = undefined;
|
|
if (indexingEnabledBinding()) {
|
|
items4 = [];
|
|
items2 = [];
|
|
object = {};
|
|
value3 = _createForOfIteratorHelperLoose_125144(a0);
|
|
value4 = value3();
|
|
done = value4.done;
|
|
if (!done) {
|
|
r10 = value4;
|
|
while (true) {
|
|
value5 = r10.value;
|
|
permissionStoreBinding = PermissionStore;
|
|
can = permissionStoreBinding.can;
|
|
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
|
|
if (Reflect.apply(can, permissionStoreBinding, [VIEW_CHANNEL, value5])) {
|
|
guildStoreBinding = GuildStore;
|
|
getGuild = guildStoreBinding.getGuild;
|
|
guild_id = value5.guild_id;
|
|
value6 = Reflect.apply(getGuild, guildStoreBinding, [guild_id]);
|
|
if (value6 == null) {
|
|
id = value2;
|
|
continue;
|
|
}
|
|
id = value6.id;
|
|
if (id != null) {
|
|
r16 = id;
|
|
continue;
|
|
}
|
|
r16 = ME;
|
|
searchItem = makeSearchItem(value5, value6, true);
|
|
property = object[r16];
|
|
if (property != null) {
|
|
property.push(searchItem);
|
|
break;
|
|
}
|
|
guildThumbnail = getGuildThumbnail(value6);
|
|
items3 = [searchItem];
|
|
items4.push({id: r16, items: items3, defaultThumbnailURL: guildThumbnail});
|
|
object[r16] = items3;
|
|
break;
|
|
}
|
|
push = items2.push;
|
|
id = value5.id;
|
|
Reflect.apply(push, items2, [id]);
|
|
value8 = value3();
|
|
done = value8.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r10 = value8;
|
|
continue;
|
|
}
|
|
}
|
|
length = items4.length;
|
|
if (length > 0) {
|
|
(importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */).indexDomains(items4);
|
|
}
|
|
length = items2.length;
|
|
if (length > 0) {
|
|
(importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */).deleteSearchItems(items2);
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function _fun125157(a0) { // fn#125157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:4987, offset: 0x025d0121, size: 326 bytes, params: 2, frame: 16
|
|
const NativeIntentsManager2 = NativeIntentsManager;
|
|
Inherits(NativeIntentsManager2, a0);
|
|
return CreateClass(NativeIntentsManager2, [{key: 'handleInit', value: function() {
|
|
setChannelActivity(SelectedChannelStore.getCurrentlySelectedChannelId());
|
|
if (clearEnabled()) {
|
|
importDefault(dependencyMap[14]).clearSearchIndex();
|
|
}
|
|
if (indexingEnabled()) {
|
|
_fun125160();
|
|
}
|
|
}}, {key: 'handleLogout', value: value_125162}, {key: 'handleChannelSelect', value: function({channelId}) {
|
|
setChannelActivity(channelId);
|
|
}}, {key: 'handleChannelCreate', value: value_125164}, {key: 'handleChannelDelete', value: value_125165},
|
|
{key: 'handleChannelUpdates', value: function({channels}) {
|
|
indexChannelUpdates(channels);
|
|
}}, {key: 'handleGuildCreateOrUpdate', value: value_125167}, {key: 'handleGuildDelete', value: value_125168},
|
|
{key: 'handleThreadUpdate', value: function({channel}) {
|
|
indexChannelUpdates([channel]);
|
|
}}, {key: 'handleUserUpdate', value: function({user}) {
|
|
updateUserId_125155(user.id);
|
|
}}, {key: 'handleRelationshipChange', value: function({relationship}) {
|
|
updateUserId_125155(relationship.id);
|
|
}}]);
|
|
function NativeIntentsManager(a0) { // fn#125158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:4999, offset: 0x025d0267, size: 314 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, NativeIntentsManager);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_6(NativeIntentsManager);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_125141()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_6(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.actions = {POST_CONNECTION_OPEN: value.handleInit, LOGOUT: value.handleLogout,
|
|
CHANNEL_SELECT: value.handleChannelSelect, CHANNEL_CREATE: value.handleChannelCreate,
|
|
CHANNEL_DELETE: value.handleChannelDelete, CHANNEL_UPDATES: value.handleChannelUpdates,
|
|
GUILD_CREATE: value.handleGuildCreateOrUpdate, GUILD_UPDATE: value.handleGuildCreateOrUpdate,
|
|
GUILD_DELETE: value.handleGuildDelete, RELATIONSHIP_ADD: value.handleRelationshipChange,
|
|
RELATIONSHIP_REMOVE: value.handleRelationshipChange, RELATIONSHIP_UPDATE: value.handleRelationshipChange,
|
|
THREAD_CREATE: value.handleChannelCreate, THREAD_DELETE: value.handleChannelDelete,
|
|
THREAD_UPDATE: value.handleThreadUpdate, USER_UPDATE: value.handleUserUpdate};
|
|
return value;
|
|
}
|
|
|
|
function value_125159() { // fn#125159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:5937, offset: 0x025d03a1, size: 95 bytes, params: 1, frame: 13
|
|
setChannelActivity(SelectedChannelStore.getCurrentlySelectedChannelId());
|
|
if (clearEnabled()) {
|
|
(importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */).clearSearchIndex();
|
|
}
|
|
if (indexingEnabled()) {
|
|
initializeIndex();
|
|
}
|
|
function initializeIndex() { // fn#125160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:6065, owner: value_125159.initializeIndex, offset: 0x025d0400, size: 176 bytes, params: 1, frame: 21
|
|
var environment;
|
|
var value3;
|
|
var items2;
|
|
var mutablePrivateChannels;
|
|
var propertyName;
|
|
var property;
|
|
const value = environment.__proto__.__proto__;
|
|
if (indexingEnabled()) {
|
|
value3 = GuildStore.getGuildsArray().map(function(a0) {
|
|
return makeGuildDomain(a0);
|
|
});
|
|
items2 = [];
|
|
mutablePrivateChannels = ChannelStore.getMutablePrivateChannels();
|
|
for (propertyName in mutablePrivateChannels) {
|
|
property = mutablePrivateChannels[propertyName];
|
|
items2.push(makeSearchItem(property));
|
|
}
|
|
value3.push({id: ME, items: items2});
|
|
(importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */).indexDomains(value3);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function value_125162() { // fn#125162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:6338, offset: 0x025d04c3, size: 48 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
if (clearEnabled()) {
|
|
(importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */).clearSearchIndex();
|
|
}
|
|
}
|
|
|
|
function value_125164({channel}) { // fn#125164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:6509, offset: 0x025d050b, size: 200 bytes, params: 2, frame: 20
|
|
var permissionStoreBinding;
|
|
var guildStoreBinding;
|
|
var value3;
|
|
var guildThumbnail;
|
|
var defaultImport;
|
|
var indexDomains;
|
|
var object;
|
|
const value = environment.__proto__;
|
|
if (indexingEnabled()) {
|
|
permissionStoreBinding = PermissionStore;
|
|
if (permissionStoreBinding.can(Permissions.VIEW_CHANNEL, channel)) {
|
|
guildStoreBinding = GuildStore;
|
|
value3 = guildStoreBinding.getGuild(channel.guild_id);
|
|
if (value3 != null) {
|
|
guildThumbnail = getGuildThumbnail(value3);
|
|
defaultImport = importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */;
|
|
indexDomains = defaultImport.indexDomains;
|
|
object = {};
|
|
object.id = value3?.id ?? ME;
|
|
object.items = [makeSearchItem(channel, value3)];
|
|
object.defaultThumbnailURL = guildThumbnail;
|
|
Reflect.apply(indexDomains, defaultImport, [[object]]);
|
|
} else if (channel.guild_id == null) {
|
|
guildThumbnail = getGuildThumbnail(value3);
|
|
defaultImport = importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */;
|
|
indexDomains = defaultImport.indexDomains;
|
|
object = {};
|
|
object.id = value3?.id ?? ME;
|
|
object.items = [makeSearchItem(channel, value3)];
|
|
object.defaultThumbnailURL = guildThumbnail;
|
|
Reflect.apply(indexDomains, defaultImport, [[object]]);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_125165({channel}) { // fn#125165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:6821, offset: 0x025d05d3, size: 70 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__;
|
|
if (indexingEnabled()) {
|
|
value = importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */;
|
|
value.deleteSearchItems([channel.id]);
|
|
}
|
|
}
|
|
|
|
function value_125167({guild, type}) { // fn#125167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:7020, offset: 0x025d0632, size: 163 bytes, params: 2, frame: 17
|
|
var guildStoreBinding;
|
|
var value2;
|
|
var defaultImport;
|
|
let value = environment.__proto__;
|
|
if (indexingEnabled()) {
|
|
guildStoreBinding = GuildStore;
|
|
value2 = guildStoreBinding.getGuild(guild.id);
|
|
if (value2 != null) {
|
|
defaultImport = importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */;
|
|
defaultImport.indexDomains([makeGuildDomain(value2, type === 'GUILD_UPDATE')]);
|
|
} else {
|
|
value = importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */;
|
|
value.deleteSearchDomains([guild.id]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_125168({guild}) { // fn#125168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16402:7234, offset: 0x025d06d5, size: 70 bytes, params: 2, frame: 13
|
|
let value = environment.__proto__;
|
|
if (indexingEnabled()) {
|
|
value = importDefault(16196) /* metro dependency 16196: IntentsBindingsAndroid */;
|
|
value.deleteSearchDomains([guild.id]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun125140, 16194, [6, 7, 15, 17, 18, 57, 1379, 1867, 3784, 3793, 1934, 1878, 661, 16195, 16196, 4805,
|
|
10254, 1423, 1360, 3995, 4860,
|
|
2]) /* metro module 16194, dependencies: [6, 7, 15, 17, 18, 57, 1379, 1867, 3784, 3793, 1934, 1878, 661, 16195, 16196, 4805, 10254, 1423, 1360, 3995, 4860, 2] */;
|