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

98 lines
3.6 KiB
TypeScript
Raw Normal View History

// Module ID: 11466
// Function ID: 11467
2026-07-20 16:05:17 +00:00
// Name: getCanJoin
// Dependencies: [1074, 11467, 11468, 11469, 11470, 11471, 11472, 11473, 6918, 1364, 2]
2026-07-20 16:05:17 +00:00
// Exports: getCanJoin, getCanSync
// Module 11466 (getCanJoin)
import PlatformUtils from "PlatformUtils" /* 1364 */;
import isInviteActiveDefault from "isInviteActive" /* 11467 */;
import getPartySize from "getPartySize" /* 11468 */;
import Constants from "Constants" /* 1074 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
({ ActivityActionTypes: c3, ActivityFlags: closure_4 } = Constants);
const result = size.fileFinishedImporting("modules/activities/utils/getCanJoin.tsx");
2026-07-20 16:05:17 +00:00
export const getCanJoin = function getCanJoin(currentUserId) {
({ presenceActivity, message } = currentUserId);
if (message.author.id === currentUserId.currentUserId) {
2026-07-23 10:11:24 +00:00
return { canJoin: false, remoteJoinPlatform: null };
2026-07-29 08:29:29 +00:00
} else {
if (isInviteActiveDefault(presenceActivity, message, tmp2.id)) {
const partySize = getPartySize.getPartySize(presenceActivity);
2026-07-29 08:29:29 +00:00
if (obj2.hasPartySize(partySize)) {
if (!tmp6Result.isPartyFull(partySize)) {
if (tmp6Result5.getIsInParty(tmp, presenceActivity)) {
2026-07-23 10:11:24 +00:00
return { canJoin: false, remoteJoinPlatform: null };
2026-07-20 16:05:17 +00:00
} else {
if (tmp6Result6.getIsAskToJoin(message)) {
2026-07-29 08:29:29 +00:00
return { canJoin: false, remoteJoinPlatform: null };
} else {
if (tmp3) {
if (tmp4) {
2026-07-23 10:11:24 +00:00
return { canJoin: true, remoteJoinPlatform: null };
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const activity = message.activity;
let type;
if (activity != null) {
type = activity.type;
}
if (type === constants.JOIN) {
if (null != presenceActivity) {
const remoteJoinableActivityPlatform = tmp6(11473).getRemoteJoinableActivityPlatform(presenceActivity);
2026-07-29 08:29:29 +00:00
if (null != remoteJoinableActivityPlatform) {
const obj3 = { canJoin: true, remoteJoinPlatform: remoteJoinableActivityPlatform };
return obj3;
} else if (tmp13(6918)(presenceActivity, constants2.SUPPORTS_JOIN_URL)) {
2026-07-29 08:29:29 +00:00
return { canJoin: true, remoteJoinPlatform: null };
}
const tmp6Result7 = tmp6(11473);
2026-07-29 08:29:29 +00:00
}
}
if (tmp6Result8.platformSupportsActivityJoin()) {
2026-07-29 08:29:29 +00:00
if (tmp5) {
let obj4 = { canJoin: true, remoteJoinPlatform: null };
2026-07-29 08:29:29 +00:00
}
return obj4;
2026-07-20 16:05:17 +00:00
}
obj4 = { canJoin: false, remoteJoinPlatform: null };
tmp6Result8 = tmp6(1364);
2026-07-20 16:05:17 +00:00
}
tmp6Result6 = tmp6(11472);
2026-07-20 16:05:17 +00:00
}
tmp6Result5 = tmp6(11471);
2026-07-20 16:05:17 +00:00
}
tmp6Result = tmp6(11470);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return { canJoin: false, remoteJoinPlatform: null };
} else {
return { canJoin: false, remoteJoinPlatform: null };
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp13 = importDefault;
2026-07-20 16:05:17 +00:00
}
};
export const getCanSync = function getCanSync(activity, tmp8Result, arg2, id) {
let tmp = null != activity;
if (tmp) {
let tmp6 = isInviteActiveDefault(activity, arg2, id.id);
2026-07-29 08:29:29 +00:00
if (tmp6) {
let tmp8 = tmp4(6918)(activity, constants2.SYNC);
2026-07-29 08:29:29 +00:00
if (tmp8) {
let isPlatformEmbedded = PlatformUtils.isPlatformEmbedded;
2026-07-29 08:29:29 +00:00
if (isPlatformEmbedded) {
isPlatformEmbedded = !tmp9(11471).getIsInParty(tmp8Result, activity);
const tmp9Result = tmp9(11471);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp8 = isPlatformEmbedded;
tmp9 = require;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp6 = tmp8;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = tmp6;
tmp4 = importDefault;
2026-07-20 16:05:17 +00:00
}
return tmp;
};