decord/alpha/source/modules/activities/utils/getActivityJoinability.tsx

154 lines
5.9 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 13107
// Function ID: 13108
2026-07-20 16:05:17 +00:00
// Name: getActivityJoinability
2026-10-09 10:00:15 +00:00
// Dependencies: [1085, 10762, 10759, 10880, 10803, 7006, 13108, 1382, 10756, 10757, 10758, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-09 10:00:15 +00:00
// Module 13107 (getActivityJoinability)
import PlatformUtils from "PlatformUtils" /* 1382 */;
import hasFlagDefault from "hasFlag" /* 7006 */;
import _slicedToArray from "_slicedToArray" /* 10756 */;
import hasPartySize from "hasPartySize" /* 10757 */;
import getIsInParty from "getIsInParty" /* 10759 */;
import getCurrentUserPresenceActivityDefault from "getCurrentUserPresenceActivity" /* 10762 */;
import useIsActivitiesEnabledForCurrentPlatform from "useIsActivitiesEnabledForCurrentPlatform" /* 10803 */;
import getEmbeddedActivityJoinability from "getEmbeddedActivityJoinability" /* 10880 */;
import isActivityJoinableOnCurrentPlatformDefault from "isActivityJoinableOnCurrentPlatform" /* 13108 */;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
import size from "module_2" /* 2 */;
2026-07-20 16:05:17 +00:00
2026-10-03 08:58:59 +00:00
const getEmbeddedActivityJoinabilityDefault = getEmbeddedActivityJoinability;
let c3;
let closure_4;
let hasOwnProperty;
({ ActivityFlags: c3, ChannelTypes: closure_4, GuildFeatures: hasOwnProperty } = Constants);
const ActivityJoinability = { CAN_JOIN: "can_join", CANNOT_JOIN: "cannot_join", JOINED: "joined" };
const result = size.fileFinishedImporting("modules/activities/utils/getActivityJoinability.tsx");
2026-07-20 16:05:17 +00:00
export default function getActivityJoinability(arg0) {
2026-10-03 08:58:59 +00:00
let ChannelStore;
let EmbeddedActivitiesStore;
let GuildMemberCountStore;
let GuildStore;
let RelationshipStore;
let SelectedChannelStore;
let VoiceStateStore;
let activity;
let channelId;
let isEmbedded;
let obj;
let obj8;
let user;
2026-07-20 16:05:17 +00:00
({ user, activity, channelId, isEmbedded, ChannelStore, GuildStore, GuildMemberCountStore, RelationshipStore, SelectedChannelStore, VoiceStateStore, EmbeddedActivitiesStore } = arg0);
if (isEmbedded) {
if (isEmbedded) {
const currentEmbeddedActivity = EmbeddedActivitiesStore.getCurrentEmbeddedActivity();
2026-07-29 08:29:29 +00:00
let tmp16 = null != currentEmbeddedActivity;
if (tmp16) {
2026-07-20 16:05:17 +00:00
let application_id;
2026-10-03 08:58:59 +00:00
const applicationId = currentEmbeddedActivity.applicationId;
2026-07-29 08:29:29 +00:00
if (activity != null) {
2026-07-20 16:05:17 +00:00
application_id = activity.application_id;
}
2026-10-03 08:58:59 +00:00
tmp16 = applicationId === application_id;
2026-07-20 16:05:17 +00:00
}
}
if (null == user) {
return obj.CANNOT_JOIN;
} else {
if (isEmbedded) {
if (null != channelId) {
2026-10-03 08:58:59 +00:00
let CANNOT_JOIN2;
const obj5 = { userId: user.id, activity, channelId, currentUser: tmp2, application: tmp, isActivitiesEnabledForCurrentPlatform: obj8.getIsActivitiesEnabledForCurrentPlatform(), ChannelStore, VoiceStateStore, PermissionStore: tmp3, GuildStore };
const tmp45 = getEmbeddedActivityJoinabilityDefault;
obj8 = useIsActivitiesEnabledForCurrentPlatform;
const tmp45Result = tmp45(obj5);
2026-08-24 06:08:38 +00:00
if (tmp45Result === getEmbeddedActivityJoinability.EmbeddedActivityJoinability.CAN_JOIN) {
2026-10-03 08:58:59 +00:00
CANNOT_JOIN2 = obj.CAN_JOIN;
2026-07-20 16:05:17 +00:00
} else {
CANNOT_JOIN2 = obj.CANNOT_JOIN;
}
return CANNOT_JOIN2;
}
}
if (isEmbedded) {
if (null == channelId) {
2026-08-24 06:08:38 +00:00
if (!hasFlagDefault(activity, constants.CONTEXTLESS)) {
2026-07-20 16:05:17 +00:00
return obj.CANNOT_JOIN;
}
}
}
if (!isEmbedded) {
2026-10-03 08:58:59 +00:00
if (isActivityJoinableOnCurrentPlatformDefault(activity)) {
PlatformUtils;
}
2026-07-20 16:05:17 +00:00
return obj.CANNOT_JOIN;
}
2026-10-03 08:58:59 +00:00
const obj3 = _slicedToArray;
const partySize = obj3.getPartySize(activity);
const obj4 = hasPartySize;
2026-07-29 08:29:29 +00:00
const tmp27 = require;
2026-07-20 16:05:17 +00:00
if (obj4.hasPartySize(partySize)) {
2026-10-09 10:00:15 +00:00
const tmp27Result = tmp27(10758);
2026-07-29 08:29:29 +00:00
if (!tmp27Result.isPartyFull(partySize)) {
2026-10-03 08:58:59 +00:00
const tmp30 = importDefault;
const tmp31 = constants;
2026-08-24 06:08:38 +00:00
if (hasFlagDefault(activity, constants.PARTY_PRIVACY_FRIENDS)) {
2026-07-20 16:05:17 +00:00
if (RelationshipStore.isFriend(user.id)) {
return obj.CAN_JOIN;
}
}
2026-10-09 10:00:15 +00:00
if (tmp30(7006)(activity, tmp31.PARTY_PRIVACY_VOICE_CHANNEL)) {
2026-07-20 16:05:17 +00:00
const channel = ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId());
if (null != channel) {
if (VoiceStateStore.isInChannel(channel.id, user.id)) {
const type = channel.type;
if (constants2.DM !== type) {
if (constants2.GROUP_DM !== type) {
const guild = GuildStore.getGuild(channel.getGuildId());
if (null != guild) {
const features = guild.features;
2026-10-03 08:58:59 +00:00
if (!features.has(hasOwnProperty.COMMUNITY)) {
2026-07-20 16:05:17 +00:00
const memberCount = GuildMemberCountStore.getMemberCount(guild.id);
if (null != memberCount) {
2026-10-03 08:58:59 +00:00
let CANNOT_JOIN;
2026-07-20 16:05:17 +00:00
if (memberCount < 100) {
2026-10-03 08:58:59 +00:00
CANNOT_JOIN = obj.CAN_JOIN;
2026-07-20 16:05:17 +00:00
}
return CANNOT_JOIN;
}
CANNOT_JOIN = obj.CANNOT_JOIN;
}
}
return obj.CANNOT_JOIN;
}
}
return obj.CAN_JOIN;
}
}
return obj.CANNOT_JOIN;
} else {
return obj.CANNOT_JOIN;
}
}
}
return obj.CANNOT_JOIN;
}
} else {
let application_id1;
2026-10-03 08:58:59 +00:00
const tmp8 = getCurrentUserPresenceActivityDefault;
2026-07-29 08:29:29 +00:00
if (activity != null) {
2026-07-20 16:05:17 +00:00
application_id1 = activity.application_id;
}
2026-10-03 08:58:59 +00:00
const tmp8Result = tmp8(tmp4, tmp5, application_id1);
2026-07-20 16:05:17 +00:00
let isInParty = null != tmp8Result;
if (isInParty) {
2026-08-24 06:08:38 +00:00
obj = getIsInParty;
2026-07-20 16:05:17 +00:00
isInParty = obj.getIsInParty(tmp8Result, activity);
}
}
return obj.JOINED;
};
export { ActivityJoinability };