This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
// Metro module 4253 (f4254).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { StreamTypes } from "../Constants";
export function isStreamKey(a0) {
return a0 != null && (a0.startsWith(StreamTypes.GUILD) || a0.startsWith(StreamTypes.CALL));
}
export function decodeStreamKey(a0) {
const r11 = a0.split(":");
const r7 = r11[0];
if (StreamTypes.GUILD === r7) {
const r31 = _slicedToArray(r11, 4);
return {
streamType: r31[0],
guildId: r31[1],
channelId: r31[2],
ownerId: r31[3]
};
}
if (StreamTypes.CALL === r7) {
const r23 = _slicedToArray(r11, 3);
return {
streamType: r23[0],
channelId: r23[1],
ownerId: r23[2]
};
}
throw new Error(`Unknown stream type ${r7}`);
}
export function encodeStreamKey({ streamType, guildId, channelId, ownerId }) {
if (StreamTypes.GUILD === streamType) {
return [streamType, guildId, channelId, ownerId].join(":");
}
if (StreamTypes.CALL === streamType) {
return [streamType, channelId, ownerId].join(":");
}
throw new Error(`Unknown stream type ${streamType}`);
}
@@ -0,0 +1,124 @@
// Metro module 6010 (f6011).
import GameConsoleStore from "../../game_console/GameConsoleStore";
import { ChannelRecordBase } from "../../../records/ChannelRecord";
import { GUILD_VOCAL_CHANNELS_KEY } from "../../../stores/GuildChannelStore";
import GuildStore from "../../../stores/GuildStore";
import PermissionStore from "../../../stores/PermissionStore";
import VoiceStateStore from "../../../stores/VoiceStateStore";
import { Permissions } from "../../../Constants";
import canJoinVoiceChannel from "../../channel/canJoinVoiceChannel";
import { intl, t } from "../../../intl/index.native";
import { isChannelFull } from "../../../utils/ChannelUtils";
import { shouldAgeVerifyForAgeGate, shouldShowAgeGateForChannelId } from "../../age_gate/AgeGateUtils";
import { useStateFromStoresArray } from "../../../_bundle/Module589";
let c3803_11, canWatchStream;
const canStreamInChannel = function canStreamInChannel(a0, a1, a2, r9 = true) {
if (a0.isPrivate()) {
return true;
}
const guild = a1.getGuild(a0.getGuildId());
let r17 = guild?.maxStageVideoChannelUsers;
if (r17 == null) {
r17 = 0;
}
const r19 = a0.isGuildStageVoice() && r17 <= 0;
let r20 = !r19;
if (!r19) {
if (r9) {
r9 = !canJoinVoiceChannel(a0, a2);
}
r20 = r9 ? !r9 : !!a2.can(Permissions.STREAM, a0) && (guild != null && guild.afkChannelId !== a0.id);
}
return r20;
};
canWatchStream = function canWatchStream(basicChannel2, a1, a2, a3, a4) {
let REMOTE_MODE;
if (basicChannel2 == null) {
return [false, c3803_11.NO_PERMISSION];
}
let r12 = a1.isInChannel(basicChannel2.id);
const r8 = basicChannel2 instanceof ChannelRecordBase && isChannelFull(basicChannel2, a1, a2);
let r23 = canJoinVoiceChannel(basicChannel2, a3);
const r26 = a4.getAwaitingRemoteSessionInfo() != null || a4.getRemoteSessionId() != null;
const r33 = shouldAgeVerifyForAgeGate() && shouldShowAgeGateForChannelId(basicChannel2.id);
L18: {
if (r26) {
REMOTE_MODE = c3803_11.REMOTE_MODE;
} else if (r33) {
REMOTE_MODE = c3803_11.AGE_RESTRICTED;
} else {
if (!r23 && !r12) {
REMOTE_MODE = c3803_11.NO_PERMISSION;
break L18;
}
REMOTE_MODE = r8 && !r12 ? c3803_11.CHANNEL_FULL : void 0;
}
}
let r44 = r26 ? !r26 : !r33;
if (r44) {
if (!r12) {
if (r23) {
r23 = !r8;
}
r12 = r23;
}
r44 = r12;
}
return [r44, REMOTE_MODE];
};
c3803_11 = {
REMOTE_MODE: 0,
0: "REMOTE_MODE",
CHANNEL_FULL: 1,
1: "CHANNEL_FULL",
NO_PERMISSION: 2,
2: "NO_PERMISSION",
AGE_RESTRICTED: 3,
3: "AGE_RESTRICTED"
};
export { canStreamInChannel };
export function getStreamCTAString(a0) {
if (c3803_11.REMOTE_MODE === a0) {
return intl.string(t["1i3tSY"]);
}
if (c3803_11.CHANNEL_FULL === a0) {
return intl.string(t.elyVbv);
}
if (c3803_11.NO_PERMISSION === a0) {
return intl.string(t.pgUTZC);
}
if (c3803_11.AGE_RESTRICTED === a0) {
return intl.string(t.b5FqhF);
}
return intl.string(t["7Xq/nV"]);
}
export function getStreamCTAAriaLabel(a0) {
if (c3803_11.REMOTE_MODE === a0) {
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t["1i3tSY"])}`;
}
if (c3803_11.CHANNEL_FULL === a0) {
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t.elyVbv)}`;
}
if (c3803_11.NO_PERMISSION === a0) {
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t.pgUTZC)}`;
}
if (c3803_11.AGE_RESTRICTED === a0) {
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t.b5FqhF)}`;
}
return `${intl.string(t["7Xq/nV"])}: ${intl.string(t["9C444m"])}`;
}
export { c3803_11 as StreamUnavailableReasons };
export { canWatchStream };
export function useCanWatchStream(c15361_0) {
return useStateFromStoresArray([VoiceStateStore, GuildStore, PermissionStore, GameConsoleStore], () => canWatchStream(c15361_0, VoiceStateStore, GuildStore, PermissionStore, GameConsoleStore));
}
export function getStreamEligibleChannels(a0, a1, a2) {
const r0 = [];
for (const item of a0[GUILD_VOCAL_CHANNELS_KEY]) {
const channel = item.channel;
if (canStreamInChannel(channel, a1, a2)) {
r0.push(channel);
}
}
return r0;
}
@@ -0,0 +1,43 @@
// Metro module 6023 (f6024).
import PresenceStore from "../../../stores/PresenceStore";
import { ActivityTypes } from "../../../Constants";
import isEmbeddedActivity from "../../activities/utils/isEmbeddedActivity";
import shallowEqual from "../../../_bundle/shallowEqual";
import { useStateFromStores } from "../../../_bundle/Module589";
let streamApplicationEqualityCheck;
const _findPlayingActivity = function _findPlayingActivity(a0) {
return a0.type === ActivityTypes.PLAYING && !isEmbeddedActivity(a0);
};
streamApplicationEqualityCheck = function streamApplicationEqualityCheck(a0, a1) {
return a0 === a1 || a0 != null && a1 != null && shallowEqual(a0, a1);
};
export function getStreamerActivityByUserId(a0, a1) {
return a1.findActivity(a0, _findPlayingActivity);
}
export function getStreamerActivity(a0, a1) {
return a0 != null ? a1.findActivity(a0.ownerId, _findPlayingActivity) : null;
}
export function getStreamerApplication(a0, a1) {
if (a0 == null) {
return null;
}
const r4 = a0 != null ? a1.findActivity(a0.ownerId, _findPlayingActivity) : null;
return r4 == null ? null : {
id: r4.application_id,
name: r4.name
};
}
export function useGetStreamApplication(a0) {
return useStateFromStores([PresenceStore], () => {
const r0 = a0 == null;
let r8 = null;
if (!r0) {
const r4 = a0 != null ? PresenceStore.findActivity(a0.ownerId, _findPlayingActivity) : null;
r8 = r4 == null ? null : {
id: r4.application_id,
name: r4.name
};
}
return r8;
}, [a0], streamApplicationEqualityCheck);
}
+6
View File
@@ -0,0 +1,6 @@
// Metro module 12858 (f12859).
import { Features } from "../../../_bundle/Module4250";
Features;
export default function canSpectate(a0) {
return true;
};
@@ -0,0 +1,28 @@
// Metro module 10749 (f10750).
import { ApplicationStreamPresets, ApplicationStreamSettingRequirements } from "../StreamSettingsConstants";
import { getGoLiveAutoQualityExperimentConfig } from "../GoLiveAutoQualityExperiment";
import canUseStreamSetting from "./canUseStreamSetting";
export default function canStreamWithSettings(a0, a1, a2, a3, a4, a5) {
if (a0 === ApplicationStreamPresets.PRESET_AUTO) {
return getGoLiveAutoQualityExperimentConfig({
location: "canStreamWithSettings"
}).allowAutoQuality;
}
for (const applicationStreamSettingRequirement of ApplicationStreamSettingRequirements) {
const r33 = applicationStreamSettingRequirement;
if (applicationStreamSettingRequirement.preset != null && a0 !== r33.preset) {
continue;
}
if (a1 !== r33.resolution) {
continue;
}
if (a2 !== r33.fps) {
continue;
}
if (!canUseStreamSetting(r33, a3, a4, a5)) {
continue;
}
return true;
}
return false;
};
@@ -0,0 +1,28 @@
// Metro module 10751 (f10752).
import { StreamQualities } from "../../premium/PremiumConstants";
import PremiumUtils from "../../../utils/PremiumUtils";
import { isGuildBoostedAtLeast } from "../../../utils/GuildBoostingUtils";
export default function canUseStreamSetting(a0, a1, a2) {
L14: {
if (a0 != null) {
if (a0.quality == null && a0.guildPremiumTier == null) {
break L14;
}
const r2 = a0.quality != null;
let r7 = false;
if (r2) {
const quality = a0.quality;
if (StreamQualities.HIGH_STREAMING_QUALITY === quality) {
r7 = PremiumUtils.canStreamQuality(PremiumUtils.StreamQuality.HIGH, a1);
} else if (StreamQualities.MID_STREAMING_QUALITY === quality) {
r7 = PremiumUtils.canStreamQuality(PremiumUtils.StreamQuality.MID, a1);
} else {
a0.quality;
r7 = false;
}
}
return a0.guildPremiumTier != null ? r7 ? r7 : isGuildBoostedAtLeast(a2, a0.guildPremiumTier) : r7;
}
}
return true;
};
@@ -0,0 +1,22 @@
// Metro module 4365 (f4366).
import RunningGameStore_native from "../../game_detection/RunningGameStore.native";
export default function getSoundshareAnalyticsContext(a0) {
if (a0 == null) {
return {};
}
const sourcePid = a0.sourcePid;
const r1 = sourcePid != null;
let share_game_id = void 0;
let share_game_name = void 0;
if (r1) {
const gameForPID = RunningGameStore_native.getGameForPID(sourcePid);
const name = gameForPID?.name;
share_game_id = gameForPID?.id;
share_game_name = name;
}
return {
soundshare_session: a0.soundshareSession,
share_game_name,
share_game_id
};
};
@@ -0,0 +1,42 @@
// Metro module 16038 (f16039).
import { StreamIssueReportReasons } from "../Constants";
import { intl, t } from "../../../intl/index.native";
export default function getStreamIssueReportOptions({ isEndStream }) {
return [{
id: "black-screen",
value: StreamIssueReportReasons.BLACK_SCREEN,
label: isEndStream ? intl.string(t["0X5Zbq"]) : intl.string(t.fxiRNr)
}, {
id: "blurry",
value: StreamIssueReportReasons.BLURRY,
label: isEndStream ? intl.string(t.VVPQyy) : intl.string(t.E8jTMN)
}, {
id: "lagging",
value: StreamIssueReportReasons.LAGGING,
label: isEndStream ? intl.string(t.ObEHd4) : intl.string(t.VoSJEQ)
}, {
id: "out-of-sync",
value: StreamIssueReportReasons.OUT_OF_SYNC,
label: isEndStream ? intl.string(t.mYmwD3) : intl.string(t["+NluQm"])
}, {
id: "audio-missing",
value: StreamIssueReportReasons.AUDIO_MISSING,
label: isEndStream ? intl.string(t["Xwv41+"]) : intl.string(t.G2egzT)
}, {
id: "audio-poor",
value: StreamIssueReportReasons.AUDIO_POOR,
label: isEndStream ? intl.string(t["fHey+d"]) : intl.string(t.aHOfIo)
}, {
id: "stream-stopped",
value: StreamIssueReportReasons.STREAM_STOPPED,
label: intl.string(t.uEoqQp)
}, {
id: "vibes-off",
value: StreamIssueReportReasons.VIBES_OFF,
label: intl.string(t["++JLL0"])
}, {
id: "other",
value: StreamIssueReportReasons.OTHER,
label: intl.string(t.emlT91)
}];
};
@@ -0,0 +1,72 @@
// Metro module 10747 (f10748).
import { ApplicationStreamFPS, ApplicationStreamPresets, ApplicationStreamResolutions } from "../StreamSettingsConstants";
import GoLiveVideoPresetResolutionExperiment from "../GoLiveVideoPresetResolutionExperiment";
import canStreamWithSettings from "./canStreamWithSettings";
let getStreamSettingsForPreset;
const getApplicationStreamPresetValues = function getApplicationStreamPresetValues() {
const videoPresetResolutionMax = GoLiveVideoPresetResolutionExperiment.getConfig({
location: "getApplicationStreamPresetValues"
}).videoPresetResolutionMax;
const r15 = {};
r15[ApplicationStreamPresets.PRESET_DOCUMENTS] = [{
resolution: ApplicationStreamResolutions.RESOLUTION_SOURCE,
fps: ApplicationStreamFPS.FPS_15
}, {
resolution: ApplicationStreamResolutions.RESOLUTION_SOURCE,
fps: ApplicationStreamFPS.FPS_5
}];
r15[ApplicationStreamPresets.PRESET_VIDEO] = [{
resolution: videoPresetResolutionMax,
fps: ApplicationStreamFPS.FPS_60
}, {
resolution: ApplicationStreamResolutions.RESOLUTION_1080,
fps: ApplicationStreamFPS.FPS_60
}, {
resolution: ApplicationStreamResolutions.RESOLUTION_720,
fps: ApplicationStreamFPS.FPS_60
}, {
resolution: ApplicationStreamResolutions.RESOLUTION_720,
fps: ApplicationStreamFPS.FPS_30
}];
r15[ApplicationStreamPresets.PRESET_AUTO] = [];
r15[ApplicationStreamPresets.PRESET_CUSTOM] = [];
r15[ApplicationStreamPresets.PRESET_MOBILE_DEFAULT] = [{
resolution: ApplicationStreamResolutions.RESOLUTION_720,
fps: ApplicationStreamFPS.FPS_30
}];
r15[ApplicationStreamPresets.PRESET_MOBILE_PERFORMANCE] = [{
resolution: ApplicationStreamResolutions.RESOLUTION_480,
fps: ApplicationStreamFPS.FPS_30
}];
r15[ApplicationStreamPresets.PRESET_MOBILE_HIGH_QUALITY] = [{
resolution: ApplicationStreamResolutions.RESOLUTION_1080,
fps: ApplicationStreamFPS.FPS_60
}];
return r15;
};
getStreamSettingsForPreset = function getStreamSettingsForPreset(a0, a1, a2) {
const r9 = getApplicationStreamPresetValues()[a0];
if (r9 == null) {
return null;
}
for (const item of r9) {
if (!canStreamWithSettings(a0, item.resolution, item.fps, a1, a2)) {
continue;
}
return [item.resolution, item.fps];
}
return null;
};
export default getStreamSettingsForPreset;
export { getApplicationStreamPresetValues };
export function getMaxSettingsForPreset(a0) {
const r7 = getApplicationStreamPresetValues()[a0];
let r8 = r7 == null ? void 0 : r7[0];
if (r8 == null) {
r8 = null;
}
return r8;
}
export function canStreamWithPreset(a0, a1, a2) {
return getStreamSettingsForPreset(a0, a1, a2) != null;
}
@@ -0,0 +1,4 @@
// Metro module 4366 (f4367).
export default function getStreamSourceMetadata() {
return {};
};
@@ -0,0 +1,5 @@
// Metro module 12970 (f12971).
import { intl, t } from "../../../intl/index.native";
export default function getTitleFromPickedStreamContent(a0) {
return a0.windows.length > 0 ? a0.windows.map((window) => window.title).join(", ") : a0.applications.length > 0 ? a0.applications.map((application) => application.name).join(", ") : a0.displays.length > 0 ? intl.string(t.R4wpLN) : null;
};
@@ -0,0 +1,20 @@
// Metro module 16037 (f16038).
import { AnalyticEvents } from "../../../Constants";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export default function trackStreamProblem(a0) {
const { problem, stream, feedback, streamApplication, analyticsData, location: location2, rating = null } = a0;
AnalyticsUtils.track(AnalyticEvents.STREAM_REPORT_PROBLEM, {
reason: problem,
category: a0.category,
reason_variant: a0.variant,
streamer_user_id: stream.ownerId,
stream_channel_id: stream.channelId,
guild_id: stream.guildId,
application_id: streamApplication != null ? streamApplication.id : null,
application_name: streamApplication != null ? streamApplication.name : null,
location: location2,
rating,
feedback,
...analyticsData
});
};
@@ -0,0 +1,13 @@
// Metro module 4394 (f4395).
import ChannelStore from "../../../stores/ChannelStore";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { openGuildVoiceModal } from "../../../utils/native/PrivateChannelCallUtils";
export default function transitionToStream(a0) {
const channel = ChannelStore.getChannel(a0.channelId);
if (channel != null) {
ActionSheetActionCreators.hideActionSheet();
ModalActionCreators.popAll();
openGuildVoiceModal(channel, "Go Live");
}
};
@@ -0,0 +1,8 @@
// Metro module 12969 (f12970).
export default function windowSourceMatches(a0, a1) {
if (a1 == null) {
return false;
}
const [r12, r13] = a0.split(":");
return r12 === "window" && r13 === a1;
};