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

109 lines
4.1 KiB
TypeScript
Raw Normal View History

2026-10-03 08:58:59 +00:00
// Module ID: 11385
// Function ID: 11386
2026-07-20 16:05:17 +00:00
// Name: getCanJoin
2026-10-03 08:58:59 +00:00
// Dependencies: [1085, 11386, 11387, 11388, 11389, 11390, 11391, 11392, 6816, 1369, 2]
2026-07-20 16:05:17 +00:00
// Exports: getCanJoin, getCanSync
2026-10-03 08:58:59 +00:00
// Module 11385 (getCanJoin)
import PlatformUtils from "PlatformUtils" /* 1369 */;
import isInviteActiveDefault from "isInviteActive" /* 11386 */;
import _slicedToArray from "_slicedToArray" /* 11387 */;
import hasPartySize from "hasPartySize" /* 11388 */;
import isPartyFull from "isPartyFull" /* 11389 */;
import getIsInParty from "getIsInParty" /* 11390 */;
import getIsAskToJoin from "getIsAskToJoin" /* 11391 */;
import getRemoteJoinableActivityPlatform from "getRemoteJoinableActivityPlatform" /* 11392 */;
import Constants from "Constants" /* 1085 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let c3;
let closure_4;
({ 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) {
2026-10-03 08:58:59 +00:00
let message;
let presenceActivity;
2026-07-20 16:05:17 +00:00
({ 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 {
2026-10-03 08:58:59 +00:00
const tmp13 = importDefault;
if (isInviteActiveDefault(presenceActivity, message, tmp2.id)) {
2026-10-03 08:58:59 +00:00
const obj = _slicedToArray;
const partySize = obj.getPartySize(presenceActivity);
const obj2 = hasPartySize;
2026-07-29 08:29:29 +00:00
if (obj2.hasPartySize(partySize)) {
2026-10-03 08:58:59 +00:00
const tmp6Result = isPartyFull;
2026-07-29 08:29:29 +00:00
if (!tmp6Result.isPartyFull(partySize)) {
2026-10-03 08:58:59 +00:00
const tmp6Result5 = getIsInParty;
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 {
2026-10-03 08:58:59 +00:00
const tmp6Result6 = getIsAskToJoin;
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) {
2026-10-03 08:58:59 +00:00
const tmp6Result7 = getRemoteJoinableActivityPlatform;
const remoteJoinableActivityPlatform = tmp6Result7.getRemoteJoinableActivityPlatform(presenceActivity);
2026-07-29 08:29:29 +00:00
if (null != remoteJoinableActivityPlatform) {
2026-10-03 08:58:59 +00:00
return { canJoin: true, remoteJoinPlatform: remoteJoinableActivityPlatform };
} else if (tmp13(6816)(presenceActivity, constants2.SUPPORTS_JOIN_URL)) {
2026-07-29 08:29:29 +00:00
return { canJoin: true, remoteJoinPlatform: null };
}
}
}
2026-10-03 08:58:59 +00:00
const tmp6Result8 = PlatformUtils;
if (tmp6Result8.platformSupportsActivityJoin()) {
2026-10-03 08:58:59 +00:00
let obj4;
2026-07-29 08:29:29 +00:00
if (tmp5) {
2026-10-03 08:58:59 +00:00
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 };
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
}
}
};
export const getCanSync = function getCanSync(activity, tmp8Result, arg2, id) {
let tmp = null != activity;
if (tmp) {
let tmp6 = isInviteActiveDefault(activity, arg2, id.id);
2026-10-03 08:58:59 +00:00
const tmp4 = importDefault;
2026-07-29 08:29:29 +00:00
if (tmp6) {
2026-10-03 08:58:59 +00:00
let tmp8 = tmp4(6816)(activity, constants2.SYNC);
2026-07-29 08:29:29 +00:00
if (tmp8) {
let isPlatformEmbedded = PlatformUtils.isPlatformEmbedded;
2026-10-03 08:58:59 +00:00
const tmp9 = require;
2026-07-29 08:29:29 +00:00
if (isPlatformEmbedded) {
2026-10-03 08:58:59 +00:00
const tmp9Result = tmp9(11390);
isPlatformEmbedded = !tmp9Result.getIsInParty(tmp8Result, activity);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp8 = isPlatformEmbedded;
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;
2026-07-20 16:05:17 +00:00
}
return tmp;
};