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

97 lines
3.5 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 10932
// Function ID: 84960
2026-07-20 16:05:17 +00:00
// Name: getCanJoin
2026-07-24 07:16:23 +00:00
// Dependencies: [653, 10933, 10934, 10935, 10936, 10937, 10938, 10939, 5689, 477, 2]
2026-07-20 16:05:17 +00:00
// Exports: getCanJoin, getCanSync
2026-07-24 07:16:23 +00:00
// Module 10932 (getCanJoin)
2026-07-23 10:11:24 +00:00
import ME from "ME";
let closure_3;
let closure_4;
({ ActivityActionTypes: closure_3, ActivityFlags: closure_4 } = ME);
const result = require("getPartySize").fileFinishedImporting("modules/activities/utils/getCanJoin.tsx");
2026-07-20 16:05:17 +00:00
export const getCanJoin = function getCanJoin(currentUserId) {
let message;
let presenceActivity;
({ presenceActivity, message } = currentUserId);
if (message.author.id === currentUserId.currentUserId) {
2026-07-23 10:11:24 +00:00
return { canJoin: false, remoteJoinPlatform: null };
2026-07-24 07:16:23 +00:00
} else if (importDefault(10933)(presenceActivity, message, tmp2.id)) {
let obj = require(10934) /* getPartySize */;
2026-07-20 16:05:17 +00:00
const partySize = obj.getPartySize(presenceActivity);
if (obj2.hasPartySize(partySize)) {
if (!obj3.isPartyFull(partySize)) {
if (obj4.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 (obj5.getIsAskToJoin(message)) {
2026-07-23 10:11:24 +00:00
return { canJoin: false, remoteJoinPlatform: null };
2026-07-20 16:05:17 +00:00
} 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
}
}
const activity = message.activity;
let type;
if (null != activity) {
type = activity.type;
}
if (type === constants.JOIN) {
if (null != presenceActivity) {
2026-07-24 07:16:23 +00:00
const remoteJoinableActivityPlatform = require(10939) /* getRemoteJoinableActivityPlatform */.getRemoteJoinableActivityPlatform(presenceActivity);
2026-07-20 16:05:17 +00:00
if (null != remoteJoinableActivityPlatform) {
obj = { canJoin: true, remoteJoinPlatform: remoteJoinableActivityPlatform };
return obj;
2026-07-23 10:11:24 +00:00
} else if (importDefault(5689)(presenceActivity, constants2.SUPPORTS_JOIN_URL)) {
return { canJoin: true, remoteJoinPlatform: null };
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
const obj6 = require(10939) /* getRemoteJoinableActivityPlatform */;
2026-07-20 16:05:17 +00:00
}
}
if (obj7.platformSupportsActivityJoin()) {
if (tmp5) {
2026-07-23 10:11:24 +00:00
obj = { canJoin: true, remoteJoinPlatform: null };
2026-07-20 16:05:17 +00:00
}
return obj;
}
2026-07-23 10:11:24 +00:00
obj = { canJoin: false, remoteJoinPlatform: null };
obj7 = require(477) /* set */;
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
obj5 = require(10938) /* getIsAskToJoin */;
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
obj4 = require(10937) /* getIsInParty */;
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
obj3 = require(10936) /* isPartyFull */;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
return { canJoin: false, remoteJoinPlatform: null };
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
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) {
2026-07-24 07:16:23 +00:00
const tmp6 = !importDefault(10933)(activity, arg2, id.id);
2026-07-20 16:05:17 +00:00
let tmp7 = !tmp6;
if (!tmp6) {
2026-07-23 10:11:24 +00:00
const tmp11 = !importDefault(5689)(activity, constants2.SYNC);
2026-07-20 16:05:17 +00:00
let tmp12 = !tmp11;
if (!tmp11) {
2026-07-23 10:11:24 +00:00
const tmp15 = !require(477) /* set */.isPlatformEmbedded;
2026-07-20 16:05:17 +00:00
let tmp16 = !tmp15;
if (!tmp15) {
2026-07-24 07:16:23 +00:00
tmp16 = !require(10937) /* getIsInParty */.getIsInParty(tmp8Result, activity);
const obj = require(10937) /* getIsInParty */;
2026-07-20 16:05:17 +00:00
}
tmp12 = tmp16;
}
tmp7 = tmp12;
}
tmp = tmp7;
}
return tmp;
};