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

170 lines
8.4 KiB
TypeScript

/* Metro module 4111; source: stores/GuildMemberCountStore.tsx; dependencies: [6, 7, 15, 17, 18, 566, 694, 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 * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun33747(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:6, offset: 0x0103abe9, size: 336 bytes, params: 8, frame: 19
const INVITE_ACCEPT_SUCCESS_337512 = INVITE_ACCEPT_SUCCESS_33751;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let env0_5 = {};
const env0_6 = {};
const Store = (Flux).Store;
let value = _fun33752(Store);
value.displayName = 'GuildMemberCountStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function({guilds}) {
env0_5 = {};
guilds.forEach(_fun33758);
}, OVERLAY_INITIALIZE: function(a0) {
var object = {};
copyDataProperties(object, a0.guildMemberCounts, object);
env0_5 = object;
}, GUILD_CREATE: GUILD_CREATE_33760, GUILD_DELETE: GUILD_DELETE_33761,
GUILD_MEMBER_LIST_UPDATE: GUILD_MEMBER_LIST_UPDATE, INVITE_ACCEPT_SUCCESS: INVITE_ACCEPT_SUCCESS_337512,
INVITE_RESOLVE_SUCCESS: INVITE_ACCEPT_SUCCESS_337512,
ONLINE_GUILD_MEMBER_COUNT_UPDATE: ONLINE_GUILD_MEMBER_COUNT_UPDATE});
(FileImportTrackerModule).fileFinishedImporting('stores/GuildMemberCountStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_33748() { // fn#33748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:148, offset: 0x0103ad39, 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_33748_isNativeReflectConstruct = function() {
return !!result;
})();
}
function INVITE_ACCEPT_SUCCESS_33751({invite}) { // fn#33751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:355, offset: 0x0103ad97, size: 68 bytes, params: 2, frame: 6
const guild = invite.guild;
const approximate_presence_count = invite.approximate_presence_count;
if (guild?.id == null) {
return false;
}
if (approximate_presence_count == null) {
return false;
}
env0_6[guild.id] = approximate_presence_count;
}
function _fun33752(a0) { // fn#33752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:503, offset: 0x0103addb, size: 116 bytes, params: 2, frame: 16
const GuildMemberCountStore2 = GuildMemberCountStore;
Inherits(GuildMemberCountStore2, a0);
return CreateClass(GuildMemberCountStore2, [{key: 'getMemberCounts', value: value_33754}, {key: 'getMemberCount',
value: value_33755}, {key: 'getOnlineCount', value: value_33756}]);
function GuildMemberCountStore() { // fn#33753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:515, offset: 0x00e3db8d, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_0(this, GuildMemberCountStore);
const value3 = env1_3(GuildMemberCountStore);
return env1_2(this, _isNativeReflectConstruct_33748() ? global.Reflect.construct(value3, arguments,
env1_3(this).constructor) : value3.apply(this, arguments));
}
function value_33754() { // fn#33754, offset: 0x00e40571, size: 9 bytes, params: 1, frame: 1
return env1_5;
}
function value_33755(a0) { // fn#33755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:893, offset: 0x0103ae4f, size: 25 bytes, params: 2, frame: 3
const value = null;
return value != a0 ? env1_5[a0] : value;
}
function value_33756(a0) { // fn#33756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:960, offset: 0x0103ae68, size: 25 bytes, params: 2, frame: 3
const value = null;
return value != a0 ? env1_6[a0] : value;
}
}
function CONNECTION_OPEN_33757({guilds}) { // fn#33757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:1092, offset: 0x0103ae81, size: 39 bytes, params: 2, frame: 11
env0_5 = {};
guilds.forEach(_fun33758);
function _fun33758({id, member_count}) { // fn#33758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:1150, offset: 0x0103aea8, size: 29 bytes, params: 2, frame: 3
env1_5[id] = member_count;
}
}
function GUILD_CREATE_33760({guild}) { // fn#33760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:1277, offset: 0x0103aee4, size: 34 bytes, params: 2, frame: 3
env0_5[guild.id] = guild.member_count;
}
function GUILD_DELETE_33761({guild}) { // fn#33761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:1352, offset: 0x0103af06, size: 81 bytes, params: 2, frame: 5
let binding = env0_5;
let id = guild.id;
if (binding[id] != null) {
binding = env0_5;
id = guild.id;
delete binding[id];
binding = env0_6;
id = guild.id;
delete binding[id];
} else {
binding = env0_6;
id = guild.id;
if (binding[id] == null) {
return false;
}
binding = env0_5;
id = guild.id;
delete binding[id];
binding = env0_6;
id = guild.id;
delete binding[id];
}
}
function GUILD_MEMBER_LIST_UPDATE({guildId, memberCount, onlineCount}) { // fn#33762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:1487, offset: 0x0103af57, size: 71 bytes, params: 2, frame: 6
var r0;
if (env0_5[guildId] === memberCount) {
r0 = false;
} else {
env0_5[guildId] = memberCount;
r0 = true;
}
if (env0_6[guildId] !== onlineCount) {
env0_6[guildId] = onlineCount;
r0 = true;
}
return r0;
}
function ONLINE_GUILD_MEMBER_COUNT_UPDATE({guildId, count}) { // fn#33763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4276:1744, offset: 0x0103af9e, size: 42 bytes, params: 2, frame: 4
if (guildId == null) {
return false;
}
if (count == null) {
return false;
}
env0_6[guildId] = count;
}
}
global.__d(_fun33747, 4111, [6, 7, 15, 17, 18, 566, 694,
2]) /* metro module 4111, dependencies: [6, 7, 15, 17, 18, 566, 694, 2] */;