:
- inProfile ? :
- }
-
-
- );
-}
diff --git a/src/plugins/userVoiceShow/components/VoiceChannelIndicator.css b/src/plugins/userVoiceShow/components/VoiceChannelIndicator.css
new file mode 100644
index 00000000..902cebdc
--- /dev/null
+++ b/src/plugins/userVoiceShow/components/VoiceChannelIndicator.css
@@ -0,0 +1,15 @@
+.vc-uvs-indicator {
+ display: inline-flex;
+ justify-content: center;
+ align-items: center;
+ margin-left: 4px;
+ vertical-align: top;
+ position: relative;
+ top: 0;
+ padding: 0;
+ gap: 2px;
+}
+
+.vc-uvs-indicator>svg {
+ fill: dodgerblue;
+}
diff --git a/src/plugins/userVoiceShow/components/VoiceChannelIndicator.tsx b/src/plugins/userVoiceShow/components/VoiceChannelIndicator.tsx
new file mode 100644
index 00000000..339a174c
--- /dev/null
+++ b/src/plugins/userVoiceShow/components/VoiceChannelIndicator.tsx
@@ -0,0 +1,54 @@
+/*
+ * Vencord, a modification for Discord's desktop app
+ * Copyright (c) 2023 Vendicated and contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+*/
+
+import "./VoiceChannelIndicator.css";
+
+import { NavigationRouter, PermissionsBits, PermissionStore, Toasts, Tooltip } from "@webpack/common";
+import { Channel } from "discord-types/general";
+
+import speakerSvg from "./speaker.svg";
+
+interface VoiceChannelIndicatorProps {
+ tooltipText?: string;
+ channel: Channel;
+}
+
+export const VoiceChannelIndicator = ({ tooltipText, channel }: VoiceChannelIndicatorProps) => (
+ {
+ if (PermissionStore.can(PermissionsBits.VIEW_CHANNEL, channel)) {
+ NavigationRouter.transitionTo(getChannelPath(channel));
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ else
+ Toasts.show({
+ message: "Insufficient permissions to view the channel.",
+ id: "user-voice-show-insufficient-permissions",
+ type: Toasts.Type.FAILURE,
+ options: {
+ position: Toasts.Position.BOTTOM,
+ }
+ });
+ }}>
+
+ {(tooltipProps: any) => speakerSvg(tooltipProps)}
+
+
+);
+
+const getChannelPath = (c: Channel) => `/channels/${c.guild_id ?? "@me"}/${c.id}`;
diff --git a/src/plugins/userVoiceShow/components/VoiceChannelSection.css b/src/plugins/userVoiceShow/components/VoiceChannelSection.css
new file mode 100644
index 00000000..c644ca56
--- /dev/null
+++ b/src/plugins/userVoiceShow/components/VoiceChannelSection.css
@@ -0,0 +1,22 @@
+.vc-uvs-button>div {
+ white-space: normal !important;
+}
+
+.vc-uvs-button {
+ width: 100%;
+ margin: auto;
+ height: unset;
+}
+
+.vc-uvs-button-view {
+ width: 32px;
+ min-width: 32px;
+ height: unset;
+ margin: unset;
+ padding: unset;
+}
+
+.vc-uvs-header {
+ color: var(--header-primary);
+ margin-bottom: 6px;
+}
diff --git a/src/plugins/userVoiceShow/components/VoiceChannelSection.tsx b/src/plugins/userVoiceShow/components/VoiceChannelSection.tsx
new file mode 100644
index 00000000..1a07f621
--- /dev/null
+++ b/src/plugins/userVoiceShow/components/VoiceChannelSection.tsx
@@ -0,0 +1,94 @@
+/*
+ * Vencord, a modification for Discord's desktop app
+ * Copyright (c) 2023 Vendicated and contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+*/
+
+import "./VoiceChannelSection.css";
+
+import { Flex } from "@components/Flex";
+import { findByPropsLazy } from "@webpack";
+import { Button, Forms, NavigationRouter, PermissionsBits, PermissionStore, React, Toasts } from "@webpack/common";
+import { Channel } from "discord-types/general";
+
+import eyeSvg from "./eye.svg";
+
+const ChannelActions = findByPropsLazy("selectChannel", "selectVoiceChannel");
+
+
+interface VoiceChannelFieldProps {
+ channel: Channel;
+ label: string;
+ showHeader?: boolean;
+}
+
+export const VoiceChannelSection = ({ channel, label, showHeader = false }: VoiceChannelFieldProps) => (
+
+ {showHeader && In a voice channel}
+
+
+
+
+
+);
+
+const getChannelPath = (c: Channel) => `/channels/${c.guild_id ?? "@me"}/${c.id}`;
diff --git a/src/plugins/userVoiceShow/components/eye.svg.tsx b/src/plugins/userVoiceShow/components/eye.svg.tsx
new file mode 100644
index 00000000..60ac581f
--- /dev/null
+++ b/src/plugins/userVoiceShow/components/eye.svg.tsx
@@ -0,0 +1,20 @@
+/*
+ * Vencord, a Discord client mod
+ * Copyright (c) 2023 Vendicated and contributors
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+export default () => (
+
+);
diff --git a/src/plugins/userVoiceShow/components/speaker.svg.tsx b/src/plugins/userVoiceShow/components/speaker.svg.tsx
new file mode 100644
index 00000000..c0b73384
--- /dev/null
+++ b/src/plugins/userVoiceShow/components/speaker.svg.tsx
@@ -0,0 +1,21 @@
+/*
+ * Vencord, a Discord client mod
+ * Copyright (c) 2023 Vendicated and contributors
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+export default (props: any) => (
+
+);
diff --git a/src/plugins/userVoiceShow/index.tsx b/src/plugins/userVoiceShow/index.tsx
index 4751421f..8a886bbe 100644
--- a/src/plugins/userVoiceShow/index.tsx
+++ b/src/plugins/userVoiceShow/index.tsx
@@ -16,91 +16,141 @@
* along with this program. If not, see .
*/
-import "./styles.css";
-
+import { addDecorator, removeDecorator } from "@api/MemberListDecorators";
+import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
-import { Devs, EquicordDevs } from "@utils/constants";
-import definePlugin from "@utils/types";
+import { Devs } from "@utils/constants";
+import definePlugin, { OptionType } from "@utils/types";
+import { findByCodeLazy, findStoreLazy } from "@webpack";
+import { ChannelStore, GuildStore } from "@webpack/common";
+import { User } from "discord-types/general";
-import VoiceActivityIcon from "./components/VoiceActivityIcon";
-import { settings } from "./settings";
-import { VoiceActivityProps } from "./types";
+import { VoiceChannelIndicator } from "./components/VoiceChannelIndicator";
+import { VoiceChannelSection } from "./components/VoiceChannelSection";
+
+const VoiceStateStore = findStoreLazy("VoiceStateStore");
+const UserModalSection = findByCodeLazy("heading:", "subheading:", "scrollIntoView:");
+
+const settings = definePluginSettings({
+ showInUserProfileModal: {
+ type: OptionType.BOOLEAN,
+ description: "Show a user's voice channel in their profile modal",
+ default: true,
+ },
+ showVoiceChannelIndicator: {
+ type: OptionType.BOOLEAN,
+ description: "Indicator in the member list wether a user is in a voice channel",
+ default: true,
+ }
+});
+
+interface UserProps {
+ user: User;
+}
+interface VoiceChannelFieldProps {
+ user: User;
+ isPopout?: boolean;
+}
+
+const VoiceChannelField = ErrorBoundary.wrap(({ user, isPopout = false }: VoiceChannelFieldProps) => {
+ const { channelId } = VoiceStateStore.getVoiceStateForUser(user.id) ?? {};
+ if (!channelId) return null;
+
+ const channel = ChannelStore.getChannel(channelId);
+ if (!channel) return null;
+
+ const guild = GuildStore.getGuild(channel.guild_id);
+
+ if (!guild) return null; // When in DM call
+
+ const result = `${guild.name} | ${channel.name}`;
+
+ // when popout do padding and show header, when in modal no pad and no header
+ return isPopout ? (
+