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

617 lines
30 KiB
TypeScript

/* Metro module 6866; source: stores/GuildSubscriptionsStore.tsx; dependencies: [6, 7, 15, 17, 18, 57, 4107, 3785, 6867, 1226, 6875, 4791, 1379, 4646, 1945, 1867, 4294, 3793, 1934, 3969, 661, 6888, 694, 22, 6892, 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 Module00022 from '../by-id/module-00022.js'; /* Metro dependency 22 */
import Module00057 from '../by-id/module-00057.js'; /* Metro dependency 57 */
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
import AuthenticationStore from './AuthenticationStore.tsx'; /* Metro dependency 1226 */
import ChannelStore from './ChannelStore.tsx'; /* Metro dependency 1379 */
import GuildStore from './GuildStore.tsx'; /* Metro dependency 1867 */
import SelectedChannelStore from './SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import GuildMemberStore from './GuildMemberStore.tsx'; /* Metro dependency 1945 */
import LurkingStore from '../modules/lurker_mode/LurkingStore.tsx'; /* Metro dependency 3785 */
import RelationshipStore from './RelationshipStore.tsx'; /* Metro dependency 3793 */
import SelectedGuildStore from './SelectedGuildStore.tsx'; /* Metro dependency 3969 */
import ExperimentStore from '../modules/experiments/ExperimentStore.tsx'; /* Metro dependency 4107 */
import RTCConnectionStore from './RTCConnectionStore.tsx'; /* Metro dependency 4294 */
import GuildAvailabilityStore from './GuildAvailabilityStore.tsx'; /* Metro dependency 4646 */
import ChannelSectionStore from './ChannelSectionStore.tsx'; /* Metro dependency 4791 */
import SpotifyStore from '../modules/spotify/SpotifyStore.tsx'; /* Metro dependency 6867 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
import * as ChannelMemberStoreModule from './ChannelMemberStore.tsx'; /* Metro dependency 6875 */
import * as FavoritesUtilsModule from '../modules/favorites/FavoritesUtils.tsx'; /* Metro dependency 6892 */
function _fun54229(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:6, offset: 0x0135fcce, size: 837 bytes, params: 8, frame: 22
const env0_0 = require;
const _arrayLikeToArray_54235 = 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_OPEN_542392 = CONNECTION_OPEN_54239;
const VOICE_CHANNEL_SELECT_542412 = VOICE_CHANNEL_SELECT_54241;
const THREAD_LIST_SYNC_542422 = THREAD_LIST_SYNC_54242;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ConstantsModule;
value.ChannelSections;
const env0_24 = value.ChannelTypes;
const env0_25 = value.FAVORITES;
value = importDefault(6888) /* metro dependency 6888: GuildSubscriptions */;
value = new value(_fun54244);
const Store = (Flux).Store;
_fun54245(Store).displayName = 'GuildSubscriptionsStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{CONNECTION_OPEN: CONNECTION_OPEN_542392, CONNECTION_RESUMED: CONNECTION_OPEN_542392,
CONNECTION_CLOSED: function() {
prune_54236(false, false);
}, IDLE: IDLE_54254, LOGOUT: LOGOUT_54255, VOICE_CHANNEL_SELECT: VOICE_CHANNEL_SELECT_542412,
CHANNEL_SELECT: VOICE_CHANNEL_SELECT_542412, GUILD_CREATE: function(a0) {
if (a0.guild.id === SelectedGuildStore.getGuildId()) {
THREAD_LIST_SYNC_54242();
}
}, GUILD_DELETE: GUILD_DELETE_54257, GUILD_SUBSCRIPTIONS_MEMBERS_ADD: function({guildId, userIds}) {
userIds.forEach(_fun54259);
return false;
}, GUILD_SUBSCRIPTIONS_MEMBERS_REMOVE: function({guildId, userIds}) {
userIds.forEach(_fun54261);
return false;
}, GUILD_SUBSCRIPTIONS_ADD_MEMBER_UPDATES: GUILD_SUBSCRIPTIONS_ADD_MEMBER_UPDATES,
GUILD_SUBSCRIPTIONS_REMOVE_MEMBER_UPDATES: GUILD_SUBSCRIPTIONS_REMOVE_MEMBER_UPDATES,
GUILD_SUBSCRIPTIONS_CHANNEL: GUILD_SUBSCRIPTIONS_CHANNEL, GUILD_SUBSCRIPTIONS: GUILD_SUBSCRIPTIONS,
CHANNEL_PRELOAD: function({guildId, channelId}) {
subscribe_54238(guildId, channelId);
return false;
}, INBOX_OPEN: INBOX_OPEN, THREAD_UPDATE: THREAD_UPDATE_54268, THREAD_DELETE: THREAD_DELETE_54269,
THREAD_LIST_SYNC: THREAD_LIST_SYNC_542422});
(FileImportTrackerModule).fileFinishedImporting('stores/GuildSubscriptionsStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_54230() { // fn#54230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:396, offset: 0x01360013, 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_54230_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_54233(a0, a1) { // fn#54233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:589, offset: 0x01360071, 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 _fun54234;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_54235(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_54235(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_54235(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun54234;
}
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 _fun54234() { // fn#54234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:1160, 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 prune_54236(a0, a1) { // fn#54236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:1665, offset: 0x013601e3, size: 129 bytes, params: 3, frame: 14
const env0_0 = a0;
const env0_1 = a1;
const object = {};
var value;
env0_26.forEach(_fun54237);
const defaultImport = Module00022;
if (!defaultImport.isEmpty(object)) {
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.dispatch({type: 'GUILD_SUBSCRIPTIONS_FLUSH', subscriptions: object});
}
function _fun54237(a0) { // fn#54237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:1705, offset: 0x01360264, size: 192 bytes, params: 2, frame: 16
var binding;
var binding2;
const selectedGuildStoreBinding = SelectedGuildStore;
const getGuildId = selectedGuildStoreBinding.getGuildId;
let r1 = a0 === Reflect.apply(getGuildId, selectedGuildStoreBinding, []) || a0 === RTCConnectionStore.getGuildId();
r1 = !r1 ? a0 === ChannelStore.getChannel(SelectedChannelStore.getChannelId())?.getGuildId() : r1;
r1 = !r1 ? env1_3 != null && env1_3.guildId === a0 : r1;
if (!r1) {
binding = env1_26;
binding.clearWithoutFlushing(a0, env0_0);
if (require) {
binding = env0_2;
binding2 = env1_26;
binding[a0] = binding2.get(a0);
}
}
}
}
function subscribe_54238(a0, a1) { // fn#54238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:1992, offset: 0x01360324, size: 119 bytes, params: 3, frame: 16
var r2;
var channel;
const value = a0;
const value3 = undefined;
if (FavoritesUtilsModule.isFavoritesGuildId(value)) {
if (a1 == null) {
r2 = value;
} else {
channel = ChannelStore.getChannel(a1);
r2 = (channel == null ? value3 : channel.getGuildId()) ?? value;
}
} else {
r2 = value;
}
env0_26.subscribeToGuild(r2);
return false;
}
function CONNECTION_OPEN_54239({type}) { // fn#54239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:2162, offset: 0x0136039b, size: 271 bytes, params: 2, frame: 16
var value;
var subscribe_54238Binding;
var selectedChannelStoreBinding;
if (type === 'CONNECTION_OPEN') {
prune_54236(true, false);
}
const guildId = SelectedGuildStore.getGuildId();
if (guildId != null) {
subscribe_54238Binding = subscribe_54238;
selectedChannelStoreBinding = SelectedChannelStore;
subscribe_54238Binding(guildId, selectedChannelStoreBinding.getChannelId(guildId));
}
const object = {};
const Set = global.Set;
const set = new Set(LurkingStore.lurkingGuildIds());
const env0_2 = LurkingStore.mostRecentLurkedGuildId();
env0_26.forEach(_fun54240);
const defaultImport = Module00022;
if (!defaultImport.isEmpty(object)) {
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.dispatch({type: 'GUILD_SUBSCRIPTIONS_FLUSH', subscriptions: object});
}
function _fun54240(a0) { // fn#54240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:2389, offset: 0x013604aa, size: 104 bytes, params: 2, frame: 14
var binding;
var binding2;
if (GuildStore.getGuild(a0) == null) {
env1_26.clearWithoutFlushing(a0, true);
} else {
binding = env0_1;
if (!(binding.has(a0) && a0 !== env0_2)) {
binding = env0_0;
binding2 = env1_26;
binding[a0] = binding2.get(a0);
}
}
}
}
function CHANNEL_SELECT_54241({guildId, channelId}) { // fn#54241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:2569, offset: 0x01360512, size: 53 bytes, params: 2, frame: 14
var r0;
const isUnavailable2 = GuildAvailabilityStore.isUnavailable(guildId);
if (isUnavailable2) {
r0 = !isUnavailable2;
} else {
subscribe_54238(guildId, channelId);
r0 = false;
}
return r0;
}
function THREAD_LIST_SYNC_54242() { // fn#54242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:2665, offset: 0x01360547, size: 47 bytes, params: 1, frame: 13
subscribe_54238(SelectedGuildStore.getGuildId(), SelectedChannelStore.getChannelId());
return false;
}
function handleSpotifyUpdate() { // fn#54243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:2738, offset: 0x01360576, size: 209 bytes, params: 1, frame: 17
var object3;
var userId;
var relationshipStoreBinding;
var value3;
var property;
var object;
var binding;
const syncingWith = SpotifyStore.getSyncingWith();
if (syncingWith == null) {
if (object3 != null) {
binding = env0_26;
binding.unsubscribeUser(object3.guildId, object3.userId);
}
} else {
userId = syncingWith.userId;
if (object3 == null) {
relationshipStoreBinding = RelationshipStore;
if (relationshipStoreBinding.isFriend(userId)) {
return false;
}
value3 = GuildMemberStore.memberOf(userId);
if (value3.length === 0) {
return false;
}
property = Module00057(value3, 1)[0];
object3 = {guildId: property, userId: userId};
env0_26.subscribeUser(property, userId);
return false;
}
var userId2 = object3.userId;
if (userId2 === userId) {
return false;
}
relationshipStoreBinding = RelationshipStore;
if (relationshipStoreBinding.isFriend(userId)) {
return false;
}
value3 = GuildMemberStore.memberOf(userId);
if (value3.length === 0) {
return false;
}
property = Module00057(value3, 1)[0];
object = {guildId: property, userId: userId};
env0_26.subscribeUser(property, userId);
}
return false;
}
function _fun54244(a0) { // fn#54244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:1520, offset: 0x01360647, size: 128 bytes, params: 2, frame: 20
var r5;
var r9;
var propertyName;
var propertyName2;
var guildStoreBinding;
var getGuild;
var value2;
var isUnavailable2;
for (propertyName in a0) {
guildStoreBinding = GuildStore;
getGuild = guildStoreBinding.getGuild;
value2 = Reflect.apply(getGuild, guildStoreBinding, [propertyName]) != null;
if (value2) {
r9 = value2;
continue;
}
isUnavailable2 = GuildAvailabilityStore.isUnavailable(propertyName);
r9 = isUnavailable2;
if (r9) {
r5 = propertyName2;
continue;
}
delete a0[propertyName];
r5 = propertyName2;
}
(Dispatcher).dispatch({type: 'GUILD_SUBSCRIPTIONS_FLUSH',
subscriptions: a0});
}
function _fun54245(a0) { // fn#54245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:3061, offset: 0x013606c7, size: 187 bytes, params: 2, frame: 16
const GuildSubscriptionsStore2 = GuildSubscriptionsStore;
Inherits(GuildSubscriptionsStore2, a0);
return CreateClass(GuildSubscriptionsStore2, [{key: 'initialize', value: value_54247}, {key: 'getSubscribedThreadIds',
value: value_54248}, {key: 'isSubscribedToThreads', value: value_54249}, {key: 'isSubscribedToAnyMember',
value: value_54250}, {key: 'isSubscribedToMemberUpdates', value: value_54251},
{key: 'isSubscribedToAnyGuildChannel', value: value_54252}]);
function GuildSubscriptionsStore() { // fn#54246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:3073, offset: 0x01360782, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_4(this, GuildSubscriptionsStore);
const value3 = env1_7(GuildSubscriptionsStore);
return env1_6(this, _isNativeReflectConstruct_54230() ? global.Reflect.construct(value3, arguments,
env1_7(this).constructor) : value3.apply(this, arguments));
}
function value_54247() { // fn#54247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:3406, offset: 0x013607f3, size: 130 bytes, params: 1, frame: 36
const waitFor = this.waitFor;
const authenticationStoreBinding = AuthenticationStore;
const channelSectionStoreBinding = ChannelSectionStore;
Reflect.apply(waitFor, this, [authenticationStoreBinding, channelSectionStoreBinding, ChannelStore, ExperimentStore,
GuildAvailabilityStore, GuildMemberStore, GuildStore, LurkingStore, RTCConnectionStore, RelationshipStore,
SelectedChannelStore, SelectedGuildStore, SpotifyStore]);
this.syncWith([SpotifyStore], handleSpotifyUpdate);
this.syncWith([channelSectionStoreBinding], THREAD_LIST_SYNC_54242);
}
function value_54248() { // fn#54248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:3565, offset: 0x01360875, size: 19 bytes, params: 1, frame: 9
return env1_26.getSubscribedThreadIds();
}
function value_54249(a0) { // fn#54249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:3647, offset: 0x01360888, size: 23 bytes, params: 2, frame: 11
return env1_26.isSubscribedToThreads(a0);
}
function value_54250(a0) { // fn#54250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:3732, offset: 0x0136089f, size: 23 bytes, params: 2, frame: 11
return env1_26.isSubscribedToAnyMember(a0);
}
function value_54251(a0) { // fn#54251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:3823, offset: 0x013608b6, size: 25 bytes, params: 2, frame: 11
return env1_26.isSubscribedToMemberUpdates(a0);
}
function value_54252(a0) { // fn#54252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:3920, offset: 0x013608cf, size: 66 bytes, params: 2, frame: 12
const value = environment.__proto__;
const binding = env1_26;
const get = binding.get;
const channels = Reflect.apply(get, binding, [a0]).channels;
return channels != null && global.Object.keys(channels).length > 0;
}
}
function IDLE_54254(a0) { // fn#54254, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:4245, offset: 0x01360924, size: 35 bytes, params: 2, frame: 13
if (a0.idle) {
prune_54236(false, true);
return undefined;
}
return false;
}
function LOGOUT_54255() { // fn#54255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:4311, offset: 0x01360947, size: 21 bytes, params: 1, frame: 9
env0_26.reset();
}
function GUILD_DELETE_54257({guild}) { // fn#54257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:4524, offset: 0x0136098c, size: 38 bytes, params: 2, frame: 13
const binding = env0_26;
binding.clearWithoutFlushing(guild.id, true);
}
function GUILD_SUBSCRIPTIONS_MEMBERS_ADD({guildId, userIds}) { // fn#54258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:4627, offset: 0x013609b2, size: 39 bytes, params: 2, frame: 11
userIds.forEach(_fun54259);
return false;
function _fun54259(a0) { // fn#54259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:4694, offset: 0x013609d9, size: 51 bytes, params: 2, frame: 13
var binding;
const authenticationStoreBinding = AuthenticationStore;
const getId = authenticationStoreBinding.getId;
if (a0 !== Reflect.apply(getId, authenticationStoreBinding, [])) {
binding = env1_26;
binding.subscribeUser(guildId, a0);
}
}
}
function GUILD_SUBSCRIPTIONS_MEMBERS_REMOVE({guildId, userIds}) { // fn#54260, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:4776, offset: 0x01360a0c, size: 39 bytes, params: 2, frame: 11
userIds.forEach(_fun54261);
return false;
function _fun54261(a0) { // fn#54261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:4846, offset: 0x01360a33, size: 33 bytes, params: 2, frame: 13
const binding = env1_26;
binding.unsubscribeUser(guildId, a0);
}
}
function GUILD_SUBSCRIPTIONS_ADD_MEMBER_UPDATES({guildId}) { // fn#54262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:4919, offset: 0x01360a54, size: 30 bytes, params: 2, frame: 11
env0_26.subscribeToMemberUpdates(guildId);
}
function GUILD_SUBSCRIPTIONS_REMOVE_MEMBER_UPDATES({guildId}) { // fn#54263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:5054, offset: 0x01360a72, size: 30 bytes, params: 2, frame: 11
env0_26.unsubscribeFromMemberUpdates(guildId);
}
function GUILD_SUBSCRIPTIONS_CHANNEL({guildId, channelId, ranges}) { // fn#54264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:5182, offset: 0x01360a90, size: 261 bytes, params: 2, frame: 23
var r6;
var r2;
var r0;
var channel;
var guildId2;
var binding;
var isActiveThread2;
if (channelId === EVERYONE_CHANNEL_ID) {
r0 = env0_26.subscribeChannel(guildId, channelId, ranges);
} else {
channel = ChannelStore.getChannel(channelId);
if (channel == null) {
r0 = false;
} else {
guildId2 = channel.getGuildId();
r6 = guildId2 !== guildId && guildId === FAVORITES;
if (r6) {
env0_26.subscribeToGuild(guildId2);
}
if (channel == null) {
r2 = env0_26.subscribeChannel(guildId2, channelId, ranges);
} else if (channel.isThread()) {
if (channel.type === ChannelTypes.ANNOUNCEMENT_THREAD) {
binding = env0_26;
r6 = binding.subscribeChannel(guildId2, channel.parent_id, ranges);
} else {
isActiveThread2 = channel.isActiveThread();
r6 = isActiveThread2 ? env0_26.subscribeThreadMemberList(guildId2, channelId,
SelectedChannelStore.getChannelId()) : !!isActiveThread2;
}
r2 = r6;
} else {
r2 = env0_26.subscribeChannel(guildId2, channelId, ranges);
}
r0 = r2;
}
}
return r0;
}
function GUILD_SUBSCRIPTIONS({guildId}) { // fn#54265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:5645, offset: 0x01360b95, size: 28 bytes, params: 2, frame: 11
return env0_26.subscribeToGuild(guildId);
}
function INBOX_OPEN({guildIds}) { // fn#54267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:5814, offset: 0x01360bd1, size: 80 bytes, params: 2, frame: 16
var r1;
var value4;
var binding;
var value5;
const value2 = _createForOfIteratorHelperLoose_54233(guildIds);
const value3 = value2();
let done = value3.done;
if (!done) {
r1 = value3;
while (true) {
value4 = r1.value;
if (value4 != null) {
binding = env0_26;
binding.subscribeToGuild(value4);
}
value5 = value2();
done = value5.done;
if (done) {
break;
}
r1 = value5;
continue;
}
}
return false;
}
function THREAD_UPDATE_54268({channel}) { // fn#54268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:5985, offset: 0x01360c21, size: 148 bytes, params: 2, frame: 18
var r2;
var r0;
var value;
var selectedChannelStoreBinding;
var id;
var binding;
var subscribeThreadMemberList;
var guild_id;
if (channel.isArchivedThread()) {
binding = env0_26;
r0 = binding.unsubscribeThreadMemberList(channel.guild_id, channel.id);
} else {
value = channel.isActiveThread();
if (value) {
value = SelectedChannelStore.getChannelId();
value = value !== channel.id;
r2 = value;
} else {
r2 = !value;
}
value = !r2;
if (r2) {
r0 = value;
} else {
binding = env0_26;
subscribeThreadMemberList = binding.subscribeThreadMemberList;
guild_id = channel.guild_id;
id = channel.id;
selectedChannelStoreBinding = SelectedChannelStore;
Reflect.apply(subscribeThreadMemberList, binding, [guild_id, id,
selectedChannelStoreBinding.getChannelId()]);
r0 = undefined;
}
}
return r0;
}
function THREAD_DELETE_54269({channel}) { // fn#54269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7044:6232, offset: 0x01360cb5, size: 39 bytes, params: 2, frame: 13
const binding = env0_26;
return binding.unsubscribeThreadMemberList(channel.guild_id, channel.id);
}
}
global.__d(_fun54229, 6866, [6, 7, 15, 17, 18, 57, 4107, 3785, 6867, 1226, 6875, 4791, 1379, 4646, 1945, 1867, 4294,
3793, 1934, 3969, 661, 6888, 694, 22, 6892, 566,
2]) /* metro module 6866, dependencies: [6, 7, 15, 17, 18, 57, 4107, 3785, 6867, 1226, 6875, 4791, 1379, 4646, 1945, 1867, 4294, 3793, 1934, 3969, 661, 6888, 694, 22, 6892, 566, 2] */;