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

+65
View File
@@ -0,0 +1,65 @@
// Metro module 1379 (f1380).
let c1147_0 = {
VIBEGRATIONS: "conjuring",
ROLE_SUBSCRIPTIONS: "role-subscriptions",
SERVER_MONETIZATION_ONBOARDING: "server-monetization-onboarding",
GAME_SHOP: "game-shop",
GUILD_SHOP: "shop",
MEMBER_APPLICATIONS: "member-applications",
GUILD_HOME: "@home",
CHANNEL_BROWSER: "channel-browser",
GUILD_ONBOARDING: "onboarding",
CUSTOMIZE_COMMUNITY: "customize-community",
MEMBER_SAFETY: "member-safety",
GUILD_BOOSTS: "boosts",
GAME_SERVERS: "game-servers",
REPORT_TO_MOD: "report-to-mod",
GUILD_OFFICIAL_MESSAGES: "official-messages",
GUILD_SPACE: "guild-space"
};
let c1147_1 = new Set(Object.values(c1147_0));
const r43 = Object.freeze({
GUILD_FEED_REMOVED: 1,
PINNED: 2,
ACTIVE_CHANNELS_REMOVED: 4,
REQUIRE_TAG: 16,
IS_SPAM: 32,
IS_GUILD_RESOURCE_CHANNEL: 128,
CLYDE_AI: 256,
IS_SCHEDULED_FOR_DELETION: 512,
IS_MEDIA_CHANNEL: 1024,
SUMMARIES_DISABLED: 2048,
IS_ROLE_SUBSCRIPTION_TEMPLATE_PREVIEW_CHANNEL: 8192,
IS_BROADCASTING: 16384,
HIDE_MEDIA_DOWNLOAD_OPTIONS: 32768,
IS_JOIN_REQUEST_INTERVIEW_CHANNEL: 65536,
OBFUSCATED: 131072,
IS_MODERATOR_REPORT_CHANNEL: 524288,
IS_SPOILER_CHANNEL: 2097152,
IS_GAME_INVITES_CHANNEL: 4194304,
HAS_ONLY_SYSTEM_MESSAGES: 8388608
});
const r44 = {
GUILD_HOME: "home",
SERVER_GUIDE: "guide",
CHANNEL_BROWSER: "browse",
CUSTOMIZE_COMMUNITY: "customize",
LINKED_ROLES: "linked-roles"
};
const set = new Set(Object.values(r44));
export { c1147_0 as StaticChannelRoute };
export { c1147_1 as StaticChannelRoutes };
export function isStaticChannelRoute(a0) {
return c1147_1.has(a0);
}
export function buildGuildStaticChannelId(a0, a1) {
return `${a0}-${a1}`;
}
export function isGuildHomeChannel(a0) {
return !!(a0 == null ? void 0 : a0.includes(c1147_0.GUILD_HOME));
}
export { r43 as ChannelFlags };
export const MAX_CHANNEL_TOPIC_LENGTH = 1024;
export const MAX_FORUM_CHANNEL_TOPIC_LENGTH = 4096;
export { r44 as StaticChannelId };
export { set as StaticChannelIds };
@@ -0,0 +1,13 @@
// Metro module 10486 (f10487).
import GatewayConnectionStore from "../gateway/GatewayConnectionStore";
import ChannelStatusStore from "./ChannelStatusStore";
import Dispatcher from "../../Dispatcher";
export function fetchChannelInfo(a0) {
if (!ChannelStatusStore.hasRequestedStatuses(a0)) {
Dispatcher.dispatch({
type: "FETCH_CHANNEL_INFO",
guildId: a0
});
GatewayConnectionStore.getSocket().requestChannelInfo(a0, ["status", "voice_start_time"]);
}
}
@@ -0,0 +1,64 @@
// Metro module 10150 (f10151).
import GatewayConnectionStore from "../gateway/GatewayConnectionStore";
import ChannelStore from "../../stores/ChannelStore";
import SnowflakeUtils from "../../utils/SnowflakeUtils";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c6763_4 = Object.freeze({
online: null,
total: null
});
let c6763_5 = {};
let c6763_6 = {};
let c6763_7 = null;
class ChannelMemberCountStore extends Module589.PersistedStore {
static displayName = "ChannelMemberCountStore";
static persistKey = "channelMemberCounts";
initialize(a0) {
let r1 = a0;
this.waitFor(GatewayConnectionStore, ChannelStore);
if (a0 == null) {
r1 = c6763_5;
}
c6763_6 = r1;
}
getState() {
return c6763_6;
}
getMemberCount(a0) {
let r4 = c6763_6[a0];
if (r4 == null) {
r4 = c6763_4;
}
return r4;
}
requestCount(a0, a1) {
c6763_7 = {
guildId: a0,
channelId: a1
};
GatewayConnectionStore.getSocket().requestChannelMemberCount(a0, a1);
}
}
const channelMemberCountStore = new ChannelMemberCountStore(Dispatcher, {
CONNECTION_OPEN: function handleConnectionOpen() {
if (c6763_7 != null) {
GatewayConnectionStore.getSocket().requestChannelMemberCount(c6763_7.guildId, c6763_7.channelId);
}
SnowflakeUtils.keys(c6763_6).forEach((item) => {
if (ChannelStore.getChannel(item) == null) {
delete c6763_6[item];
}
});
},
CHANNEL_MEMBER_COUNT_UPDATE: function handleMemberCountUpdate({ channelId, online, total }) {
if (!(online == null && total == null)) {
c6763_6[channelId] = {
online,
total
};
}
return true;
}
});
export default channelMemberCountStore;
+11
View File
@@ -0,0 +1,11 @@
// Metro module 10307 (f10308).
import Module3771 from "../../_bundle/Module3771";
export function getMuteSettings(a0) {
return {
muted: true,
mute_config: {
selected_time_window: a0,
end_time: a0 > 0 ? Module3771().add(a0, "second").toISOString() : null
}
};
}
+51
View File
@@ -0,0 +1,51 @@
// Metro module 5782 (f5783).
import GatewayConnectionStore from "../gateway/GatewayConnectionStore";
import Module589 from "../../_bundle/Module589";
import { ChannelTypes } from "../../_bundle/Module692";
import Dispatcher from "../../Dispatcher";
let c3598_3, c3598_4;
const handleConnectionReset = function handleConnectionReset() {
c3598_3.clear();
};
const handleGuildReset = function handleGuildReset(a0) {
c3598_3.delete(a0.guild.id);
};
c3598_3 = new Set();
c3598_4 = {};
class ChannelStatusStore extends Module589.Store {
static displayName = "ChannelStatusStore";
initialize() {
this.waitFor(GatewayConnectionStore);
}
getChannelStatus(a0) {
if (a0 != null && a0.guild_id != null && a0.type === ChannelTypes.GUILD_VOICE) {
const r15 = c3598_4[a0.guild_id];
return r15 == null ? void 0 : r15[a0.id];
}
}
hasRequestedStatuses(a0) {
return c3598_3.has(a0);
}
}
const channelStatusStore = new ChannelStatusStore(Dispatcher, {
GUILD_CREATE: handleGuildReset,
GUILD_DELETE: handleGuildReset,
CONNECTION_RESUMED: handleConnectionReset,
CONNECTION_OPEN: handleConnectionReset,
VOICE_CHANNEL_STATUS_UPDATE: function handleVoiceChannelStatusUpdate(a0) {
if (c3598_4[a0.guildId] == null) {
c3598_4[a0.guildId] = {};
}
c3598_4[a0.guildId][a0.id] = a0.status;
},
CHANNEL_INFO: function handleChannelInfo({ guildId, channels }) {
c3598_4[guildId] = {};
for (const item of channels) {
c3598_4[guildId][item.id] = item.status;
}
},
FETCH_CHANNEL_INFO: function handleFetchChannelInfo(a0) {
c3598_3.add(a0.guildId);
}
});
export default channelStatusStore;
@@ -0,0 +1,8 @@
// Metro module 10251 (f10252).
import ChannelSectionStore from "../../stores/ChannelSectionStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import SelectedGuildStore from "../../stores/SelectedGuildStore";
export function isChannelCurrentlyVisible(a0) {
const channelId = SelectedChannelStore.getChannelId(SelectedGuildStore.getGuildId());
return channelId === a0 || ChannelSectionStore.getCurrentSidebarChannelId(channelId) === a0;
}
@@ -0,0 +1,10 @@
// Metro module 5657 (f5658).
import { createChannelRecord } from "../../records/ChannelRecord";
import { ChannelTypes } from "../../Constants";
const r18 = (0, createChannelRecord)({
id: "131",
type: ChannelTypes.DM,
name: "Placeholder Channel"
});
export const FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID = "131";
export { r18 as FAKE_PLACEHOLDER_PRIVATE_CHANNEL };
+243
View File
@@ -0,0 +1,243 @@
// Metro module 1933 (f1934).
import ImpersonateStore from "../impersonate/ImpersonateStore";
import { THREAD_CHANNEL_TYPES } from "../../records/ChannelRecord";
import { hasPermission } from "../../records/GuildRoleRecord";
import ChannelStore from "../../stores/ChannelStore";
import GuildMemberStore from "../../stores/GuildMemberStore";
import GuildRoleStore from "../../stores/GuildRoleStore";
import GuildStore from "../../stores/GuildStore";
import UserStore from "../../stores/UserStore";
import { GuildFeatures, Permissions } from "../../Constants";
import { isSubscriptionRole, isSubscriptionRoleAvailableForPurchase } from "../guild_role_subscriptions/PremiumRoleUtils";
import * as _RolePermissionUtils from "../guild_role_subscriptions/RolePermissionUtils";
import { isChannelAccessGrantedBy, hasViewChannelPermission } from "../guild_role_subscriptions/RolePermissionUtils";
import { isRestrictedFromShowingGuildPurchaseEntryPoints } from "../creator_monetization_review/CreatorMonetizationRestrictionsUtils";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c1619_12, c1619_13, isChannelSubscriptionGatedInGuild, computeForChannel;
const isSubscriptionGated = function isSubscriptionGated({ guildId, role, isPreviewingRoles }) {
let r17 = !!isSubscriptionRole(role);
if (r17) {
let r18 = !!isPreviewingRoles;
if (!r18) {
let r22 = role;
if (r22 == null) {
r22 = void 0;
}
let r25 = !!isSubscriptionRoleAvailableForPurchase(r22);
if (!r25) {
const r5 = role == null;
let r26 = false;
if (!r5) {
const currentUser = UserStore.getCurrentUser();
const r30 = currentUser == null;
r26 = false;
if (!r30) {
const member = GuildMemberStore.getMember(guildId, currentUser.id);
r26 = member != null && member.roles.includes(role.id);
}
}
r25 = !!r26;
}
r18 = r25;
}
r17 = r18;
}
return r17;
};
isChannelSubscriptionGatedInGuild = function isChannelSubscriptionGatedInGuild(channel, guild) {
if (!guild.features.has(GuildFeatures.CREATOR_MONETIZABLE) && !guild.features.has(GuildFeatures.CREATOR_MONETIZABLE_PROVISIONAL)) {
return false;
}
const isViewingServerShop = ImpersonateStore.isViewingServerShop(guild.id);
for (const item of Object.keys(channel.permissionOverwrites)) {
if (!isSubscriptionGated({
guildId: guild.id,
role: GuildRoleStore.getRole(guild.id, item),
isPreviewingRoles: isViewingServerShop
})) {
continue;
}
if (!isChannelAccessGrantedBy(channel, channel.permissionOverwrites[item])) {
continue;
}
return true;
}
const hasPermission2 = hasPermission(GuildRoleStore.getEveryoneRole(guild), Permissions.VIEW_CHANNEL);
const isChannelAccessDeniedBy = _RolePermissionUtils.isChannelAccessDeniedBy(channel, channel.permissionOverwrites[guild.id]);
if (!hasPermission2 && !isChannelAccessDeniedBy) {
for (const item2 of GuildRoleStore.getSortedRoles(guild.id)) {
if (!isSubscriptionGated({
guildId: guild.id,
role: item2,
isPreviewingRoles: isViewingServerShop
})) {
continue;
}
if (!hasViewChannelPermission(item2)) {
continue;
}
return true;
}
}
return false;
};
computeForChannel = function computeForChannel(guild_id, id) {
const r5 = c1619_12[guild_id];
if (r5 == null) {
return false;
}
const channel = ChannelStore.getChannel(id);
if (channel == null) {
return false;
}
const guild = GuildStore.getGuild(channel.getGuildId());
if (guild == null) {
return false;
}
const r17 = r5.has(id);
const isChannelSubscriptionGatedInGuild2 = isChannelSubscriptionGatedInGuild(channel, guild);
let r19 = r17 !== isChannelSubscriptionGatedInGuild2;
if (r19) {
if (isChannelSubscriptionGatedInGuild2) {
r5.add(id);
r19 = true;
} else {
r5.delete(id);
r19 = true;
}
}
return r19;
};
const handleInitialize = function handleInitialize() {
c1619_12 = {};
c1619_13.clear();
};
const handleGuildUpdate = function handleGuildUpdate(a0) {
delete c1619_12[a0.guild.id];
};
const handleGuildRoleUpdate = function handleGuildRoleUpdate(a0) {
delete c1619_12[a0.guildId];
};
const handleChannelUpdate = function handleChannelUpdate({ channel: channel2 }) {
let r3 = channel2.guild_id != null;
if (r3) {
const { guild_id, id } = channel2;
const r16 = c1619_12[guild_id];
const r5 = r16 == null;
let r2 = false;
if (!r5) {
const channel = ChannelStore.getChannel(id);
const r18 = channel == null;
r2 = false;
if (!r18) {
const guild = GuildStore.getGuild(channel.getGuildId());
const r23 = guild == null;
r2 = false;
if (!r23) {
const r25 = r16.has(id);
const isChannelSubscriptionGatedInGuild2 = isChannelSubscriptionGatedInGuild(channel, guild);
let r27 = r25 !== isChannelSubscriptionGatedInGuild2;
if (r27) {
if (isChannelSubscriptionGatedInGuild2) {
r16.add(id);
r27 = true;
} else {
r16.delete(id);
r27 = true;
}
}
r2 = r27;
}
}
}
r3 = r2;
}
return r3;
};
c1619_12 = {};
c1619_13 = new Set();
class GatedChannelStore extends Module589.Store {
static displayName = "GatedChannelStore";
initialize() {
this.waitFor(ChannelStore, GuildMemberStore, GuildRoleStore, GuildStore, ImpersonateStore, UserStore);
}
isChannelGated(a0, a1) {
if (a0 == null) {
return false;
}
let r8 = c1619_12[a0];
if (r8 == null) {
const guild = GuildStore.getGuild(a0);
if (guild != null) {
const set = new Set();
c1619_12[a0] = set;
if (guild.features.has(GuildFeatures.ROLE_SUBSCRIPTIONS_ENABLED)) {
const mutableGuildChannelsForGuild = ChannelStore.getMutableGuildChannelsForGuild(a0);
for (const key in mutableGuildChannelsForGuild) {
const r34 = mutableGuildChannelsForGuild[key];
if (isChannelSubscriptionGatedInGuild(r34, guild)) {
set.add(r34.id);
}
}
}
}
r8 = c1619_12[a0];
}
return r8 != null && r8.has(a1);
}
isChannelGatedAndVisible(a0, a1) {
return a0 != null && (this.isChannelGated(a0, a1) && !c1619_13.has(a0));
}
isChannelOrThreadParentGated(a0, a1) {
if (a0 == null) {
return false;
}
if (this.isChannelGated(a0, a1)) {
return true;
}
const channel = ChannelStore.getChannel(a1);
const r0 = channel == null || channel.parent_id == null || !THREAD_CHANNEL_TYPES.has(channel?.type);
return r0 ? !r0 : this.isChannelOrThreadParentGated(a0, channel.parent_id);
}
}
const gatedChannelStore = new GatedChannelStore(Dispatcher, {
CONNECTION_OPEN: handleInitialize,
OVERLAY_INITIALIZE: handleInitialize,
CACHE_LOADED_LAZY: handleInitialize,
GUILD_CREATE: handleGuildUpdate,
GUILD_UPDATE: handleGuildUpdate,
GUILD_DELETE: handleGuildUpdate,
GUILD_ROLE_CREATE: handleGuildRoleUpdate,
GUILD_ROLE_UPDATE: handleGuildRoleUpdate,
GUILD_ROLE_DELETE: handleGuildRoleUpdate,
IMPERSONATE_UPDATE: handleGuildRoleUpdate,
IMPERSONATE_STOP: handleGuildRoleUpdate,
CHANNEL_CREATE: handleChannelUpdate,
CHANNEL_DELETE: handleChannelUpdate,
CHANNEL_UPDATES: function handleChannelUpdates({ channels }) {
let r0 = false;
for (const item of channels) {
let r31 = item.guild_id != null;
if (r31) {
r31 = computeForChannel(item.guild_id, item.id);
}
if (r31) {
r0 = true;
}
}
return r0;
},
GUILD_ROLE_SUBSCRIPTIONS_FETCH_RESTRICTIONS_SUCCESS: function handleRoleSubscriptionsRestrictionsUpdate(a0) {
const guildId = a0.guildId;
if (isRestrictedFromShowingGuildPurchaseEntryPoints(a0.restrictions)) {
c1619_13.add(guildId);
} else {
c1619_13.delete(guildId);
}
},
GUILD_ROLE_SUBSCRIPTIONS_FETCH_RESTRICTIONS_FAILURE: function handleRoleSubscriptionsRestrictionsFetchFailure(a0) {
c1619_13.add(a0.guildId);
}
});
export default gatedChannelStore;
@@ -0,0 +1,51 @@
// Metro module 16314 (f16315).
import MediaEngineStore from "../../stores/MediaEngineStore";
import SelectedChannelStore, { findFirstVoiceChannelId } from "../../stores/SelectedChannelStore";
import SelectedGuildStore from "../../stores/SelectedGuildStore";
import { ChannelTypes, ME, NULL_STRING_GUILD_ID, Routes } from "../../Constants";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
import { transitionToGuild } from "../routing/transitionToGuild.native";
import SelectedChannelActionCreators from "../../actions/SelectedChannelActionCreators";
import { transitionTo } from "../routing/router_utils";
import Dispatcher from "../../Dispatcher";
class SelectedChannelManager extends AutomaticLifecycleManager {
actions = {
GUILD_CREATE: this.handleGuildCreate,
CHANNEL_CREATE: this.handleChannelCreate,
LOGOUT: this.handleLogout
};
handleGuildCreate({ guild }) {
const channelId = SelectedChannelStore.getChannelId(ME);
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
if (guild.id === channelId) {
transitionToGuild(guild.id);
}
if (guild.id === voiceChannelId && guild.unavailable !== false && voiceChannelId == null) {
SelectedChannelActionCreators.selectVoiceChannel(findFirstVoiceChannelId(guild.id));
}
}
handleChannelCreate({ channel }) {
if (channel.type === ChannelTypes.GROUP_DM) {
const originChannelId = channel.originChannelId;
const channelId = SelectedChannelStore.getChannelId(NULL_STRING_GUILD_ID);
if (SelectedGuildStore.getGuildId() == null && originChannelId != null && originChannelId === channelId) {
transitionTo(Routes.CHANNEL(ME, channel.id));
}
if (originChannelId != null && originChannelId === SelectedChannelStore.getVoiceChannelId()) {
SelectedChannelActionCreators.selectVoiceChannel(channel.id, MediaEngineStore.isVideoEnabled());
}
}
}
handleLogout() {
Dispatcher.dispatch({
type: "VOICE_CHANNEL_SELECT",
channelId: null,
guildId: null,
video: false,
currentVoiceChannelId: null,
joinVoiceId: null
});
}
}
const selectedChannelManager = new SelectedChannelManager();
export default selectedChannelManager;
@@ -0,0 +1,205 @@
// Metro module 12739 (f12740).
import _slicedToArray from "../../_bundle/_slicedToArray";
import SelectedGuildStore from "../../stores/SelectedGuildStore";
import VoiceStateStore from "../../stores/VoiceStateStore";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
function $mk90331($env) {
return () => {
const r1 = $env.$parent;
const r3 = r1[4];
const r8 = $env[0];
const r5 = r3[r8];
if (r5 != null) {
r1[4][r8] = {
...r5,
style: r1[3].GENTLE_AMBIENT
};
r1[9].emitChange();
}
delete r1[5][r8];
};
}
let updateChannelAnimationState, c8777_3, c8777_10, c8777_9;
let $mk90332 = function() {
return function clearAllTimers() {
for (const item of Object.keys(env8777[5])) {
clearTimeout(env8777[5][item]);
}
env8777[5] = {};
};
};
let env8777 = {};
const resetAllState = function resetAllState() {
$mk90332()();
env8777[4] = {};
};
updateChannelAnimationState = function updateChannelAnimationState(a0, a1) {
let r18;
const r11 = env8777[4][a0];
let r15 = r11?.userCount;
if (r15 == null) {
r15 = 0;
}
const userCount = Math.max(0, r15 + a1);
if (r15 === 0 && userCount > 0) {
let env20186;
env8777[4][a0] = {
style: c8777_3.GENTLE_AMBIENT_WITH_INTRO,
userCount
};
const r53 = env20186 = {
$parent: env8777
};
env20186[0] = a0;
if (env8777[5][a0] != null) {
clearTimeout(env8777[5][a0]);
delete env8777[5][a0];
}
env8777[5][a0] = setTimeout($mk90331(r53), 2000);
r18 = true;
} else if (r15 > 0 && userCount > r15) {
let env20185;
env8777[4][a0] = {
style: c8777_3.HIGH_CONTRAST,
userCount
};
const r35 = env20185 = {
$parent: env8777
};
env20185[0] = a0;
if (env8777[5][a0] != null) {
clearTimeout(env8777[5][a0]);
delete env8777[5][a0];
}
env8777[5][a0] = setTimeout($mk90331(r35), 2000);
r18 = true;
} else if (userCount === 0) {
if (env8777[5][a0] != null) {
clearTimeout(env8777[5][a0]);
delete env8777[5][a0];
}
delete env8777[4][a0];
r18 = true;
} else {
r18 = r11 != null && userCount !== r15;
if (r18) {
env8777[4][a0] = {
...r11,
userCount
};
r18 = true;
}
}
return r18;
};
const handleConnectionOpenOrLogout = function handleConnectionOpenOrLogout() {
$mk90332()();
env8777[4] = {};
return true;
};
c8777_3 = {
GENTLE_AMBIENT: "GENTLE_AMBIENT",
GENTLE_AMBIENT_WITH_INTRO: "GENTLE_AMBIENT_WITH_INTRO",
HIGH_CONTRAST: "HIGH_CONTRAST"
};
env8777[4] = {};
env8777[5] = {};
env8777[6] = null;
class VoiceChannelAnimationStateStoreClass extends Module589.Store {
static displayName = "VoiceChannelAnimationStateStore";
constructor() {
super(...arguments);
}
initialize() {
this.waitFor(VoiceStateStore, SelectedGuildStore);
}
getAnimationStyle(a0) {
let r6 = env8777[4][a0]?.style;
if (r6 == null) {
r6 = c8777_3.GENTLE_AMBIENT;
}
return r6;
}
getUserCount(a0) {
let r7 = env8777[4][a0]?.userCount;
if (r7 == null) {
r7 = 0;
}
return r7;
}
}
c8777_10 = VoiceChannelAnimationStateStoreClass;
c8777_9 = new VoiceChannelAnimationStateStoreClass(Dispatcher, {
VOICE_STATE_UPDATES: function handleVoiceStateUpdates({ voiceStates }) {
const guildId = SelectedGuildStore.getGuildId();
if (guildId !== env8777[6] && guildId != null) {
env8777[6] = guildId;
}
const r30 = {};
for (const item of voiceStates) {
if (item.guildId === guildId) {
if (item.oldChannelId != null) {
const oldChannelId = item.oldChannelId;
let r42 = r30[item.oldChannelId];
if (r42 == null) {
r42 = 0;
}
r30[oldChannelId] = r42 - 1;
}
if (item.channelId != null) {
const channelId = item.channelId;
let r49 = r30[item.channelId];
if (r49 == null) {
r49 = 0;
}
r30[channelId] = r49 + 1;
}
}
}
let r52 = false;
for (const item2 of Object.entries(r30)) {
const r65 = _slicedToArray(item2, 2);
if (updateChannelAnimationState(r65[0], r65[1])) {
r52 = true;
}
}
return r52;
},
CHANNEL_SELECT: function handleChannelSelect({ guildId }) {
if (guildId === env8777[6]) {
return false;
}
if (guildId == null) {
return false;
}
env8777[6] = guildId;
resetAllState();
const voiceStates = VoiceStateStore.getVoiceStates(guildId);
const r31 = {};
for (const item of Object.values(voiceStates)) {
if (item.channelId != null) {
const channelId = item.channelId;
let r45 = r31[item.channelId];
if (r45 == null) {
r45 = 0;
}
r31[channelId] = r45 + 1;
}
}
for (const item2 of Object.entries(r31)) {
const [r60, userCount] = item2;
if (userCount > 0) {
env8777[4][r60] = {
style: c8777_3.GENTLE_AMBIENT,
userCount
};
}
}
return true;
},
CONNECTION_OPEN: handleConnectionOpenOrLogout,
LOGOUT: handleConnectionOpenOrLogout
});
export default c8777_9;
export { c8777_3 as AnimationStyle };
@@ -0,0 +1,42 @@
// Metro module 8007 (f8008).
import { CommonTriggerPoints } from "../experiments/ExperimentConstants";
import { createExperiment } from "../experiments/index";
const experiment = createExperiment({
id: "2026-03_voice_badge",
kind: "guild",
commonTriggerPoint: CommonTriggerPoints.VOICE_CALL,
label: "Display Voice Channel Badge",
defaultConfig: {
enabled: false
},
treatments: [{
id: 0,
label: "Control",
config: {
enabled: false
}
}, {
id: 1,
label: "Show voice badges",
config: {
enabled: true
}
}]
});
export { experiment as VoiceChannelBadgeExperiment };
export function useVoiceChannelBadgeExperiment(a0) {
return experiment.useExperiment({
guildId: a0.guildId,
location: a0.location
}, {
autoTrackExposure: true
});
}
export function getVoiceChannelBadgeExperiment(a0) {
return experiment.getCurrentConfig({
guildId: a0.guildId,
location: a0.location
}, {
autoTrackExposure: true
});
}
@@ -0,0 +1,37 @@
// Metro module 16154 (f16155).
import { CommonTriggerPoints } from "../experiments/ExperimentConstants";
import { createExperiment } from "../experiments/index";
const experiment = createExperiment({
kind: "guild",
id: "2025-12_voice_channel_hoisting",
label: "Voice Channel Hoisting",
commonTriggerPoint: CommonTriggerPoints.VOICE_CALL,
defaultConfig: {
enableWaveformIcon: false,
enableHighlight: false
},
treatments: [{
id: 1,
label: "Both waveform and highlight",
config: {
enableWaveformIcon: true,
enableHighlight: true
}
}, {
id: 2,
label: "Waveform icon only",
config: {
enableWaveformIcon: true,
enableHighlight: false
}
}]
});
export { experiment as VoiceChannelHoistingExperiment };
export function useVoiceChannelHoistingExperiment(a0, a1) {
return experiment.useExperiment({
guildId: a0,
location: a1
}, {
autoTrackExposure: false
});
}
@@ -0,0 +1,56 @@
// Metro module 9499 (f9500).
import GatewayConnectionStore from "../gateway/GatewayConnectionStore";
import Durations from "../../utils/Durations";
import Module589 from "../../_bundle/Module589";
import { ChannelTypes } from "../../_bundle/Module692";
import Dispatcher from "../../Dispatcher";
let c6264_4, c6264_5;
const _toTimestampMs = function _toTimestampMs(voiceStartTime) {
return new Date(voiceStartTime * Durations.Millis.SECOND).getTime();
};
const handleConnectionReset = function handleConnectionReset() {
c6264_4.clear();
};
const handleGuildReset = function handleGuildReset(a0) {
c6264_4.delete(a0.guild.id);
};
c6264_4 = new Set();
c6264_5 = {};
class VoiceChannelStartTimeStore extends Module589.Store {
static displayName = "VoiceChannelStartTimeStore";
initialize() {
this.waitFor(GatewayConnectionStore);
}
getStartTime(a0) {
if (a0 != null && a0.guild_id != null && a0.type === ChannelTypes.GUILD_VOICE) {
const r15 = c6264_5[a0.guild_id];
return r15 == null ? void 0 : r15[a0.id];
}
}
hasRequestedStartTimes(a0) {
return c6264_4.has(a0);
}
}
const voiceChannelStartTimeStore = new VoiceChannelStartTimeStore(Dispatcher, {
GUILD_CREATE: handleGuildReset,
GUILD_DELETE: handleGuildReset,
CONNECTION_RESUMED: handleConnectionReset,
CONNECTION_OPEN: handleConnectionReset,
VOICE_CHANNEL_START_TIME_UPDATE: function handleVoiceChannelStartTimeUpdate({ guildId, id, voiceStartTime }) {
if (c6264_5[guildId] == null) {
c6264_5[guildId] = {};
}
c6264_5[guildId][id] = voiceStartTime != null ? new Date(voiceStartTime * Durations.Millis.SECOND).getTime() : void 0;
},
CHANNEL_INFO: function handleStartTimes({ guildId, channels }) {
c6264_5[guildId] = {};
for (const item of channels) {
const { id, voiceStartTime } = item;
c6264_5[guildId][id] = voiceStartTime != null ? _toTimestampMs(voiceStartTime) : void 0;
}
},
FETCH_CHANNEL_INFO: function handleFetchChannelInfo(a0) {
c6264_4.add(a0.guildId);
}
});
export default voiceChannelStartTimeStore;
+6
View File
@@ -0,0 +1,6 @@
// Metro module 5006 (f5007).
import { isPrivate } from "../../records/ChannelRecord";
import { BasicPermissions } from "../../Constants";
export default function canJoinVoiceChannel(a0, a1) {
return isPrivate(a0.type) || a1.canBasicChannel(BasicPermissions.CONNECT | BasicPermissions.VIEW_CHANNEL, a0);
};
+143
View File
@@ -0,0 +1,143 @@
// Metro module 8316 (f8317).
import { THREAD_CHANNEL_TYPES } from "../../records/ChannelRecord";
import RelationshipStore from "../../stores/RelationshipStore";
import UserStore from "../../stores/UserStore";
import { ChannelTypes, StatusTypes } from "../../Constants";
import { intl, t } from "../../intl/index.native";
import { computeChannelName } from "./useChannelName";
import isRoleRequired from "./isRoleRequired";
import { getName, humanizeStatus } from "../../utils/UserUtils";
import { formatActiveA11yTimestamp } from "../content_inventory/utils";
export default function getChannelA11yLabel({ channel, unread = false, mentionCount = 0, voiceStates, embeddedActivitiesCount, activityNames, isSubscriptionGated, needSubscriptionToAccess, isIncomingCall = false, isOngoingCall = false, voiceChannelStartTime }) {
let r20, r74;
const channelName = computeChannelName(channel, UserStore, RelationshipStore);
const r39 = isRoleRequired(channel) ? intl.string(t["4qvAtn"]) : void 0;
const type = channel.type;
if (ChannelTypes.DM === type) {
r20 = mentionCount > 0 ? t.TO8LYt : unread ? t.F2MZsu : t.fYqXVY;
r74 = void 0;
} else if (ChannelTypes.GROUP_DM === type) {
r74 = [intl.formatToPlainString(mentionCount > 0 ? t.Lo0dCa : unread ? t["fxxUo/"] : t.lts3Ld, {
channelName,
mentionCount
}), intl.formatToPlainString(t.CxSA5N, {
members: channel.recipients.length + 1
})].join(", ");
r20 = void 0;
} else if (ChannelTypes.GUILD_STORE === type) {
r20 = t.Bo4msg;
r74 = void 0;
} else if (ChannelTypes.GUILD_DIRECTORY === type) {
r20 = t["92EAF2"];
r74 = void 0;
} else if (ChannelTypes.GUILD_ANNOUNCEMENT === type) {
r20 = mentionCount > 0 ? t.sDKIpm : unread ? t.VM7z8f : t.WJ3MPt;
r74 = void 0;
} else if (ChannelTypes.GUILD_VOICE === type) {
const r86 = [intl.formatToPlainString(t.bkpadO, {
channelName
})];
if (mentionCount > 0) {
r86.push(intl.formatToPlainString(t["3l1GOx"], {
mentionCount
}));
}
if (unread) {
r86.push(intl.string(t.x5zAGZ));
}
const userLimit = channel.userLimit;
if (voiceStates != null && voiceStates.length > 0) {
const overflow = voiceStates.length - 3;
r86.push(voiceStates.slice(0, 3).map((item) => {
let nick = item.nick;
const user = item.user;
if (nick == null) {
nick = getName(user);
}
return nick;
}).join(", "));
if (0 < overflow) {
r86.push(intl.formatToPlainString(t.sfgpgr, {
overflow
}));
}
if (userLimit != null && userLimit > 0) {
r86.push(intl.formatToPlainString(t["6qgTOF"], {
userCount: voiceStates.length,
limit: userLimit
}));
}
}
if (voiceChannelStartTime != null) {
r86.push(intl.formatToPlainString(t.JQtsGh, {
duration: formatActiveA11yTimestamp({
start: voiceChannelStartTime
}, Date.now())
}));
}
if (activityNames != null && activityNames.length > 0) {
r86.push(intl.formatToPlainString(t.LmYuHT, {
activeActivities: activityNames.join(", ")
}));
}
r74 = r86.join(", ");
r20 = void 0;
} else if (ChannelTypes.GUILD_STAGE_VOICE === type) {
r20 = t.TPPk2T;
r74 = void 0;
} else {
r20 = THREAD_CHANNEL_TYPES.has(channel.type) ? mentionCount > 0 ? t["ZL7+I6"] : unread ? t.YlVvmc : t["0nZpiF"] : mentionCount > 0 ? t.g8ONM0 : unread ? t.smf1CZ : t.s0JADj;
r74 = void 0;
}
const r239 = r74 != null ? [r74] : r20 != null ? [intl.formatToPlainString(r20, {
channelName,
mentionCount
})] : [];
if (isIncomingCall) {
r239.push(intl.string(t["fk1/bX"]));
} else if (isOngoingCall) {
r239.push(intl.string(t["NGg/fm"]));
}
if (embeddedActivitiesCount != null && embeddedActivitiesCount > 0) {
r239.push(intl.formatToPlainString(t.O6PLYd, {
activitiesCount: embeddedActivitiesCount
}));
}
const r284 = isSubscriptionGated ? needSubscriptionToAccess ? intl.string(t["oj+HOs"]) : intl.string(t.xI3TQQ) : void 0;
if (r284 != null) {
r239.push(r284);
}
if (r39 != null) {
r239.push(r39);
}
return r239.join(", ");
};
export function getStatusLabel(a0) {
if (StatusTypes.ONLINE === a0) {
return humanizeStatus(StatusTypes.ONLINE);
}
if (StatusTypes.IDLE === a0) {
return humanizeStatus(StatusTypes.IDLE);
}
if (StatusTypes.DND === a0) {
return humanizeStatus(StatusTypes.DND);
}
if (StatusTypes.INVISIBLE === a0) {
return humanizeStatus(StatusTypes.INVISIBLE);
}
return "";
}
export function getChannelA11yHint({ channel, muted, userStatus, isFavorite }) {
const r12 = [];
if (isFavorite) {
r12.push(intl.string(t.cCPjSK));
}
if (muted === true) {
r12.push(intl.string(t.C4zCMb));
return r12.join(", ");
}
if (channel.type === ChannelTypes.DM && userStatus != null) {
r12.push(StatusTypes.ONLINE === userStatus ? humanizeStatus(StatusTypes.ONLINE) : StatusTypes.IDLE === userStatus ? humanizeStatus(StatusTypes.IDLE) : StatusTypes.DND === userStatus ? humanizeStatus(StatusTypes.DND) : StatusTypes.INVISIBLE === userStatus ? humanizeStatus(StatusTypes.INVISIBLE) : "");
}
return r12.length > 0 ? r12.join(", ") : void 0;
}
+35
View File
@@ -0,0 +1,35 @@
// Metro module 12023 (f12024).
import UserStore from "../../stores/UserStore";
import { ChannelTypes } from "../../Constants";
import { isNotNullish } from "../../utils/GlobalUtils";
import AvatarUtils from "../../utils/AvatarUtils";
export function getChannelIconURL(a0, size = 32) {
const type = a0.type;
if (ChannelTypes.DM === type) {
const [r35] = a0.recipients.map(UserStore.getUser).filter(isNotNullish);
return r35 != null ? r35.getAvatarURL(void 0, size, arguments[2]) : null;
}
if (ChannelTypes.GROUP_DM === type) {
return AvatarUtils.getChannelIconURL({
id: a0.id,
icon: a0.icon,
applicationId: a0.getApplicationId(),
size
});
}
}
export function getChannelIconSource(a0) {
const type = a0.type;
if (ChannelTypes.DM === type) {
const [r36] = a0.recipients.map(UserStore.getUser).filter(isNotNullish);
return r36 != null ? r36.getAvatarSource(void 0) : null;
}
if (ChannelTypes.GROUP_DM === type) {
return AvatarUtils.getChannelIconSource({
id: a0.id,
icon: a0.icon,
applicationId: a0.getApplicationId(),
size: 128
});
}
}
+25
View File
@@ -0,0 +1,25 @@
// Metro module 4998 (f4999).
import GuildRoleStore from "../../stores/GuildRoleStore";
import GuildStore from "../../stores/GuildStore";
import * as _Constants from "../../Constants";
import { combine, hasAny } from "../../_bundle/HighLow";
const { ChannelTypes, Permissions } = _Constants;
let c3006_4 = [ChannelTypes.GUILD_TEXT, ChannelTypes.GUILD_VOICE, ChannelTypes.GUILD_ANNOUNCEMENT, ChannelTypes.GUILD_FORUM, ChannelTypes.PUBLIC_THREAD, ChannelTypes.PRIVATE_THREAD];
let c3006_5 = combine(Permissions.VIEW_CHANNEL, Permissions.SEND_MESSAGES);
export default function getConnectionsRoles(a0) {
if (a0 != null && c3006_4.includes(a0.type)) {
const guild = GuildStore.getGuild(a0.guild_id);
return guild == null ? [] : Object.values(a0.permissionOverwrites).filter((item) => {
let r1 = item.type === 0;
if (r1) {
const role = GuildRoleStore.getRole(guild.id, item.id);
r1 = (role == null ? void 0 : role.tags?.guild_connections) === null;
}
if (r1) {
r1 = !hasAny(item.deny, c3006_5);
}
return r1;
}).map((item) => GuildRoleStore.getRole(guild.id, item.id)).filter((item) => item != null);
}
return [];
};
@@ -0,0 +1,5 @@
// Metro module 5128 (f5129).
import Module12 from "../../_bundle/Module12";
export default function getFlattenedChannelList(a0, c14686_0, r3 = () => true) {
return Module12(a0).map((item) => item.channel.id === "null" ? c14686_0[item.channel.id] : [item, c14686_0[item.channel.id]]).flattenDeep().filter(r3).value();
};
@@ -0,0 +1,57 @@
// Metro module 11523 (f11524).
import { useEffect } from "react";
import ApplicationStore from "../../applications/ApplicationStore";
import AuthorizedAppsStore, { FetchState } from "../../oauth2/AuthorizedAppsStore";
import { useStateFromStoresObject, useStateFromStores } from "../../../_bundle/Module589";
import AuthorizedAppsActionCreators from "../../oauth2/AuthorizedAppsActionCreators";
import ApplicationActionCreators from "../../applications/ApplicationActionCreators";
export default function useRequiredLinkedLobbyApplicationAuthorization(a0) {
const r10 = a0?.require_application_authorization ? a0.application_id : null;
let authorizationsFetchState, stateFromStores, stateFromStores2;
const application_id = r10;
const stateFromStoresObject = useStateFromStoresObject([AuthorizedAppsStore], () => ({
authorizationsFetchState: AuthorizedAppsStore.getFetchState(),
applicationOAuth2Token: AuthorizedAppsStore.getNewestTokenForApplication(application_id)
}));
authorizationsFetchState = stateFromStoresObject.authorizationsFetchState;
const applicationOAuth2Token = stateFromStoresObject.applicationOAuth2Token;
stateFromStores = useStateFromStores([ApplicationStore], () => ApplicationStore.getApplication(application_id));
let r33 = useStateFromStores([ApplicationStore], () => ApplicationStore.getApplication(stateFromStores?.parentId));
stateFromStores2 = r33;
useEffect(() => {
if (application_id != null && authorizationsFetchState === FetchState.NOT_FETCHED) {
AuthorizedAppsActionCreators.fetch();
}
}, [authorizationsFetchState, application_id]);
useEffect(() => {
if (application_id != null && stateFromStores == null && authorizationsFetchState === FetchState.FETCHED) {
ApplicationActionCreators.fetchApplications([application_id], false);
}
}, [application_id, applicationOAuth2Token, authorizationsFetchState, stateFromStores]);
useEffect(() => {
if (stateFromStores != null && stateFromStores.parentId != null && stateFromStores2 == null && authorizationsFetchState === FetchState.FETCHED) {
ApplicationActionCreators.fetchApplications([stateFromStores.parentId], false);
}
}, [stateFromStores, authorizationsFetchState, stateFromStores2]);
const r44 = stateFromStores != null && (stateFromStores.parentId == null || stateFromStores2 != null);
const showLinkedLobbyApplicationLoadingIndicator = application_id != null && (authorizationsFetchState !== FetchState.FETCHED || stateFromStores == null || !r44);
const r51 = applicationOAuth2Token == null;
let requiredLinkedLobbyApplication = null;
if (r51) {
const r53 = stateFromStores != null;
requiredLinkedLobbyApplication = null;
if (r53) {
requiredLinkedLobbyApplication = null;
if (r44) {
if (stateFromStores2 == null) {
r33 = stateFromStores;
}
requiredLinkedLobbyApplication = r33;
}
}
}
return {
showLinkedLobbyApplicationLoadingIndicator,
requiredLinkedLobbyApplication
};
};
+19
View File
@@ -0,0 +1,19 @@
// Metro module 4680 (f4681).
import { GUILD_NON_CATEGORY_CHANNEL_TYPES } from "../../records/ChannelRecord";
import { Permissions } from "../../_bundle/Module505";
import { canEveryoneRole } from "../../utils/PermissionUtils";
import { has } from "../../_bundle/HighLow";
export default function isRoleRequired(a0) {
if (a0 == null) {
return false;
}
const type = a0.type;
if (a0.guild_id != null && GUILD_NON_CATEGORY_CHANNEL_TYPES.has(type)) {
if (a0.isGuildVocal() && !canEveryoneRole(Permissions.CONNECT, a0)) {
return true;
}
const r22 = a0.permissionOverwrites[a0.guild_id];
return r22 != null && has(r22.deny, Permissions.VIEW_CHANNEL);
}
return false;
};
@@ -0,0 +1,8 @@
// Metro module 10224 (f10225).
import { getChannelPermalink } from "../../../utils/ChannelUtils";
import { copy } from "../../../utils/ClipboardUtils.native";
import { presentLinkCopied } from "../../toast/native/ToastUtils";
export function copyGuildChannelOrThreadLink(a0, a1) {
copy(getChannelPermalink(a0, a1));
presentLinkCopied();
}
@@ -0,0 +1,706 @@
// Metro module 9098 (f9099).
import { useEffect } from "react";
import { SafetyWarningTypes } from "../../self_mod/ChannelSafetyWarningsStore";
import ChannelSpoilerAgreeStore from "../../spoiler_channels/ChannelSpoilerAgreeStore";
import StageInstanceStore from "../../stage_channels/StageInstanceStore";
import ActiveThreadsStore from "../../threads/ActiveThreadsStore";
import { isGuildTextChannelType, isGuildVocalChannelType, isReadableType, isTextChannel } from "../../../records/ChannelRecord";
import CategoryCollapseStore from "../../../stores/CategoryCollapseStore";
import ChannelStore from "../../../stores/ChannelStore";
import CollapsedVoiceChannelStore from "../../../stores/CollapsedVoiceChannelStore";
import GuildStore from "../../../stores/GuildStore";
import PermissionStore from "../../../stores/PermissionStore";
import RelationshipStore from "../../../stores/RelationshipStore";
import SelectedChannelStore from "../../../stores/SelectedChannelStore";
import UserGuildSettingsStore from "../../../stores/UserGuildSettingsStore";
import UserStore from "../../../stores/UserStore";
import { AnalyticsObjectTypes, AnalyticsObjects, AnalyticsSections, ChannelSettingsSections, ChannelTypes, InstantInviteSources, NULL_STRING_GUILD_ID, Permissions, ZERO_STRING_GUILD_ID } from "../../../Constants";
import { ChannelDetailsNavigatorScreens } from "../../main_tabs_v2/native/sidebar/details/ChannelDetailsConstants";
import "../../../_bundle/asyncRequire";
import { intl, t } from "../../../intl/index.native";
import { UserCircleIcon } from "../../../design/components/Icon/native/redesign/generated/UserCircleIcon";
import showUserProfileActionSheet from "../../user_profile/native/showUserProfileActionSheet";
import { UserMinusIcon } from "../../../design/components/Icon/native/redesign/generated/UserMinusIcon";
import ChannelActionCreators from "../../../actions/ChannelActionCreators";
import useChannelName, { computeChannelName } from "../useChannelName";
import AlertActionCreators from "../../../actions/AlertActionCreators";
import { PencilIcon } from "../../../design/components/Icon/native/redesign/generated/PencilIcon";
import showChatGDMCustomizeActionSheet from "../../group_dm/native/showChatGDMCustomizeActionSheet";
import { LinkIcon } from "../../../design/components/Icon/native/redesign/generated/LinkIcon";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import FavoritesGuild_messages from "../../favorites/intl/FavoritesGuild.messages";
import { ServerIcon } from "../../../design/components/Icon/native/redesign/generated/ServerIcon";
import { transitionToGuild } from "../../routing/router_utils";
import { PlusLargeIcon } from "../../../design/components/Icon/native/redesign/generated/PlusLargeIcon";
import buildFavoritesSectionButtons from "../../favorites/native/buildFavoritesSectionButtons";
import { GroupPlusIcon } from "../../../design/components/Icon/native/redesign/generated/GroupPlusIcon";
import { showInstantInviteActionSheet } from "../../instant_invite/native/InstantInviteUtils";
import { PinIcon } from "../../../design/components/Icon/native/redesign/generated/PinIcon";
import { setIsFavorite, setOptInChannel, setMessagesFavorite } from "../../opt_in_channels/OptInChannelsActionCreators";
import { getRootNavigationRef } from "../../main_tabs_v2/RootNavigationRef.native";
import { XSmallIcon } from "../../../design/components/Icon/native/redesign/generated/XSmallIcon";
import { copyGuildChannelOrThreadLink } from "./ChannelActionSheetUtils";
import { WarningIcon } from "../../../design/components/Icon/native/redesign/generated/WarningIcon";
import { markAsInappropriateConversation } from "../../self_mod/inappropriate_conversation/InappropriateConversationsActionCreators";
import { InboxIcon } from "../../../design/components/Icon/native/redesign/generated/InboxIcon";
import { markAsMessageRequest, clearMessageRequestState } from "../../message_request/MessageRequestActionCreators";
import { EyeIcon } from "../../../design/components/Icon/native/redesign/generated/EyeIcon";
import { ackChannel } from "../../../actions/ReadStateActionCreators";
import { BellSlashIcon } from "../../../design/components/Icon/native/redesign/generated/BellSlashIcon";
import { BellIcon } from "../../../design/components/Icon/native/redesign/generated/BellIcon";
import NotificationSettingsModalActionCreators from "../../../actions/NotificationSettingsModalActionCreators";
import { NotificationLabel } from "../../../utils/NotificationSettingsUtils";
import { ChannelNotificationIcon } from "../../../design/components/Icon/native/redesign/generated/ChannelNotificationIcon";
import ChannelSettingsActionCreators from "../../../actions/ChannelSettingsActionCreators";
import { ThreadIcon } from "../../../design/components/Icon/native/redesign/generated/ThreadIcon";
import showThreadBrowserModal from "../../threads/native/showThreadBrowserModal";
import ChannelCollapseActionCreators from "../../../actions/ChannelCollapseActionCreators";
import { StageIcon } from "../../../design/components/Icon/native/redesign/generated/StageIcon";
import { ChatIcon } from "../../../design/components/Icon/native/redesign/generated/ChatIcon";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import hideLaunchPad from "../../launchpad/native/hideLaunchPad";
import ChannelRTCActionCreators from "../../../actions/ChannelRTCActionCreators";
import { FlagIcon } from "../../../design/components/Icon/native/redesign/generated/FlagIcon";
import { showReportModalForStageChannel } from "../../in_app_reports/ReportModals";
import { EyeSlashIcon } from "../../../design/components/Icon/native/redesign/generated/EyeSlashIcon";
import GuildActionCreators from "../../../actions/GuildActionCreators";
import { SettingsIcon } from "../../../design/components/Icon/native/redesign/generated/SettingsIcon";
import { CopyIcon } from "../../../design/components/Icon/native/redesign/generated/CopyIcon";
import CreateChannelModalActionCreators from "../../../actions/native/CreateChannelModalActionCreators";
import { IdIcon } from "../../../design/components/Icon/native/redesign/generated/IdIcon";
import { copy } from "../../../utils/ClipboardUtils.native";
import { presentIdCopied } from "../../toast/native/ToastUtils";
import useAnalyticsLocations, { AnalyticsLocationProvider } from "../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../app_analytics/AnalyticsLocation";
import { useIsFavoritesGuildSelected } from "../../favorites/FavoritesHooks";
import { useStateFromStores, useStateFromStoresObject } from "../../../_bundle/Module589";
import { MODERATE_STAGE_CHANNEL_PERMISSIONS } from "../../stage_channels/StageChannelPermissions";
import { useOptInEnabledForGuild } from "../../opt_in_channels/isOptInEnabled";
import useIsNsfwGated from "../../age_gate/useIsNsfwGated";
import { DeveloperMode } from "../../user_settings/UserSettings";
import GuildIcon, { GuildIconSizes } from "../../guild/native/GuildIcon";
import { Avatar, AvatarSizes } from "../../../design/void/native";
import { useInappropriateConversationsTiers } from "../../self_mod/inappropriate_conversation/hooks/useInappropriateConversationsTiers";
import useFavoritesGuildChannelActions from "../../favorites/native/action/useFavoritesGuildChannelActions";
import useFavoritesGuildCategoryAddAction from "../../favorites/native/action/useFavoritesGuildCategoryAddAction";
import { ActionSheet } from "../../../design/components/Sheet/native/ActionSheet.native";
import { isMetaQuest } from "../../device/MetaQuestUtils.android";
import { ActionSheetIconHeader } from "../../../design/components/Sheet/native/ActionSheetIconHeader.native";
import { ActionSheetRow } from "../../../design/components/Sheet/native/ActionSheetRow.native";
let ChannelLongPressActionSheetConnected;
const handleVoiceOrStageChannelConnectPress = async function handleVoiceOrStageChannelConnectPress(c26358_0) {
let c30024_0 = c26358_0;
if (c26358_0.isGuildStageVoice()) {
(0, (await import("../../stage_channels/StageChannelModalActionCreators")).connectAndOpen)(c30024_0);
} else {
(0, (await import("../../../utils/native/PrivateChannelCallUtils")).openGuildVoiceModal)(c30024_0, "Channel List");
}
};
ChannelLongPressActionSheetConnected = function ChannelLongPressActionSheetConnected(props) {
let label, label2;
let setting, c16949_4;
const { channel, onClose } = props;
setting = void 0;
c16949_4 = void 0;
const analyticsLocations2 = useAnalyticsLocations(AnalyticsLocation.CHANNEL_LONG_PRESS_MENU).analyticsLocations;
let r57 = channel.getGuildId();
const guildId = r57;
const isFavoritesGuildSelected = useIsFavoritesGuildSelected();
const stateFromStores4 = useStateFromStores([GuildStore], () => GuildStore.getGuild(guildId));
const stateFromStoresObject = useStateFromStoresObject([PermissionStore], () => ({
canManageChannel: PermissionStore.can(Permissions.MANAGE_CHANNELS, channel),
canCreateInstantInvite: PermissionStore.can(Permissions.CREATE_INSTANT_INVITE, channel),
canConnect: PermissionStore.can(Permissions.CONNECT, channel),
canModerateStage: PermissionStore.can(MODERATE_STAGE_CHANNEL_PERMISSIONS, channel)
}));
const canManageChannel = stateFromStoresObject.canManageChannel;
let canCreateInstantInvite = stateFromStoresObject.canCreateInstantInvite;
const { canConnect, canModerateStage } = stateFromStoresObject;
if (guildId == null) {
r57 = NULL_STRING_GUILD_ID;
}
const optInEnabledForGuild = useOptInEnabledForGuild(r57);
const stateFromStoresObject2 = useStateFromStoresObject([UserGuildSettingsStore], () => {
let r3 = guildId;
const r1 = {
isOptedIn: UserGuildSettingsStore.isChannelOptedIn(guildId, channel.id),
isParentOptedIn: channel.parent_id != null && UserGuildSettingsStore.isChannelOptedIn(guildId, channel.parent_id),
isPinned: null
};
if (guildId == null) {
r3 = ZERO_STRING_GUILD_ID;
}
r1.isPinned = UserGuildSettingsStore.isFavorite(r3, channel.id);
return r1;
});
const { isOptedIn: isOptedIn2, isParentOptedIn, isPinned: isPinned2 } = stateFromStoresObject2;
const stateFromStores9 = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.isChannelMuted(guildId, channel.id));
const stateFromStores8 = useStateFromStores([ActiveThreadsStore], () => guildId != null && ActiveThreadsStore.hasThreadsForChannel(guildId, channel.id));
const stateFromStores6 = useStateFromStores([CategoryCollapseStore], () => CategoryCollapseStore.isCollapsed(channel.parent_id));
const stateFromStores7 = useStateFromStores([CollapsedVoiceChannelStore], () => CollapsedVoiceChannelStore.isCollapsed(channel.id));
const stateFromStores5 = useStateFromStores([StageInstanceStore], () => StageInstanceStore.isLive(channel.id));
const channelName = useChannelName(channel, true);
const isNsfwGated = useIsNsfwGated(channel);
setting = DeveloperMode.useSetting();
const icon = stateFromStores4 != null ? <GuildIcon guild={stateFromStores4} size={GuildIconSizes.LARGE} /> : <Avatar size={AvatarSizes.LARGE} channel={channel} />;
const stateFromStores11 = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
const r142 = stateFromStores11 != null && channel.isOwner(stateFromStores11.id);
const stateFromStores10 = useStateFromStores([UserGuildSettingsStore], () => UserGuildSettingsStore.isMessagesFavorite(channel.id));
const inappropriateConversationsTiers = useInappropriateConversationsTiers(channel);
const r4 = inappropriateConversationsTiers?.isTier1 != null && !inappropriateConversationsTiers?.isTier1;
const r158 = inappropriateConversationsTiers?.isTier2 != null && !inappropriateConversationsTiers?.isTier2;
const stateFromStores12 = useStateFromStores([ChannelSpoilerAgreeStore], () => ChannelSpoilerAgreeStore.didAgree(channel.id));
const favoritesGuildChannelActions = useFavoritesGuildChannelActions(channel, "ChannelLongPressActionSheet");
const favoritesGuildCategoryAddAction = useFavoritesGuildCategoryAddAction(channel);
const r173 = stateFromStores11 == null ? void 0 : stateFromStores11.isStaff();
let guildId2;
const channel2 = channel;
const stateFromStores = stateFromStores9;
const isOptedIn = isOptedIn2;
const isPinned = isPinned2;
const stateFromStores2 = stateFromStores10;
const analyticsLocations = analyticsLocations2;
const r41 = {
sectionKey: "dm",
buttons: []
};
if (channel.isDM()) {
r41.buttons.push({
label: intl.string(t.LYju5J),
IconComponent: UserCircleIcon,
onPress: () => {
showUserProfileActionSheet({
userId: channel2.getRecipientId(),
channelId: channel2.id,
sourceAnalyticsLocations: analyticsLocations
});
}
});
if (!isFavoritesGuildSelected) {
r41.buttons.push({
label: intl.string(t.jsvgc3),
IconComponent: UserMinusIcon,
onPress: () => {
ChannelActionCreators.closePrivateChannel(channel2.id, SelectedChannelStore.getCurrentlySelectedChannelId() === channel2.id);
}
});
}
}
const r210 = {
sectionKey: "gdm",
buttons: []
};
const r212 = {
sectionKey: "gdm-destructive",
buttons: []
};
if (channel.isGroupDM()) {
if (!isFavoritesGuildSelected) {
r212.buttons.push({
label: intl.string(t["26C4oi"]),
IconComponent: UserMinusIcon,
isDestructive: true,
onPress: () => {
const name = computeChannelName(channel2, UserStore, RelationshipStore);
const r23 = intl.formatToPlainString(t.hJ5Ap4, {
name
});
let body = intl.format(t.SSIVOu, {
name
});
const isManaged = channel2.isManaged();
let title = r23;
if (isManaged) {
title = intl.formatToPlainString(t.hVGjEW, {
name
});
body = intl.format(t.IK1Qvs, {
name
});
}
AlertActionCreators.show({
title,
body,
confirmText: intl.string(t.p89ACt),
cancelText: intl.string(t.gm1Vej),
onConfirm: () => {
ChannelActionCreators.closePrivateChannel(channel2.id, SelectedChannelStore.getCurrentlySelectedChannelId() === channel2.id);
}
});
}
});
}
r210.buttons.push({
label: intl.string(t["1r5E+m"]),
IconComponent: PencilIcon,
onPress: () => {
showChatGDMCustomizeActionSheet({
channelId: channel2.id
});
}
});
if (r142) {
r210.buttons.push({
label: intl.string(t.OQ9MKu),
IconComponent: LinkIcon,
onPress: () => {
ModalActionCreators.pushLazy(import("../../instant_invite/native/components/GroupDMInviteManagementScreen"), {
channelId: channel2.id
});
}
});
}
}
const r264 = [];
if (r41.buttons.length > 0) {
r264.push(r41);
}
if ((isFavoritesGuildSelected ? channel.guild_id != null : isFavoritesGuildSelected) && !channel.isCategory()) {
r264.push({
sectionKey: "go-to-server",
buttons: [{
label: intl.string(FavoritesGuild_messages["3KruG3"]),
IconComponent: ServerIcon,
onPress: () => {
transitionToGuild(channel2.guild_id, channel2.id);
}
}]
});
}
if (favoritesGuildCategoryAddAction != null) {
r264.push({
sectionKey: "favorites-add-to-category",
buttons: [{
label: favoritesGuildCategoryAddAction.label,
IconComponent: PlusLargeIcon,
onPress: favoritesGuildCategoryAddAction.perform
}]
});
}
const r302 = buildFavoritesSectionButtons(favoritesGuildChannelActions);
if (r302 != null) {
r264.push({
sectionKey: "favorites",
buttons: [r302]
});
}
guildId2 = channel.getGuildId();
const r310 = {
sectionKey: "channel-actions",
buttons: []
};
if (canCreateInstantInvite) {
canCreateInstantInvite = channel.type !== ChannelTypes.GUILD_CATEGORY;
}
if (canCreateInstantInvite) {
r310.buttons.push({
label: intl.string(t.VINpSK),
IconComponent: GroupPlusIcon,
onPress: () => {
showInstantInviteActionSheet(channel2, {
source: InstantInviteSources.CONTEXT_MENU
});
}
});
}
if (!(isFavoritesGuildSelected || guildId2 == null || channel.isThread())) {
if (!channel.isCategory()) {
r310.buttons.push({
label: isPinned ? intl.string(t.M5PWSf) : intl.string(t.RMpwZu),
IconComponent: PinIcon,
onPress: () => {
setIsFavorite(guildId2, channel2.id, !isPinned, {
section: AnalyticsSections.CHANNEL_ACTION_SHEET
});
if (!isPinned) {
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null) {
const name = rootNavigationRef.getCurrentRoute()?.name;
const params = rootNavigationRef.getCurrentRoute()?.params;
if (name === "guilds" && params?.guildId === guildId2) {
rootNavigationRef.setParams({
jumpToChannelId: channel2.id
});
}
}
}
}
});
}
if (optInEnabledForGuild) {
const buttons = r310.buttons;
const r355 = {
label: null,
IconComponent: null,
onPress: null
};
if (isParentOptedIn) {
r355.label = intl.string(t.jNphKT);
r355.IconComponent = XSmallIcon;
r355.onPress = () => {
if (channel2.parent_id != null) {
setOptInChannel(guildId2, channel2.parent_id, false, {
section: AnalyticsSections.CHANNEL_ACTION_SHEET
});
}
};
buttons.push(r355);
} else {
r355.label = isOptedIn ? intl.string(t["3zySTA"]) : intl.string(t["9mysCh"]);
r355.IconComponent = isOptedIn ? XSmallIcon : PlusLargeIcon;
r355.onPress = () => {
setOptInChannel(guildId2, channel2.id, !isOptedIn, {
section: AnalyticsSections.CHANNEL_ACTION_SHEET
});
};
buttons.push(r355);
}
}
}
if (isGuildTextChannelType(channel.type) || isGuildVocalChannelType(channel.type) || channel.isForumLikeChannel()) {
r310.buttons.push({
label: intl.string(t.WqhZss),
IconComponent: LinkIcon,
isDestructive: false,
onPress: () => {
copyGuildChannelOrThreadLink(channel2.guild_id, channel2.id);
}
});
}
if (isFavoritesGuildSelected ? !isFavoritesGuildSelected : channel.isPrivate()) {
r310.buttons.push({
label: stateFromStores2 ? intl.string(t.vDYmad) : intl.string(t["uKw3A+"]),
IconComponent: PinIcon,
onPress: () => {
setMessagesFavorite(channel2.id, !stateFromStores2);
}
});
}
const r424 = {
sectionKey: "safety-warning-tooling",
buttons: []
};
if (r4) {
r424.buttons.push({
label: intl.string(t.EuzCET),
IconComponent: WarningIcon,
onPress: () => {
markAsInappropriateConversation(channel2.id, SafetyWarningTypes.INAPPROPRIATE_CONVERSATION_TIER_1);
}
});
}
if (r158) {
r424.buttons.push({
label: intl.string(t["tBw/1i"]),
IconComponent: WarningIcon,
onPress: () => {
markAsInappropriateConversation(channel2.id, SafetyWarningTypes.INAPPROPRIATE_CONVERSATION_TIER_2);
}
});
}
if (r424.buttons.length > 0) {
r264.push(r424);
}
if (r173 === true && setting && channel.isDM()) {
const r466 = {
sectionKey: "message-request",
buttons: []
};
if (channel.isMessageRequest !== true) {
r466.buttons.push({
label: intl.string(t.L6623r),
IconComponent: InboxIcon,
onPress: () => {
markAsMessageRequest(channel2.id);
}
});
}
r466.buttons.push({
label: intl.string(t["85YWlY"]),
IconComponent: InboxIcon,
onPress: () => {
clearMessageRequestState(channel2.id);
}
});
if (r466.buttons.length > 0) {
r264.push(r466);
}
}
if (r310.buttons.length > 0) {
r264.push(r310);
}
const r511 = {
sectionKey: "notifications",
buttons: []
};
if (isReadableType(channel.type) || channel.isCategory() || channel.isForumLikeChannel()) {
r511.buttons.push({
label: intl.string(t.e6RscS),
IconComponent: EyeIcon,
onPress: () => {
ackChannel(channel2, {
section: AnalyticsSections.CHANNEL_ACTION_SHEET,
object: AnalyticsObjects.MARK_CHANNEL_AS_READ_BUTTON,
objectType: AnalyticsObjectTypes.ACK_MANUAL
});
}
});
}
if (!(!isTextChannel(channel.type) && (!channel.isCategory() && !channel.isForumLikeChannel()))) {
if (stateFromStores) {
L118: {
const r592 = intl.string(t.OYefme);
if (channel.isCategory()) {
label2 = intl.string(t.olaBeG);
} else {
if (!channel.isDM() && !channel.isGroupDM()) {
const isThread2 = channel.isThread();
label2 = r592;
if (!isThread2) {
break L118;
}
label2 = intl.string(t["Cq/TzF"]);
break L118;
}
label2 = intl.string(t["s5/5fm"]);
}
}
r511.buttons.push({
label: label2,
IconComponent: BellIcon,
onPress: () => {
NotificationSettingsModalActionCreators.updateChannelOverrideSettings(channel2.getGuildId(), channel2.id, {
muted: !stateFromStores
}, NotificationLabel.muted(!stateFromStores));
}
});
} else {
L110: {
const r549 = intl.string(t.tbeRRJ);
if (channel.isCategory()) {
label = intl.string(t.pNMCg2);
} else {
if (!channel.isDM() && !channel.isGroupDM()) {
const isThread = channel.isThread();
label = r549;
if (!isThread) {
break L110;
}
label = intl.string(t.bUUd8q);
break L110;
}
label = intl.string(t.LO3kaK);
}
}
r511.buttons.push({
label,
IconComponent: BellSlashIcon,
onPress: () => {
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null && rootNavigationRef.isReady()) {
rootNavigationRef.navigate("sidebar", {
channelId: channel2.id,
initialRouteName: ChannelDetailsNavigatorScreens.MUTE,
source: "channel-long-press-sheet"
});
}
}
});
}
}
if (isGuildTextChannelType(channel.type) || channel.isCategory() || channel.isGuildStageVoice() || channel.isForumLikeChannel()) {
r511.buttons.push({
label: intl.string(t.h850Ss),
IconComponent: ChannelNotificationIcon,
disableColor: true,
onPress: () => {
ChannelSettingsActionCreators.setSection(ChannelSettingsSections.NOTIFICATIONS);
ChannelSettingsActionCreators.open(channel2.id);
}
});
}
if (r511.buttons.length > 0) {
r264.push(r511);
}
const r661 = {
sectionKey: "threads",
buttons: []
};
if (!(channel.isThread() || channel.isForumLikeChannel() || !stateFromStores8 || isNsfwGated)) {
r661.buttons.push({
label: intl.string(t.B2panI),
IconComponent: ThreadIcon,
onPress: () => {
showThreadBrowserModal(channel2);
}
});
}
if (r661.buttons.length > 0) {
r264.push(r661);
}
const r687 = {
sectionKey: "voice",
buttons: []
};
if (isGuildVocalChannelType(channel.type) && !stateFromStores6) {
r687.buttons.push({
label: stateFromStores7 ? intl.string(t.JYF2Oa) : intl.string(t.LxzNiu),
IconComponent: UserCircleIcon,
onPress: () => {
ChannelCollapseActionCreators.update(channel2.id);
}
});
}
if (channel.isGuildVocal()) {
const isGuildStageVoice = channel.isGuildStageVoice();
const buttons2 = r687.buttons;
const r715 = {
label: null,
IconComponent: null,
onPress: null
};
if (isGuildStageVoice) {
r715.label = intl.string(t["7vb2cc"]);
r715.IconComponent = StageIcon;
r715.onPress = () => {
handleVoiceOrStageChannelConnectPress(channel2);
};
buttons2.push(r715);
r687.buttons.push({
label: intl.string(t.ZXxLQg),
IconComponent: ChatIcon,
onPress: () => {
ActionSheetActionCreators.hideActionSheet();
ModalActionCreators.pushLazy(import("../../video_calls/native/components/ChannelVoiceChatModal"), {
channel: channel2
});
hideLaunchPad();
}
});
} else {
r715.label = intl.string(t.ZXxLQg);
r715.IconComponent = ChatIcon;
r715.onPress = () => {
handleVoiceOrStageChannelConnectPress(channel2);
ChannelRTCActionCreators.updateChatOpen(channel2.id, true);
hideLaunchPad();
};
buttons2.push(r715);
}
}
if (channel.isGuildStageVoice() && stateFromStores5 && canModerateStage) {
r687.buttons.push({
label: intl.string(t.saZaRb),
IconComponent: XSmallIcon,
isDestructive: true,
onPress: async () => {
let c31486_0;
c31486_0 = void 0;
(0, (await import("../../stage_channels/StageChannelActionCreatorExtras.native")).openEndStageModal)(channel2);
}
});
}
if (channel.isGuildStageVoice() && stateFromStores5 && canConnect) {
r687.buttons.push({
label: intl.string(t["+78Pfm"]),
IconComponent: FlagIcon,
isDestructive: true,
onPress: () => {
showReportModalForStageChannel(channel2);
}
});
}
if (r687.buttons.length > 0) {
r264.push(r687);
}
if (channel.isSpoilerChannel() && stateFromStores12) {
const r799 = {
sectionKey: "spoiler",
buttons: []
};
r799.buttons.push({
label: intl.string(t.ix2UVZ),
IconComponent: EyeSlashIcon,
onPress: () => {
GuildActionCreators.clearSpoilerAgree(channel2.id);
}
});
r264.push(r799);
}
const r820 = {
sectionKey: "admin-actions",
buttons: []
};
if (canManageChannel) {
r820.buttons.push({
label: channel.isCategory() ? intl.string(t.zdPFs9) : intl.string(t["3gUsJb"]),
IconComponent: SettingsIcon,
onPress: () => {
ChannelSettingsActionCreators.setSection(ChannelSettingsSections.OVERVIEW);
ChannelSettingsActionCreators.open(channel2.id);
}
});
if (isGuildTextChannelType(channel.type) || channel.isForumLikeChannel() || channel.isGuildVoice() || channel.isCategory()) {
r820.buttons.push({
label: channel.isCategory() ? intl.string(t["fUYU+j"]) : intl.string(t.dEaPc4),
IconComponent: channel.isCategory() ? PlusLargeIcon : CopyIcon,
onPress: () => {
CreateChannelModalActionCreators.open(channel2.isCategory() ? void 0 : channel2.type, channel2.getGuildId(), channel2.isCategory() ? channel2.id : channel2.parent_id, channel2.isCategory() ? void 0 : channel2.id);
}
});
}
}
if (setting) {
r820.buttons.push({
label: intl.string(t.gFHI3k),
IconComponent: IdIcon,
onPress: () => {
copy(channel2.id);
presentIdCopied();
}
});
}
if (r820.buttons.length > 0) {
r264.push(r820);
}
if (r210.buttons.length > 0) {
r264.push(r210);
}
if (r212.buttons.length > 0) {
r264.push(r212);
}
c16949_4 = r264;
const subtitle = channel.isGroupDM() ? intl.formatToPlainString(t.ABMKx3, {
members: channel.recipients.length + 1
}) : void 0;
useEffect(() => {
if (!(c16949_4.length !== 0 || setting)) {
onClose();
}
}, [r264.length, setting, onClose]);
return <AnalyticsLocationProvider value={analyticsLocations}>
<ActionSheet showGradient startExpanded={isMetaQuest()} header={<ActionSheetIconHeader icon={icon} title={channelName} subtitle={subtitle} />}>
{r264.map((item) => <ActionSheetRow.Group key={item.sectionKey} hasIcons>
{item.buttons.map((button, index) => {
const { label, IconComponent, iconStyle, trailing, isDestructive, onPress: onPress2 } = button;
return <ActionSheetRow key={index} variant={isDestructive ? "danger" : "default"} label={label} icon={<ActionSheetRow.Icon IconComponent={IconComponent} style={iconStyle} disableColor={button.disableColor} />} trailing={trailing} onPress={() => {
if (onPress2 != null) {
onPress2();
}
onClose();
}} />;
})}
</ActionSheetRow.Group>)}
</ActionSheet>
</AnalyticsLocationProvider>;
};
export default function ChannelLongPressActionSheet(props) {
const { channelId, onClose: onClose2 } = props;
const stateFromStores3 = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
useEffect(() => {
if (stateFromStores3 == null) {
onClose2();
}
}, [stateFromStores3, onClose2]);
return stateFromStores3 != null ? <ChannelLongPressActionSheetConnected channel={stateFromStores3} onClose={onClose2} /> : null;
};
@@ -0,0 +1,62 @@
// Metro module 10402 (f10403).
import RelationshipStore from "../../../stores/RelationshipStore";
import UserStore from "../../../stores/UserStore";
import useSafeAreaInsets_native from "../../safe_area/useSafeAreaInsets.native";
import { ActionSheetCloseButton } from "../../../design/components/Sheet/native/ActionSheetCloseButton.native";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { BottomSheetTitleHeader } from "../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { TableRadioRow } from "../../../design/components/TableRow/native/TableRadioRow.native";
import { TableRowIcon } from "../../../design/components/TableRow/native/TableRowIcon.native";
import Module10403 from "../../../_bundle/Module10403";
import { ActionSheet } from "../../../design/components/Sheet/native/ActionSheet.native";
import { BottomSheetScrollView } from "../../../_bundle/Module5245";
import { TableRadioGroup } from "../../../design/components/TableRow/native/TableRadioGroup.native";
import { getChannelIconWithGuild } from "../../../utils/native/ChannelUtils";
import { computeChannelName } from "../useChannelName";
export default function ChannelPickerActionSheet(props) {
let onClose;
let c17932_0 = props;
const bottom = useSafeAreaInsets_native().bottom;
const { header, guild, channels, onSelect, selectedChannel } = props;
const r2 = header != null;
let header2 = void 0;
if (r2) {
const title = header.title;
onClose = header.onClose;
header2 = <BottomSheetTitleHeader title={title} trailing={onClose != null ? <ActionSheetCloseButton onPress={() => {
ActionSheetActionCreators.hideActionSheet();
onClose();
}} /> : void 0} />;
}
const r37 = props.noChannelOptionLabel != null ? <TableRadioRow value="" label={props.noChannelOptionLabel} icon={<TableRowIcon source={Module10403} />} /> : void 0;
let defaultValue = selectedChannel?.id;
if (defaultValue == null) {
defaultValue = "";
}
return <ActionSheet scrollable header={header2}>
<BottomSheetScrollView contentContainerStyle={{
paddingBottom: bottom
}}>
<TableRadioGroup defaultValue={defaultValue} accessibilityLabel={header?.title} onChange={(event) => {
if (event === "") {
if (c17932_0.noChannelOptionLabel != null) {
ActionSheetActionCreators.hideActionSheet();
c17932_0.onSelect(null);
return void 0;
}
}
const r11 = channels.find((channel) => channel.id === event);
if (r11 != null) {
ActionSheetActionCreators.hideActionSheet();
onSelect(r11);
}
}} hasIcons>
{r37}
{channels.map((channel) => {
const channelIconWithGuild = getChannelIconWithGuild(channel, guild);
return <TableRadioRow key={channel.id} value={channel.id} label={computeChannelName(channel, UserStore, RelationshipStore)} icon={channelIconWithGuild != null ? <TableRowIcon source={channelIconWithGuild} /> : null} />;
})}
</TableRadioGroup>
</BottomSheetScrollView>
</ActionSheet>;
};
@@ -0,0 +1,51 @@
// Metro module 4049 (f4050).
import { useEffect } from "react";
import { useSharedValue } from "../../reanimated/ReanimatedRexport";
function $mk73504($env) {
return () => {
$env.$parent[4].delete($env[0]);
};
}
let env2324 = {};
const c2324_3 = new Set();
const c2324_4 = new Set();
export function freezeScreenIndex(a0, a1) {
if (a0) {
c2324_3.add(a1);
} else {
c2324_3.delete(a1);
}
c2324_4.forEach((item) => item());
}
export function isScreenIndexFrozen(a0) {
return c2324_3.has(a0);
}
export function addFrozenScreenIndexesChangedListener(a0) {
let env13807;
const r0 = env13807 = {
$parent: env2324
};
env13807[0] = a0;
c2324_4.add(a0);
return $mk73504(r0);
}
export function removeFrozenScreenIndexesChangedListener(a0) {
c2324_4.delete(a0);
}
export function useIsScreenIndexFrozenSharedValue(a0) {
const sharedValue = useSharedValue(c2324_3.has(a0));
useEffect(() => {
let env24919;
const r1 = env2324;
const r3 = () => {
sharedValue.set(c2324_3.has(a0));
};
const r4 = env24919 = {
$parent: r1
};
env24919[0] = r3;
c2324_4.add(r3);
return $mk73504(r4);
}, [a0, sharedValue]);
return sharedValue;
}
@@ -0,0 +1,26 @@
// Metro module 8280 (f8281).
import { useEffect } from "react";
import { View } from "react-native";
import { GuildProfileFetchStatus } from "../../../guild_profile/GuildProfileStore";
import { ChannelTypes } from "../../../../Constants";
import { useGuildProfile } from "../../../guild_profile/hooks/useGuildProfile";
import { GuildProfileVisibilitySets } from "../../../../_bundle/Module5187";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
export default function CreateChannelTypeDescription(props) {
const { guildId, channelType } = props;
const guildProfile2 = useGuildProfile(guildId);
const { guildProfile, fetchGuildProfile, fetchStatus } = guildProfile2;
const FETCHED = GuildProfileFetchStatus.FETCHED;
const r22 = guildProfile != null && GuildProfileVisibilitySets.VISIBLE.has(guildProfile.visibility);
const r2 = fetchStatus !== FETCHED;
const r0 = (r2 ? !r2 : !r22) && channelType === ChannelTypes.GUILD_ANNOUNCEMENT;
useEffect(() => {
fetchGuildProfile();
}, [guildId, fetchGuildProfile]);
return r0 ? <View>
<Text variant="text-sm/normal" color="text-subtle">
{intl.string(t["2Ab4Id"])}
</Text>
</View> : null;
};
@@ -0,0 +1,27 @@
// Metro module 15191 (f15192).
import { intl, t } from "../../../intl/index.native";
export function getChannelSubtitleData(a0) {
if (a0 == null) {
return null;
}
const type = a0.type;
if (type !== "embedded-activities" && type !== "event") {
if (type === "go-live") {
return {
subtitle: intl.string(t.Pa817q),
type: a0.type
};
}
if (type === "voice") {
return {
subtitle: a0.text,
type: a0.type
};
}
return void 0;
}
return {
subtitle: a0.name,
type: a0.type
};
}
@@ -0,0 +1,12 @@
// Metro module 9097 (f9098).
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
export function openChannelLongPressActionSheet(a0) {
const r5 = `ChannelLongPress-${a0}`;
let c16948_0 = r5;
ActionSheetActionCreators.openLazy(import("./ChannelLongPressActionSheet"), r5, {
channelId: a0,
onClose: () => {
ActionSheetActionCreators.hideActionSheet(c16948_0);
}
});
}
@@ -0,0 +1,22 @@
// Metro module 10401 (f10402).
import GuildChannelStore from "../../../stores/GuildChannelStore";
import GuildStore from "../../../stores/GuildStore";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { intl, t } from "../../../intl/index.native";
export default function openChannelPicker({ selectedChannel, guildId, channelType, filterFn = () => true, onClose, ...rest }) {
const guild = GuildStore.getGuild(guildId);
let r24 = GuildChannelStore.getChannels(guildId)[channelType];
if (r24 == null) {
r24 = [];
}
ActionSheetActionCreators.openLazy(import("./ChannelPickerActionSheet"), "ChannelPicker", {
header: {
title: intl.string(t.r2ptsz),
onClose
},
guild,
channels: r24.filter(filterFn).map((item) => item.channel),
selectedChannel,
...rest
});
};
@@ -0,0 +1,4 @@
// Metro module 4382 (f4383).
export default function sanitizeGuildTextChannelName(a0) {
return a0.replace(/[\s-~]+/g, "-").replace(/^-+/, "").replace(/[\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g, "").toLowerCase();
};
@@ -0,0 +1,23 @@
// Metro module 12420 (f12421).
import GameConsoleStore from "../game_console/GameConsoleStore";
import UnsyncedUserSettingsStore from "../user_settings/UnsyncedUserSettingsStore";
import AuthenticationStore from "../../stores/AuthenticationStore";
import GuildStore from "../../stores/GuildStore";
import VoiceStateStore from "../../stores/VoiceStateStore";
export function shouldShowVoiceChannelChangeConfirmation(a0) {
if (UnsyncedUserSettingsStore.disableVoiceChannelChangeAlert) {
return false;
}
const remoteSessionId = GameConsoleStore.getRemoteSessionId();
if (VoiceStateStore.getVoiceStateForSession(AuthenticationStore.getId(), remoteSessionId) != null) {
return false;
}
if (VoiceStateStore.isCurrentClientInVoiceChannel()) {
if (VoiceStateStore.isInChannel(a0.id)) {
return false;
}
const guild = GuildStore.getGuild(a0.getGuildId());
return guild?.afkChannelId == null || !VoiceStateStore.isInChannel(guild.afkChannelId);
}
return false;
}
+14
View File
@@ -0,0 +1,14 @@
// Metro module 11425 (f11426).
import ChannelStore from "../../stores/ChannelStore";
import { AnalyticEvents } from "../../Constants";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
export function getDmHasMessageHistory(a0) {
return ChannelStore.getChannel(a0)?.lastMessageId != null;
}
export function trackWaveCtaClicked(a0) {
AnalyticsUtils.track(AnalyticEvents.WAVE_CTA_CLICKED, {
channel_id: a0.channelId,
source: a0.source,
dm_has_message_history: ChannelStore.getChannel(a0.channelId)?.lastMessageId != null
});
}
+137
View File
@@ -0,0 +1,137 @@
// Metro module 4380 (f4381).
import ExperimentStore from "../experiments/ExperimentStore";
import RelationshipStore from "../../stores/RelationshipStore";
import UserStore from "../../stores/UserStore";
import { ChannelTypes } from "../../Constants";
import { isNotNullish } from "../../utils/GlobalUtils";
import UserUtils from "../../utils/UserUtils";
import { intl, t } from "../../intl/index.native";
import { useStateFromStores } from "../../_bundle/Module589";
function $mk74373($env) {
return (a0) => {
let r6 = $env[0].getNickname(a0.id);
if (r6 == null) {
const r7 = $env.$parent;
r6 = (0, r7[1])(r7[2][6]).getName(a0);
}
return r6;
};
}
let env2597 = {};
export function computeChannelName(a0, a1, a2, r6 = false, r9 = false) {
let globalName;
const name = a0.name;
if (a0.isObfuscated()) {
return intl.string(t["/YzI63"]);
}
const type = a0.type;
if (ChannelTypes.DM === type) {
if (name !== "") {
return r6 ? `@${name}` : name;
}
const [r104] = a0.recipients.map(a1.getUser).filter(isNotNullish);
const r3 = r104 == null;
let r106 = "???";
if (!r3) {
if (r104.isProvisional && r104.globalName != null) {
globalName = r104.globalName;
} else {
let r111 = a2.getNickname(r104.id);
if (r111 == null) {
r111 = UserUtils.getName(r104);
}
if (r111 == null) {
r111 = "???";
}
globalName = r6 ? `@${r111}` : r111;
}
r106 = globalName;
}
return r106;
}
if (ChannelTypes.GROUP_DM === type) {
let r57 = name;
if (name === "") {
let env14152;
const recipients = a0.recipients;
const r59 = env14152 = {
$parent: env2597
};
env14152[0] = a2;
const r70 = recipients.map(a1.getUser).filter(isNotNullish).map($mk74373(r59));
r57 = r70.length > 0 ? r70.join(", ") : intl.formatToPlainString(t["9Uk8PF"], {
name: UserUtils.getName(a1.getCurrentUser())
});
}
return r57;
}
if (ChannelTypes.GUILD_ANNOUNCEMENT !== type && ChannelTypes.GUILD_TEXT !== type && ChannelTypes.GUILD_FORUM !== type && ChannelTypes.GUILD_MEDIA !== type) {
if (ChannelTypes.PUBLIC_THREAD !== type && ChannelTypes.PRIVATE_THREAD !== type && ChannelTypes.ANNOUNCEMENT_THREAD !== type && ChannelTypes.GUILD_VOICE !== type && ChannelTypes.GUILD_STAGE_VOICE !== type && ChannelTypes.GUILD_CATEGORY !== type) {
return name;
}
return r9 ? `#"${name.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"` : r6 ? a0.isThread() ? `"${name}"` : name : name;
}
return r6 ? `#${name}` : name;
}
export default function useChannelName(c14153_0, r8 = false) {
let c14153_1 = r8;
return useStateFromStores([UserStore, ExperimentStore, RelationshipStore], () => c14153_0 != null ? computeChannelName(c14153_0, UserStore, RelationshipStore, c14153_1) : null);
};
export function computeDefaultGroupDmNameFromUserIds(a0, a1, a2) {
let env14150;
const r2 = env14150 = {
$parent: env2597
};
env14150[0] = a2;
const r20 = a0.map(a1.getUser).filter(isNotNullish).map($mk74373(r2));
return r20.length > 0 ? r20.join(", ") : intl.formatToPlainString(t["9Uk8PF"], {
name: UserUtils.getName(a1.getCurrentUser())
});
}
export function computeDefaultGroupDmName({ recipients }, a1, a2) {
let env14151;
const r11 = env14151 = {
$parent: env2597
};
env14151[0] = a2;
const r21 = recipients.map(a1.getUser).filter(isNotNullish).map($mk74373(r11));
return r21.length > 0 ? r21.join(", ") : intl.formatToPlainString(t["9Uk8PF"], {
name: UserUtils.getName(a1.getCurrentUser())
});
}
export function useComputedGroupDmName(c14154_0) {
return useStateFromStores([UserStore, RelationshipStore], () => {
const r2 = c14154_0 != null;
let r13 = null;
if (r2) {
const isMultiUserDM = c14154_0.isMultiUserDM();
r13 = null;
if (isMultiUserDM) {
let env25062;
const r10 = env2597;
const recipients = c14154_0.recipients;
const r16 = env25062 = {
$parent: r10
};
env25062[0] = RelationshipStore;
const r27 = recipients.map(UserStore.getUser).filter(isNotNullish).map($mk74373(r16));
r13 = r27.length > 0 ? r27.join(", ") : intl.formatToPlainString(t["9Uk8PF"], {
name: UserUtils.getName(UserStore.getCurrentUser())
});
}
}
return r13;
});
}
export function computeGroupDmName(a0) {
if (!a0.isObfuscated() && a0.isMultiUserDM()) {
const name = a0.name;
return name !== "" ? name : void 0;
}
}
export function escapeChannelName(a0) {
return a0.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
}
export function unescapeChannelName(a0) {
return a0.replace(/\\"/g, "\"").replace(/\\\\/g, "\\");
}
+155
View File
@@ -0,0 +1,155 @@
// Metro module 8274 (f8275).
import _slicedToArray from "../../_bundle/_slicedToArray";
import { useState, useCallback } from "react";
import { Permissions, ChannelTypes } from "../../Constants";
import { PermissionOverwriteType } from "../../flow/Server";
import { getFlag } from "../../_bundle/HighLow";
import CreateChannelActionCreators from "../../actions/CreateChannelActionCreators";
import { AccessibilityAnnouncer } from "../../design/shared";
import { intl, t } from "../../intl/index.native";
let env5269 = {};
const c5269_9 = {
PREMIUM_CHANNEL: 0,
0: "PREMIUM_CHANNEL"
};
export default function useCreateChannelSubmit(a0) {
let env16437 = {
$parent: env5269
};
env16437[0] = a0;
const r12 = _slicedToArray(useState(false), 2);
const r5 = r12[0];
env16437[1] = r12[1];
const r16 = _slicedToArray(useState({}), 2);
const r17 = r16[0];
env16437[2] = r16[1];
let c16438_0 = async (c29931_0) => {
let errors, body, c29931_4, c29931_5;
let c29931_6 = 0;
let c31462_0, c31462_1, c31462_2, c31462_3, c31462_4, c31462_5, c31462_6, c31462_7, c31462_8, c31462_9, c31462_10, c31462_11, c31462_12;
const r14 = void 0;
L22: {
try {
c29931_4 = r14;
c31462_0 = void 0;
c31462_1 = void 0;
c31462_2 = void 0;
c31462_3 = void 0;
c31462_4 = void 0;
c31462_5 = void 0;
c31462_6 = void 0;
c31462_7 = void 0;
c31462_0 = c29931_0.overwrites;
c31462_1 = c29931_0.bitrate;
c31462_2 = c29931_0.userLimit;
c31462_3 = c29931_0.createMode;
c31462_4 = c29931_0.guildId;
c31462_5 = c29931_0.name;
c31462_6 = c29931_0.channelType;
c31462_7 = c29931_0.categoryId;
c31462_8 = void 0;
c31462_9 = void 0;
c31462_10 = void 0;
c31462_11 = void 0;
await void 0;
if (c31462_3 === c5269_9.PREMIUM_CHANNEL) {
c31462_0.push({
id: c31462_4,
type: PermissionOverwriteType.ROLE,
deny: Permissions.VIEW_CHANNEL,
allow: getFlag(0)
});
}
(0, c29931_4.$parent[1])(true);
c29931_6 = 2;
c31462_8 = await CreateChannelActionCreators.createChannel({
guildId: c31462_4,
type: c31462_6,
name: c31462_5,
permissionOverwrites: c31462_0,
bitrate: c31462_1,
userLimit: c31462_2,
parentId: c31462_6 !== ChannelTypes.GUILD_CATEGORY ? c31462_7 : null
});
if (c31462_8 != null) {
const body2 = c31462_8.body;
body = body2;
if (body2 == null) {
body = {};
}
c31462_9 = body;
c31462_10 = c31462_9.id;
c31462_11 = c31462_9.guild_id;
if (c31462_10 != null) {
const r144 = c29931_4;
AccessibilityAnnouncer.announce(intl.formatToPlainString(t.Wke70b, {
name: c31462_5
}));
const r168 = r144.$parent[0];
if (r168 != null) {
r168(c31462_10, c31462_11);
}
}
}
c29931_6 = 1;
c29931_6 = 0;
(0, c29931_4.$parent[1])(false);
} catch ($e) {
const r33 = $e;
let r7 = r33;
c29931_5 = r33;
let r34 = c29931_6;
if (r34 !== 0) {
while (true) {
if (r34 === 1) {
try {
const r224 = c29931_4;
const r225 = c29931_5;
c29931_6 = 0;
(0, r224.$parent[1])(false);
throw r225;
} catch (r223) {
r7 = r223;
c29931_5 = r223;
r34 = c29931_6;
if (r34 === 0) {
break;
}
}
} else {
try {
const r183 = c29931_4;
const r184 = c29931_5;
c29931_6 = 1;
c31462_12 = r184;
AccessibilityAnnouncer.announce(intl.string(t["0SbUzm"]));
const r208 = r183.$parent[2];
const errors2 = c31462_12.body?.errors;
errors = errors2;
if (errors2 == null) {
errors = {};
}
r208(errors);
c29931_6 = 0;
(0, c29931_4.$parent[1])(false);
break L22;
} catch (r181) {
r7 = r181;
c29931_5 = r181;
r34 = c29931_6;
if (r34 === 0) {
break;
}
}
}
}
}
throw r7;
}
}
};
return [r5, r17, useCallback(function() {
return c16438_0.apply(this, arguments);
}, [a0])];
};
export { c5269_9 as CreateChannelMode };
@@ -0,0 +1,74 @@
// Metro module 15034 (f15035).
import { useState, useCallback } from "react";
import { ME, Routes } from "../../Constants";
import { MessageSendLocation } from "../messages/MessageConstants";
import { trackWaveCtaClicked } from "./trackWaveCtaClicked";
import { transitionTo } from "../routing/router_utils";
import MessageActionCreators from "../../actions/MessageActionCreators";
import ToastActionCreators from "../toast/native/ToastActionCreators";
import { intl, t } from "../../intl/index.native";
import Module11424 from "../../_bundle/Module11424";
import { usePrivateChannelWaveEligible } from "./usePrivateChannelWaveEligible";
export default function usePrivateChannelWave(a0, a1) {
const [state, setState] = useState(false);
const callback = useCallback(async () => {
let c27889_2;
let c27889_3 = 0;
let c30820_0;
L14: {
L13: {
try {
if (state) {
break L14;
}
setState(true);
trackWaveCtaClicked({
channelId: a0.id,
source: "Messages Tab"
});
transitionTo(Routes.CHANNEL(ME, a0.id));
c27889_3 = 1;
await MessageActionCreators.sendStickers(a0.id, ["749054660769218631"], "", {
location: MessageSendLocation.SEND_WAVE
});
c27889_3 = 0;
(0, setState)(false);
} catch ($e) {
const r34 = $e;
let r7 = r34;
c27889_2 = r34;
if (c27889_3 !== 0) {
while (true) {
try {
const r93 = c27889_2;
c27889_3 = 0;
c30820_0 = r93;
if (!(c30820_0.ok || c30820_0.status !== 429)) {
ToastActionCreators.open({
key: "HANDLE_WAVE_PRESS_TOAST",
content: intl.string(t.Whhv4w),
icon: Module11424
});
}
(0, setState)(false);
break L13;
} catch (r90) {
r7 = r90;
c27889_2 = r90;
if (c27889_3 === 0) {
break;
}
}
}
}
throw r7;
}
}
return void 0;
}
}, [a0.id, state]);
return {
waveShouldShow: usePrivateChannelWaveEligible(a0, a1),
wavePressed: callback
};
};
@@ -0,0 +1,51 @@
// Metro module 15035 (f15036).
import MessageStore from "../../stores/MessageStore";
import RelationshipStore from "../../stores/RelationshipStore";
import { ChannelFlags } from "./ChannelConstants";
import { MessageTypes } from "../../Constants";
import { useStateFromStores } from "../../_bundle/Module589";
import SnowflakeUtils from "../../utils/SnowflakeUtils";
import * as _DateUtils from "../../utils/DateUtils";
import Module3771 from "../../_bundle/Module3771";
import { useStrangerDangerWarning } from "../self_mod/stranger_danger/hooks/useStrangerDangerWarning";
export function usePrivateChannelWaveEligible(a0, a1) {
let recipientId;
let r18 = a0.isDM() && !a0.isSystemDM() && !a0.rawRecipients.some((rawRecipient) => rawRecipient.bot);
recipientId = r18 ? a0.getRecipientId() : null;
const stateFromStores = useStateFromStores([RelationshipStore], () => recipientId != null && RelationshipStore.isFriend(recipientId));
const stateFromStores2 = useStateFromStores([RelationshipStore], () => recipientId != null && RelationshipStore.isIgnored(recipientId));
const stateFromStores3 = useStateFromStores([MessageStore], () => {
const messages = MessageStore.getMessages(a0.id);
return messages.length === 1 && messages.first()?.type === MessageTypes.FRIEND_REQUEST_ACCEPTED;
});
let r44 = a0.hasFlag(ChannelFlags.HAS_ONLY_SYSTEM_MESSAGES);
const stateFromStores4 = useStateFromStores([MessageStore], () => MessageStore.hasCurrentUserSentWaveBlockingMessage(a0.id));
const r54 = SnowflakeUtils.extractTimestamp(a0.id);
const isWithinInterval = _DateUtils.isWithinInterval(Module3771(), Module3771(r54), 1814400000);
const strangerDangerWarning = useStrangerDangerWarning(a0.id);
if (r18) {
r18 = stateFromStores;
}
if (r18) {
r18 = !stateFromStores2;
}
if (r18) {
if (!r44) {
r44 = a1 == null;
}
if (!r44) {
r44 = stateFromStores3;
}
r18 = r44;
}
if (r18) {
r18 = !stateFromStores4;
}
if (r18) {
r18 = isWithinInterval;
}
if (r18) {
r18 = strangerDangerWarning == null;
}
return r18;
}
@@ -0,0 +1,74 @@
// Metro module 11161 (f11162).
import { ChannelTypes, ChannelTypesSets } from "../../Constants";
import useChannelName from "./useChannelName";
import { intl, t } from "../../intl/index.native";
export default function useTextareaPlaceholderAndLabels({ channel, isReadonly = false, isCreatingThread = false }) {
let r39;
L23: {
const channelName2 = useChannelName(channel, true);
const channelName = useChannelName(channel, false);
if (channel != null && channelName2 != null) {
if (isCreatingThread) {
r39 = {
placeholder: intl.string(t.YzpScd),
accessibilityLabel: intl.string(t.YzpScd)
};
break L23;
}
if (isReadonly) {
r39 = {
placeholder: intl.string(t["RRvRp/"]),
accessibilityLabel: intl.string(t["RRvRp/"])
};
break L23;
}
if (channel.isForumPost()) {
r39 = {
placeholder: intl.formatToPlainString(t.Y6qWLc, {
channel: channelName2
}),
accessibilityLabel: intl.formatToPlainString(t.KffKoR, {
channel: channelName
})
};
break L23;
}
if (ChannelTypesSets.THREADS.has(channel.type)) {
r39 = {
placeholder: intl.formatToPlainString(t["8lzR/R"], {
channel: channelName2
}),
accessibilityLabel: intl.formatToPlainString(t.UZIMWS, {
channel: channelName
})
};
break L23;
}
if (channel.type === ChannelTypes.DM) {
r39 = {
placeholder: intl.formatToPlainString(t["4c+CAx"], {
channel: channelName2
}),
accessibilityLabel: intl.formatToPlainString(t.fqOxbV, {
channel: channelName
})
};
break L23;
}
r39 = {
placeholder: intl.formatToPlainString(t["8lzR/R"], {
channel: channelName2
}),
accessibilityLabel: intl.formatToPlainString(t.ih7ZSA, {
channel: channelName
})
};
} else {
r39 = {
placeholder: intl.string(t.MKDeyL),
accessibilityLabel: intl.string(t.MKDeyL)
};
}
}
return r39;
};
@@ -0,0 +1,28 @@
// Metro module 15198 (f15199).
import { useEffect } from "react";
import GatewayConnectionStore from "../gateway/GatewayConnectionStore";
import GuildAvailabilityStore from "../../stores/GuildAvailabilityStore";
import VoiceChannelStartTimeStore from "./VoiceChannelStartTimeStore";
import { ChannelTypes } from "../../Constants";
import { useStateFromStoresObject, useStateFromStores } from "../../_bundle/Module589";
import { fetchChannelInfo } from "./ChannelInfoActionCreators";
export function useStartTime(a0) {
let hasRequestedStartTimes, isGuildUnavailable, stateFromStores, c21751_4;
const stateFromStoresObject = useStateFromStoresObject([VoiceChannelStartTimeStore, GuildAvailabilityStore], () => ({
hasRequestedStartTimes: VoiceChannelStartTimeStore.hasRequestedStartTimes(a0.guild_id),
startTime: VoiceChannelStartTimeStore.getStartTime(a0),
isGuildUnavailable: GuildAvailabilityStore.isUnavailable(a0.guild_id)
}));
hasRequestedStartTimes = stateFromStoresObject.hasRequestedStartTimes;
const startTime = stateFromStoresObject.startTime;
isGuildUnavailable = stateFromStoresObject.isGuildUnavailable;
stateFromStores = useStateFromStores([GatewayConnectionStore], () => GatewayConnectionStore.isConnected());
const r27 = a0.type === ChannelTypes.GUILD_VOICE;
c21751_4 = r27;
useEffect(() => {
if ((hasRequestedStartTimes ? !hasRequestedStartTimes : c21751_4) && !isGuildUnavailable && stateFromStores) {
fetchChannelInfo(a0.guild_id);
}
}, [r27, a0.guild_id, hasRequestedStartTimes, isGuildUnavailable, stateFromStores]);
return startTime;
}