From 5e81dbcbdaf7581e031077da73270cc0d3be48cc Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Tue, 28 Apr 2026 19:56:27 -0400
Subject: [PATCH] SidebarChat: kill off until someone can have a look
---
src/equicordplugins/sidebarChat/index.tsx | 594 ---------------------
src/equicordplugins/sidebarChat/store.ts | 155 ------
src/equicordplugins/sidebarChat/styles.css | 19 -
3 files changed, 768 deletions(-)
delete mode 100644 src/equicordplugins/sidebarChat/index.tsx
delete mode 100644 src/equicordplugins/sidebarChat/store.ts
delete mode 100644 src/equicordplugins/sidebarChat/styles.css
diff --git a/src/equicordplugins/sidebarChat/index.tsx b/src/equicordplugins/sidebarChat/index.tsx
deleted file mode 100644
index 17a438c9a..000000000
--- a/src/equicordplugins/sidebarChat/index.tsx
+++ /dev/null
@@ -1,594 +0,0 @@
-/*
- * Vencord, a Discord client mod
- * Copyright (c) 2024 Vendicated and contributors
- * SPDX-License-Identifier: GPL-3.0-or-later
- */
-
-import "./styles.css";
-
-import { NavContextMenuPatchCallback } from "@api/ContextMenu";
-import { HeaderBarButton } from "@api/HeaderBar";
-import ErrorBoundary from "@components/ErrorBoundary";
-import { Devs, EquicordDevs } from "@utils/constants";
-import { classNameFactory } from "@utils/css";
-import { getCurrentChannel } from "@utils/discord";
-import definePlugin from "@utils/types";
-import { Channel, Guild, User } from "@vencord/discord-types";
-import { ChannelType } from "@vencord/discord-types/enums";
-import {
- DefaultExtractAndLoadChunksRegex,
- extractAndLoadChunksLazy,
- findByPropsLazy,
- findComponentByCodeLazy,
- findCssClassesLazy,
- findStoreLazy,
-} from "@webpack";
-import {
- ChannelActionCreators,
- ChannelRouter,
- ChannelStore,
- FluxDispatcher,
- GuildStore,
- Menu,
- MessageActions,
- MessageStore,
- PermissionsBits,
- PermissionStore,
- PopoutActions,
- PopoutWindowStore,
- RelationshipStore,
- SelectedChannelStore,
- SelectedGuildStore,
- useCallback,
- useEffect,
- useLayoutEffect,
- UserStore,
- useState,
- useStateFromStores,
-} from "@webpack/common";
-
-import { getOpenPopoutWindowKeys, getPersistedPopoutChannelIds, getPopoutWindowKey, isPopoutWindowOpen, settings, SidebarStore, syncPersistedPopoutWindows } from "./store";
-
-const cl = classNameFactory("vc-sidebar-chat-");
-
-const HeaderBar = findComponentByCodeLazy("toolbarClassName:", "}),onDoubleClick:");
-const ForumView = findComponentByCodeLazy("sidebarState");
-
-const ArrowsLeftRightIcon = ({ color, ...rest }) => {
- return (
-
- );
-};
-
-const WindowLaunchIcon = findComponentByCodeLazy("1-1h6a1 1 0 1 0 0-2H5Z");
-const XSmallIcon = findComponentByCodeLazy("1.4L12 13.42l5.3 5.3Z");
-const Chat = findComponentByCodeLazy("filterAfterTimestamp:", "chatInputType");
-const Resize = findComponentByCodeLazy("sidebarType:", "RESIZE_HANDLE_WIDTH)");
-const ChannelHeader = findComponentByCodeLazy("`channel-${");
-const PopoutWindow = findComponentByCodeLazy("Missing guestWindow reference");
-const FullChannelView = findComponentByCodeLazy("showFollowButton:");
-const WanderingCubesLoading = findComponentByCodeLazy('="wanderingCubes"');
-
-const ChatInputTypes = findByPropsLazy("FORM", "NORMAL");
-const Sidebars = findByPropsLazy("ThreadSidebar", "MessageRequestSidebar");
-const ChatClasses = findCssClassesLazy("threadSidebarOpen", "loader");
-
-const ChannelSectionStore = findStoreLazy("ChannelSectionStore");
-
-const requireForumView = extractAndLoadChunksLazy(
- ["Missing channel in Channel.renderHeaderToolbar"],
- new RegExp(DefaultExtractAndLoadChunksRegex.source + '.{1,150}name:"ForumChannel"')
-);
-
-function getChannelTitle(channel: Channel | null | undefined) {
- if (!channel) return "Chat";
-
- if (channel.isPrivate()) {
- const recipientId = channel.getRecipientId?.();
- if (!channel.name && recipientId) {
- const user = UserStore.getUser(recipientId);
- if (user) {
- return RelationshipStore.getNickname(recipientId) || user.globalName || user.username || "DM";
- }
- }
-
- return channel.name || "DM";
- }
-
- return channel.name || "Chat";
-}
-
-function canOpenPopout(channel: Channel) {
- if (channel.isPrivate()) return true;
- return !channel.isCategory() && !channel.isDirectory() && !channel.isVocal();
-}
-
-function getPopoutMenuLabel(channelId: string) {
- return isPopoutWindowOpen(channelId) ? "Close popout chat" : "Popout chat";
-}
-
-let restorePersistedPopoutsInterval: number | null = null;
-let restoringPersistedPopouts = false;
-
-function clearPersistedPopoutRestoreLoop() {
- restoringPersistedPopouts = false;
- if (restorePersistedPopoutsInterval !== null) {
- window.clearInterval(restorePersistedPopoutsInterval);
- restorePersistedPopoutsInterval = null;
- }
-}
-
-async function waitForChannel(channelId: string, timeoutMs = 2500) {
- const startedAt = Date.now();
- while (Date.now() - startedAt <= timeoutMs) {
- const channel = ChannelStore.getChannel(channelId);
- if (channel) return channel;
-
- await new Promise(resolve => setTimeout(resolve, 80));
- }
-
- return null;
-}
-
-async function waitForDmChannel(userId: string, timeoutMs = 2500) {
- const startedAt = Date.now();
- while (Date.now() - startedAt <= timeoutMs) {
- const channelId = ChannelStore.getDMFromUserId?.(userId);
- if (channelId) return channelId;
-
- await new Promise(resolve => setTimeout(resolve, 80));
- }
-
- return null;
-}
-
-async function openPopoutFromUserMenu(userId: string) {
- try {
- const channelId = await Promise.resolve(ChannelActionCreators.getOrEnsurePrivateChannel(userId));
- if (!channelId) return;
-
- const channel = await waitForChannel(channelId);
- if (channel) openPopout(channel.id);
- return;
- } catch {
- const fallbackChannelId = await waitForDmChannel(userId);
- if (!fallbackChannelId) return;
-
- const channel = await waitForChannel(fallbackChannelId);
- if (channel) openPopout(channel.id);
- }
-}
-
-function closePopout(channelId: string, syncPersistence = true) {
- const windowKey = getPopoutWindowKey(channelId);
- PopoutActions.close(windowKey);
- if (syncPersistence && !restoringPersistedPopouts) {
- syncPersistedPopoutWindows();
- }
-}
-
-function openPopout(channelId: string, syncPersistence = true) {
- const channel = ChannelStore.getChannel(channelId);
- if (!channel || !canOpenPopout(channel)) return;
-
- const windowKey = getPopoutWindowKey(channelId);
-
- if (isPopoutWindowOpen(channelId)) {
- closePopout(channelId, syncPersistence);
- return;
- }
-
- const title = getChannelTitle(channel);
-
- PopoutActions.open(
- windowKey,
- () =>