Files
2026-07-28 01:06:53 +03:00

277 lines
15 KiB
TypeScript

/* Metro module 10258; source: modules/activities/utils/getActivityJoinability.tsx; dependencies: [661, 10259, 10260, 8107, 7858, 6886, 10261, 477, 10262, 10263, 10264, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
function _fun79658(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10444:6, offset: 0x01e5d2a7, size: 192 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/activities/utils/getActivityJoinability.tsx');
exports.default = getActivityJoinability;
exports.ActivityJoinability = {CAN_JOIN: 'can_join', CANNOT_JOIN: 'cannot_join', JOINED: 'joined'};
function getActivityJoinability({user, activity, application, channelId, currentUser, isEmbedded, ChannelStore, GuildStore, GuildMemberCountStore, RelationshipStore, SelectedChannelStore, VoiceStateStore, PermissionStore, LocalActivityStore, SelfPresenceStore, EmbeddedActivitiesStore}) { // fn#79659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10444:355, offset: 0x01e5d367, size: 1064 bytes, params: 2, frame: 32
var application_id;
var r1;
var r0;
var value;
var value2;
var defaultImport;
var value3;
var value4;
var getIsInParty;
var value5;
var applicationId;
var defaultImport2;
var CONTEXTLESS;
var CANNOT_JOIN;
var moduleValue;
var platformSupportsActivityJoin;
var moduleValue4;
var defaultImport3;
var PARTY_PRIVACY_FRIENDS;
var isFriend;
var id;
var defaultImport4;
var PARTY_PRIVACY_VOICE_CHANNEL;
var getChannel;
var getVoiceChannelId;
var value7;
var isInChannel;
var id2;
var type;
var DM;
var GROUP_DM;
var getGuild;
var getGuildId;
var value8;
var features;
var has;
var COMMUNITY;
var getMemberCount;
var value9;
var CAN_JOIN;
var defaultImport5;
var object;
var moduleValue5;
if (!isEmbedded) {
value = environment;
value2 = undefined;
defaultImport = importDefault(10259) /* metro dependency 10259: getCurrentUserPresenceActivity */;
reducibleJoin3: while (true) {
if (activity == null) {
application_id = value2;
break reducibleJoin3;
}
application_id = activity.application_id;
break reducibleJoin3;
}
value3 = defaultImport(LocalActivityStore, SelfPresenceStore, application_id);
value4 = value3 != null;
reducibleJoin5: while (true) {
if (value4) {
value = require(10260) /* metro dependency 10260: getIsInParty */;
getIsInParty = value.getIsInParty;
value = Reflect.apply(getIsInParty, value, [value3, activity]);
r1 = value;
break reducibleJoin5;
}
r1 = value4;
break reducibleJoin5;
}
reducibleJoin6: while (true) {
if (r1) {
value = environment;
return env0_6.JOINED;
}
break reducibleJoin6;
}
}
if (isEmbedded) {
value = EmbeddedActivitiesStore.getCurrentEmbeddedActivity();
value5 = value != null;
reducibleJoin11: while (true) {
if (value5) {
applicationId = value.applicationId;
value = undefined;
reducibleJoin10: while (true) {
if (activity == null) {
application_id = value;
break reducibleJoin10;
}
application_id = activity.application_id;
break reducibleJoin10;
}
value = applicationId === application_id;
r1 = value;
break reducibleJoin11;
}
r1 = value5;
break reducibleJoin11;
}
reducibleJoin12: while (true) {
if (r1) {
value = environment;
return env0_6.JOINED;
}
break reducibleJoin12;
}
}
if (user != null) {
if (isEmbedded) {
reducibleJoin15: while (true) {
if (channelId != null) {
value = environment;
defaultImport5 = importDefault(8107) /* metro dependency 8107: getEmbeddedActivityJoinability */;
object = {};
object.userId = user.id;
object.activity = activity;
object.channelId = channelId;
object.currentUser = currentUser;
object.application = application;
moduleValue5 = require(7858) /* metro dependency 7858: useIsActivitiesEnabledForCurrentPlatform */;
object.isActivitiesEnabledForCurrentPlatform = moduleValue5.getIsActivitiesEnabledForCurrentPlatform();
object.ChannelStore = ChannelStore;
object.VoiceStateStore = VoiceStateStore;
object.PermissionStore = PermissionStore;
object.GuildStore = GuildStore;
if (defaultImport5(object) === (require(8107) /* metro dependency 8107: getEmbeddedActivityJoinability */).EmbeddedActivityJoinability.CAN_JOIN) {
r0 = env0_6.CAN_JOIN;
} else {
r0 = env0_6.CANNOT_JOIN;
}
return r0;
}
break reducibleJoin15;
}
}
if (isEmbedded) {
reducibleJoin19: while (true) {
if (channelId != null) {
break reducibleJoin19;
}
value = environment;
defaultImport2 = importDefault(6886) /* metro dependency 6886: hasFlag */;
CONTEXTLESS = ActivityFlags.CONTEXTLESS;
if (!defaultImport2(activity, CONTEXTLESS)) {
return env0_6.CANNOT_JOIN;
}
break reducibleJoin19;
}
}
if (!isEmbedded) {
reducibleJoin23: while (true) {
reducibleJoin22: while (true) {
if ((importDefault(10261) /* metro dependency 10261: isActivityJoinableOnCurrentPlatform */)(activity)) {
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
platformSupportsActivityJoin = moduleValue.platformSupportsActivityJoin;
if (Reflect.apply(platformSupportsActivityJoin, moduleValue, [])) {
break reducibleJoin23;
}
break reducibleJoin22;
}
break reducibleJoin22;
}
return env0_6.CANNOT_JOIN;
}
}
var partySize = (require(10262) /* metro dependency 10262: getPartySize */).getPartySize(activity);
var moduleValue3 = require(10263) /* metro dependency 10263: hasPartySize */;
if (moduleValue3.hasPartySize(partySize)) {
moduleValue4 = require(10264) /* metro dependency 10264: isPartyFull */;
reducibleJoin44: while (true) {
if (!moduleValue4.isPartyFull(partySize)) {
defaultImport3 = importDefault(6886) /* metro dependency 6886: hasFlag */;
PARTY_PRIVACY_FRIENDS = ActivityFlags.PARTY_PRIVACY_FRIENDS;
if (defaultImport3(activity, PARTY_PRIVACY_FRIENDS)) {
isFriend = RelationshipStore.isFriend;
id = user.id;
reducibleJoin27: while (true) {
if (Reflect.apply(isFriend, RelationshipStore, [id])) {
return env0_6.CAN_JOIN;
}
break reducibleJoin27;
}
}
defaultImport4 = importDefault(6886) /* metro dependency 6886: hasFlag */;
PARTY_PRIVACY_VOICE_CHANNEL = ActivityFlags.PARTY_PRIVACY_VOICE_CHANNEL;
if (defaultImport4(activity, PARTY_PRIVACY_VOICE_CHANNEL)) {
getChannel = ChannelStore.getChannel;
getVoiceChannelId = SelectedChannelStore.getVoiceChannelId;
value7 = Reflect.apply(getChannel, ChannelStore, [Reflect.apply(getVoiceChannelId,
SelectedChannelStore,
[])]);
if (value7 != null) {
isInChannel = VoiceStateStore.isInChannel;
id = value7.id;
id2 = user.id;
reducibleJoin42: while (true) {
if (Reflect.apply(isInChannel, VoiceStateStore, [id, id2])) {
type = value7.type;
DM = ChannelTypes.DM;
if (DM !== type) {
GROUP_DM = ChannelTypes.GROUP_DM;
reducibleJoin41: while (true) {
if (GROUP_DM !== type) {
getGuild = GuildStore.getGuild;
getGuildId = value7.getGuildId;
value8 = Reflect.apply(getGuild, GuildStore, [Reflect.apply(getGuildId,
value7,
[])]);
if (value8 != null) {
features = value8.features;
has = features.has;
COMMUNITY = GuildFeatures.COMMUNITY;
reducibleJoin40: while (true) {
if (!Reflect.apply(has, features, [COMMUNITY])) {
getMemberCount = GuildMemberCountStore.getMemberCount;
id = value8.id;
value9 = Reflect.apply(getMemberCount,
GuildMemberCountStore,
[id]);
reducibleJoin39: while (true) {
reducibleJoin37: while (true) {
if (value9 == null) {
break reducibleJoin37;
}
if (value9 < 100) {
CAN_JOIN = env0_6.CAN_JOIN;
r1 = CAN_JOIN;
break reducibleJoin39;
}
break reducibleJoin37;
}
CANNOT_JOIN = env0_6.CANNOT_JOIN;
r1 = CANNOT_JOIN;
break reducibleJoin39;
}
return r1;
}
break reducibleJoin40;
}
}
return env0_6.CANNOT_JOIN;
}
break reducibleJoin41;
}
}
return env0_6.CAN_JOIN;
}
break reducibleJoin42;
}
}
return env0_6.CANNOT_JOIN;
}
return env0_6.CANNOT_JOIN;
}
break reducibleJoin44;
}
}
}
return env0_6.CANNOT_JOIN;
}
}
global.__d(_fun79658, 10258, [661, 10259, 10260, 8107, 7858, 6886, 10261, 477, 10262, 10263, 10264,
2]) /* metro module 10258, dependencies: [661, 10259, 10260, 8107, 7858, 6886, 10261, 477, 10262, 10263, 10264, 2] */;