Files
discord-decomp/sources/stores/GuildMemberRequesterStore.tsx
T
2026-07-28 01:06:53 +03:00

364 lines
17 KiB
TypeScript

/* Metro module 6269; source: stores/GuildMemberRequesterStore.tsx; dependencies: [6, 7, 15, 17, 18, 1379, 1945, 6270, 694, 566, 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 Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
import ChannelStore from './ChannelStore.tsx'; /* Metro dependency 1379 */
import GuildMemberStore from './GuildMemberStore.tsx'; /* Metro dependency 1945 */
import GuildMemberRequester from '../lib/guild/GuildMemberRequester.tsx'; /* Metro dependency 6270 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun49494(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#49494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:6, offset: 0x011fb985, size: 467 bytes, params: 8, frame: 22
const _arrayLikeToArray_49500 = 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 CONNECTION_CLOSED_495012 = CONNECTION_CLOSED_49501;
const requestFromMessages = function(a0, a1) {
var env0_0 = a0;
a1.forEach(_fun49504);
return false;
};
const LOCAL_MESSAGES_LOADED_495062 = LOCAL_MESSAGES_LOADED_49506;
const closure3 = function({guildId, data}) {
var env0_0 = undefined;
if (guildId != null) {
var items = [];
env0_0 = items;
data.forEach(_fun49508);
requestFromMessages(guildId, items);
}
return false;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value3 = new (GuildMemberRequester)((GuildMemberStore).isMember,
_fun49511);
const Store = (Flux).Store;
_fun49512(Store).displayName = 'GuildMemberRequesterStore';
value3 = new value3(importDefault(694) /* metro dependency 694: Dispatcher */,
{CONNECTION_CLOSED: CONNECTION_CLOSED_495012, CONNECTION_OPEN: CONNECTION_CLOSED_495012,
CONNECTION_RESUMED: CONNECTION_RESUMED_49517, GUILD_MEMBERS_CHUNK_BATCH: GUILD_MEMBERS_CHUNK_BATCH_49518,
SEARCH_MESSAGES_SUCCESS: closure3, MOD_VIEW_SEARCH_MESSAGES_SUCCESS: closure3,
LOCAL_MESSAGES_LOADED: LOCAL_MESSAGES_LOADED_495062, LOAD_MESSAGES_SUCCESS: LOCAL_MESSAGES_LOADED_495062,
LOAD_MESSAGES_AROUND_SUCCESS: LOCAL_MESSAGES_LOADED_495062,
LOAD_RECENT_MENTIONS_SUCCESS: LOCAL_MESSAGES_LOADED_495062,
LOAD_PINNED_MESSAGES_SUCCESS: LOAD_PINNED_MESSAGES_SUCCESS_49522,
CONVERSATION_FETCH_SUCCESS: CONVERSATION_FETCH_SUCCESS_49524});
(FileImportTrackerModule).fileFinishedImporting('stores/GuildMemberRequesterStore.tsx');
exports.default = value3;
function _isNativeReflectConstruct_49495() { // fn#49495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:170, offset: 0x011fbb58, size: 94 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_49495_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_49498(a0, a1) { // fn#49498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:363, offset: 0x011fbbb6, size: 370 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 _fun49499;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_49500(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_49500(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_49500(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun49499;
}
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 _fun49499() { // fn#49499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:934, 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 CONNECTION_CLOSED_49501() { // fn#49501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1387, offset: 0x00dea138, size: 21 bytes, params: 1, frame: 9
env0_9.reset();
}
function _requestMember(a0, a1) { // fn#49502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1430, offset: 0x011fbd28, size: 29 bytes, params: 3, frame: 13
env0_9.request(a0, a1);
return false;
}
function requestFromMessages(a0, a1) { // fn#49503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1484, offset: 0x011fbd45, size: 31 bytes, params: 3, frame: 11
const env0_0 = a0;
a1.forEach(_fun49504);
return false;
function _fun49504({author, mentions}) { // fn#49504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1536, offset: 0x011fbd64, size: 73 bytes, params: 2, frame: 15
var environment;
var value;
if (author != null) {
value = environment.__proto__;
_requestMember(env0_0, author.id);
}
if (mentions != null) {
mentions.forEach(_fun49505);
}
function _fun49505({id}) { // fn#49505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1614, offset: 0x011fbdad, size: 34 bytes, params: 2, frame: 13
_requestMember(env1_0, id);
return false;
}
}
}
function LOAD_MESSAGES_AROUND_SUCCESS_49506({channelId, messages}) { // fn#49506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1648, offset: 0x011fbdcf, size: 73 bytes, params: 2, frame: 15
const channel = ChannelStore.getChannel(channelId);
let r0 = channel != null && channel.guild_id != null;
if (r0) {
requestFromMessages(channel.guild_id, messages);
r0 = false;
}
return r0;
}
function MOD_VIEW_SEARCH_MESSAGES_SUCCESS_49507({guildId, data}) { // fn#49507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1792, offset: 0x011fbe18, size: 71 bytes, params: 2, frame: 15
if (guildId != null) {
data.forEach(function({messages}) {
messages.forEach(_fun49509);
});
requestFromMessages(guildId, []);
}
return false;
function _fun49508({messages}) { // fn#49508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1892, offset: 0x011fbe5f, size: 30 bytes, params: 2, frame: 11
messages.forEach(function(a0) {
a0.forEach(_fun49510);
});
function _fun49509(a0) { // fn#49509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1920, offset: 0x011fbe7d, size: 24 bytes, params: 2, frame: 11
a0.forEach(_fun49510);
function _fun49510(a0) { // fn#49510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1935, offset: 0x00ef6117, size: 24 bytes, params: 2, frame: 11
env2_0.push(a0);
}
}
}
}
function _fun49511(a0, a1) { // fn#49511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1304, offset: 0x011fbe95, size: 71 bytes, params: 3, frame: 14
(Dispatcher).dispatch({type: 'GUILD_MEMBERS_REQUEST', guildIds: [a0],
userIds: a1});
}
function _fun49512(a0) { // fn#49512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:1989, offset: 0x011fbedc, size: 116 bytes, params: 2, frame: 16
const GuildMemberRequesterStore2 = GuildMemberRequesterStore;
Inherits(GuildMemberRequesterStore2, a0);
return CreateClass(GuildMemberRequesterStore2, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore, guildMemberStore);
}}, {key: 'requestMember', value: function(a0, a1) {
_requestMember(a0, a1);
}}, {key: 'getDebugState', value: value_49516}]);
function GuildMemberRequesterStore() { // fn#49513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:2001, offset: 0x00ec62ac, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_2(this, GuildMemberRequesterStore);
const value3 = env1_5(GuildMemberRequesterStore);
return env1_4(this, _isNativeReflectConstruct_49495() ? global.Reflect.construct(value3, arguments,
env1_5(this).constructor) : value3.apply(this, arguments));
}
function value_49516(a0) { // fn#49516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:2490, offset: 0x011fbf67, size: 25 bytes, params: 2, frame: 11
return env1_9.getDebugState(a0);
}
}
function CONNECTION_RESUMED_49517() { // fn#49517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:2722, offset: 0x011fbf80, size: 21 bytes, params: 1, frame: 9
env0_9.requestUnacknowledged();
return false;
}
function GUILD_MEMBERS_CHUNK_BATCH_49518({chunks}) { // fn#49518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:2820, offset: 0x011fbf95, size: 71 bytes, params: 2, frame: 14
var r1;
var value3;
var value4;
const closure = function(a0) {
var env0_0 = a0;
a0.members.forEach(_fun49520);
if (a0.notFound != null) {
a0.notFound.forEach(_fun49521);
}
};
const value = _createForOfIteratorHelperLoose_49498(chunks);
const value2 = value();
let done = value2.done;
if (!done) {
for (r1 = value2; true; r1 = value4) {
value3 = r1.value;
closure(value3);
value4 = value();
done = value4.done;
if (done) {
break;
}
}
}
return false;
function GUILD_MEMBERS_CHUNK_BATCH_49518_loop(a0) { // fn#49519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:2886, owner: GUILD_MEMBERS_CHUNK_BATCH_49518._loop, offset: 0x011fbfdc, size: 67 bytes, params: 2, frame: 13
const env0_0 = a0;
a0.members.forEach(_fun49520);
if (a0.notFound != null) {
a0.notFound.forEach(_fun49521);
}
function _fun49520({user}) { // fn#49520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:2917, offset: 0x011fc01f, size: 48 bytes, params: 2, frame: 13
const binding = env2_9;
binding.acknowledge(env0_0.guildId, user.id);
}
function _fun49521(a0) { // fn#49521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:2997, offset: 0x011fc04f, size: 36 bytes, params: 2, frame: 13
const binding = env2_9;
return binding.acknowledge(env0_0.guildId, a0);
}
}
}
function LOAD_PINNED_MESSAGES_SUCCESS_49522({pins, channelId}) { // fn#49522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:3420, offset: 0x011fc073, size: 90 bytes, params: 2, frame: 15
var guild_id;
var requestFromMessagesBinding;
var value;
const channel = ChannelStore.getChannel(channelId);
let r0 = channel != null && channel.guild_id != null;
if (r0) {
requestFromMessagesBinding = requestFromMessages;
guild_id = channel.guild_id;
value = pins.map(function(a0) {
return a0.message;
});
requestFromMessagesBinding(guild_id, value);
value = false;
r0 = value;
}
return r0;
}
function CONVERSATION_FETCH_SUCCESS_49524({channelId, messages}) { // fn#49524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6447:3618, offset: 0x011fbdcf, size: 73 bytes, params: 2, frame: 15
const channel = ChannelStore.getChannel(channelId);
let r0 = channel != null && channel.guild_id != null;
if (r0) {
requestFromMessages(channel.guild_id, messages);
r0 = false;
}
return r0;
}
}
global.__d(_fun49494, 6269, [6, 7, 15, 17, 18, 1379, 1945, 6270, 694, 566,
2]) /* metro module 6269, dependencies: [6, 7, 15, 17, 18, 1379, 1945, 6270, 694, 566, 2] */;