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

110 lines
3.6 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 10327
// Function ID: 10328
2026-07-29 08:29:29 +00:00
// Name: computeActivityFlags
2026-08-05 07:35:12 +00:00
// Dependencies: [676, 3928, 595, 1384, 7093, 2]
2026-07-20 16:05:17 +00:00
// Exports: computeActivityFlags, isContextlessEmbeddedActivity
2026-08-05 07:35:12 +00:00
// Module 10327 (computeActivityFlags)
2026-07-23 10:11:24 +00:00
import ME from "ME";
2026-07-29 08:29:29 +00:00
let c3;
let c4;
({ ActivityFlags: c3, ActivityPartyPrivacy: c4 } = ME);
2026-07-23 10:11:24 +00:00
const result = require("Storage").fileFinishedImporting("modules/activities/utils/ActivityFlagUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const computeActivityFlags = function computeActivityFlags(activity, flag, arg2, canLaunchFrameResult, privacy) {
if (flag === undefined) {
2026-07-20 16:05:17 +00:00
flag = false;
}
2026-07-29 08:29:29 +00:00
let flag2 = arg2;
if (arg2 === undefined) {
2026-07-20 16:05:17 +00:00
flag2 = false;
}
2026-07-29 08:29:29 +00:00
let flag3 = canLaunchFrameResult;
if (canLaunchFrameResult === undefined) {
2026-07-20 16:05:17 +00:00
flag3 = false;
}
2026-07-29 08:29:29 +00:00
let PRIVATE = privacy;
if (privacy === undefined) {
2026-07-20 16:05:17 +00:00
PRIVATE = constants2.PRIVATE;
}
const secrets = activity.secrets;
let num = 0;
if (flag) {
num = constants.INSTANCE | 0;
}
let join;
2026-07-29 08:29:29 +00:00
if (secrets != null) {
2026-07-20 16:05:17 +00:00
join = secrets.join;
}
let tmp4 = num;
if (null != join) {
tmp4 = num | constants.JOIN;
}
let tmp6 = tmp4;
if (flag3) {
tmp6 = tmp4 | constants.CONTEXTLESS;
}
if (flag2) {
2026-08-05 07:35:12 +00:00
const AllowActivityPartyPrivacyFriends2 = require(3928) /* explicitContentFromProto */.AllowActivityPartyPrivacyFriends;
2026-07-29 08:29:29 +00:00
const setting = AllowActivityPartyPrivacyFriends2.getSetting();
2026-08-05 07:35:12 +00:00
const AllowActivityPartyPrivacyVoiceChannel2 = require(3928) /* explicitContentFromProto */.AllowActivityPartyPrivacyVoiceChannel;
2026-07-29 08:29:29 +00:00
const PARTY_PRIVACY_FRIENDS2 = constants.PARTY_PRIVACY_FRIENDS;
const setting1 = AllowActivityPartyPrivacyVoiceChannel2.getSetting();
if (setting) {
let tmp28 = tmp23 | PARTY_PRIVACY_FRIENDS2;
} else {
tmp28 = tmp23 & ~PARTY_PRIVACY_FRIENDS2;
}
const PARTY_PRIVACY_VOICE_CHANNEL2 = constants.PARTY_PRIVACY_VOICE_CHANNEL;
if (setting1) {
let tmp29 = tmp28 | PARTY_PRIVACY_VOICE_CHANNEL2;
} else {
tmp29 = tmp28 & ~PARTY_PRIVACY_VOICE_CHANNEL2;
}
const tmp22 = constants;
2026-07-20 16:05:17 +00:00
} else {
let value = PRIVATE === constants2.PUBLIC;
if (!value) {
2026-07-29 08:29:29 +00:00
const Storage = require(595) /* Storage */.Storage;
2026-07-20 16:05:17 +00:00
value = Storage.get("ACTIVITIES_FORCE_PUBLIC");
}
2026-07-29 08:29:29 +00:00
if (!value) {
return tmp6;
} else {
2026-08-05 07:35:12 +00:00
const AllowActivityPartyPrivacyFriends = require(3928) /* explicitContentFromProto */.AllowActivityPartyPrivacyFriends;
2026-07-29 08:29:29 +00:00
const setting2 = AllowActivityPartyPrivacyFriends.getSetting();
2026-08-05 07:35:12 +00:00
const AllowActivityPartyPrivacyVoiceChannel = require(3928) /* explicitContentFromProto */.AllowActivityPartyPrivacyVoiceChannel;
2026-07-29 08:29:29 +00:00
const PARTY_PRIVACY_FRIENDS = constants.PARTY_PRIVACY_FRIENDS;
const setting3 = AllowActivityPartyPrivacyVoiceChannel.getSetting();
if (setting2) {
let tmp18 = tmp6 | PARTY_PRIVACY_FRIENDS;
let tmp19 = tmp17;
} else {
tmp18 = tmp6 & ~PARTY_PRIVACY_FRIENDS;
tmp19 = tmp17;
}
const PARTY_PRIVACY_VOICE_CHANNEL = tmp19.PARTY_PRIVACY_VOICE_CHANNEL;
if (setting3) {
let tmp20 = tmp18 | PARTY_PRIVACY_VOICE_CHANNEL;
} else {
tmp20 = tmp18 & ~PARTY_PRIVACY_VOICE_CHANNEL;
}
2026-07-20 16:05:17 +00:00
}
}
};
export const isContextlessEmbeddedActivity = function isContextlessEmbeddedActivity(remoteApplicationActivity) {
2026-07-29 08:29:29 +00:00
let num;
if (remoteApplicationActivity != null) {
num = remoteApplicationActivity.flags;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let hasFlagResult = require(1384) /* hasFlag */.hasFlag(num, constants.CONTEXTLESS);
2026-07-20 16:05:17 +00:00
if (hasFlagResult) {
2026-08-05 07:35:12 +00:00
hasFlagResult = importDefault(7093)(remoteApplicationActivity);
2026-07-20 16:05:17 +00:00
}
return hasFlagResult;
};