Files
discord-decomp/sources/modules/guild_home/useActiveChannels.tsx
T
2026-07-28 01:06:53 +03:00

208 lines
9.0 KiB
TypeScript

/* Metro module 14495; source: modules/guild_home/useActiveChannels.tsx; dependencies: [1383, 1379, 3784, 4864, 12552, 661, 1386, 1360, 2] */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import UserGuildSettingsStore from '../../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */
import ActiveChannelsStore from './ActiveChannelsStore.tsx'; /* Metro dependency 12552 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as ChannelRecordModule from '../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
import * as ChannelConstantsModule from '../channel/ChannelConstants.tsx'; /* Metro dependency 1386 */
function _fun109691(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109691, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14692:6, offset: 0x02356c0a, size: 228 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/guild_home/useActiveChannels.tsx');
exports.getActiveTextChannels = getActiveTextChannels;
function getActiveTextChannels(a0) { // fn#109692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14692:303, offset: 0x02356cee, size: 320 bytes, params: 2, frame: 18
var r1;
var r6;
var r3;
var item3;
var item4;
var item5;
let value = a1;
const value2 = undefined;
const iterator = (value !== value2 ? value : [ChannelStore, PermissionStore, ActiveChannelsStore,
UserGuildSettingsStore])[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
let r2 = item2 === value2 ? value2 : item;
if (value) {
r1 = item2;
r2 = value2;
r6 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value = item3 === value2;
if (value) {
r1 = item3;
r2 = value2;
r6 = value;
} else {
r1 = item3;
r2 = item;
r6 = value;
}
}
if (r6) {
r3 = value2;
} else {
item4 = Reflect.apply(iterator2, r1, []);
item = item4.value;
item4 = item4.done ? undefined : r1;
value = item4 === value2;
if (value) {
r1 = item4;
r3 = value2;
r6 = value;
} else {
r1 = item4;
r3 = item;
r6 = value;
}
}
if (r6) {
r2 = value2;
} else {
item5 = Reflect.apply(iterator2, r1, []);
item = item5.value;
item5 = item5.done ? undefined : r1;
value = item5 === value2;
if (value) {
r1 = item5;
r2 = value2;
r6 = value;
} else {
r1 = item5;
r2 = item;
r6 = value;
}
}
if (!r6) {
r1.return();
}
value = r3.getActiveChannelIds(a0);
if (value != null) {
value = global.Array.from(value);
r3 = value;
} else {
r3 = [];
}
const env0_2 = r2.getMutedChannels(a0);
value = Reflect.apply(r3.map(_fun109693).filter, value,
[(require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish]);
return value.filter(_fun109694);
function _fun109693(a0) { // fn#109693, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14692:425, offset: 0x02356e2e, size: 22 bytes, params: 2, frame: 11
return env0_0.getChannel(a0);
}
function _fun109694(a0) { // fn#109694, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14692:483, offset: 0x02356e44, size: 247 bytes, params: 2, frame: 16
var r0;
var hasFlag;
var value;
var binding;
var has;
var parent_id;
var value3;
var isThread2;
if (a0 == null) {
value = environment.__proto__;
if (isTextChannel(a0.type)) {
binding = env0_2;
has = binding.has;
if (Reflect.apply(has, binding, [a0.id])) {
return false;
}
parent_id = a0.parent_id;
if (parent_id == null) {
binding = env0_1;
if (binding.can(Permissions.VIEW_CHANNEL, a0)) {
binding = env0_0;
value3 = binding.getChannel(a0.parent_id);
isThread2 = a0.isThread();
r0 = isThread2 ? value3 == null : !isThread2;
r0 = !r0 ? value3 == null : r0;
r0 = !r0 ? !value3.hasFlag(ChannelFlags.ACTIVE_CHANNELS_REMOVED) : r0;
return r0;
}
return false;
}
binding = env0_2;
has = binding.has;
parent_id = a0.parent_id;
if (Reflect.apply(has, binding, [parent_id])) {
return false;
}
binding = env0_1;
if (binding.can(Permissions.VIEW_CHANNEL, a0)) {
binding = env0_0;
value3 = binding.getChannel(a0.parent_id);
isThread2 = a0.isThread();
r0 = isThread2 ? value3 == null : !isThread2;
r0 = !r0 ? value3 == null : r0;
r0 = !r0 ? !value3.hasFlag(ChannelFlags.ACTIVE_CHANNELS_REMOVED) : r0;
return r0;
}
return false;
}
} else {
hasFlag = a0.hasFlag;
value = environment.__proto__;
if (Reflect.apply(hasFlag, a0, [ChannelFlags.ACTIVE_CHANNELS_REMOVED])) {
return false;
}
value = environment.__proto__;
if (isTextChannel(a0.type)) {
binding = env0_2;
has = binding.has;
if (Reflect.apply(has, binding, [a0.id])) {
return false;
}
parent_id = a0.parent_id;
if (parent_id == null) {
binding = env0_1;
if (binding.can(Permissions.VIEW_CHANNEL, a0)) {
binding = env0_0;
value3 = binding.getChannel(a0.parent_id);
isThread2 = a0.isThread();
r0 = isThread2 ? value3 == null : !isThread2;
r0 = !r0 ? value3 == null : r0;
r0 = !r0 ? !value3.hasFlag(ChannelFlags.ACTIVE_CHANNELS_REMOVED) : r0;
return r0;
}
return false;
}
binding = env0_2;
has = binding.has;
parent_id = a0.parent_id;
if (Reflect.apply(has, binding, [parent_id])) {
return false;
}
binding = env0_1;
if (binding.can(Permissions.VIEW_CHANNEL, a0)) {
binding = env0_0;
value3 = binding.getChannel(a0.parent_id);
isThread2 = a0.isThread();
r0 = isThread2 ? value3 == null : !isThread2;
r0 = !r0 ? value3 == null : r0;
r0 = !r0 ? !value3.hasFlag(ChannelFlags.ACTIVE_CHANNELS_REMOVED) : r0;
return r0;
}
return false;
}
}
return false;
}
}
}
global.__d(_fun109691, 14495, [1383, 1379, 3784, 4864, 12552, 661, 1386, 1360,
2]) /* metro module 14495, dependencies: [1383, 1379, 3784, 4864, 12552, 661, 1386, 1360, 2] */;