diff --git a/src/equicordplugins/contentWarning/index.tsx b/src/equicordplugins/contentWarning/index.tsx
index 52ccfe1b6..46336fb2d 100644
--- a/src/equicordplugins/contentWarning/index.tsx
+++ b/src/equicordplugins/contentWarning/index.tsx
@@ -4,8 +4,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
+import "./styles.css";
+
import { DataStore } from "@api/index";
import { definePluginSettings } from "@api/Settings";
+import { classNameFactory } from "@api/Styles";
import { Flex } from "@components/Flex";
import { HeadingTertiary } from "@components/Heading";
import { DeleteIcon } from "@components/Icons";
@@ -14,6 +17,8 @@ import { useForceUpdater } from "@utils/react";
import definePlugin, { OptionType } from "@utils/types";
import { Button, TextInput, useState } from "@webpack/common";
+const cl = classNameFactory("vc-content-warning-");
+
const WORDS_KEY = "ContentWarning_words";
let triggerWords = [""];
@@ -29,26 +34,31 @@ function safeMatchesRegex(s: string, r: string) {
function TriggerContainer({ child }) {
const [visible, setVisible] = useState(false);
+ const { onClick } = settings.store;
+
+ const className = onClick ? cl("container") : "";
if (visible) {
return child;
} else {
- return (
setVisible(true)}>
-
onClick && setVisible(true)}
onMouseEnter={event => {
- event.currentTarget.style.filter = "none";
+ if (!onClick) {
+ event.currentTarget.className = cl("enter");
+ }
}}
onMouseLeave={event => {
- event.currentTarget.style.filter = "blur(4px) brightness(70%)";
+ if (!onClick) {
+ event.currentTarget.className = cl("leave");
+ }
}}
>
{child}
-
-
);
+
+ );
}
}
@@ -118,36 +128,43 @@ function FlaggedWords() {
);
});
- return (<>
- Flagged Words
- {inputs}
- >);
+ return (
+ <>
+ Flagged Words
+ {inputs}
+ >
+ );
}
const settings = definePluginSettings({
flagged: {
type: OptionType.COMPONENT,
component: () => ,
+ },
+ onClick: {
+ type: OptionType.BOOLEAN,
+ description: "Only show trigger content on click instead of hover",
+ default: false,
}
});
export default definePlugin({
name: "ContentWarning",
authors: [EquicordDevs.camila314],
- description: "Allows you to specify certain trigger words that will be blurred by default. Hovering on the blurred content will reveal it.",
+ description: "Allows you to specify certain trigger words that will be blurred by default. Hovering/Clicking on the blurred content will reveal it.",
settings,
patches: [
{
find: ".VOICE_HANGOUT_INVITE?",
replacement: {
match: /(compact:\i}=(\i).+?)(\(0,.+\}\)\]\}\))/,
- replace: "$1 $self.modify($2,$3)"
+ replace: "$1 $self.modify(arguments[0].message,$3)"
}
}
],
- modify(e, child) {
- if (triggerWords.some(word => safeMatchesRegex(e.message.content, word))) {
+ modify(message, child) {
+ if (triggerWords.some(w => safeMatchesRegex(message.content, w))) {
return ;
} else {
return child;
diff --git a/src/equicordplugins/contentWarning/styles.css b/src/equicordplugins/contentWarning/styles.css
new file mode 100644
index 000000000..898bd336b
--- /dev/null
+++ b/src/equicordplugins/contentWarning/styles.css
@@ -0,0 +1,13 @@
+.vc-content-warning-container {
+ filter: blur(5px) brightness(30%);
+ transition: filter 0.2s ease-in-out;
+ cursor: pointer;
+}
+
+.vc-content-warning-enter {
+ filter: none;
+}
+
+.vc-content-warning-leave {
+ filter: blur(5px) brightness(30%);
+}
\ No newline at end of file
diff --git a/src/equicordplugins/sidebarChat/index.tsx b/src/equicordplugins/sidebarChat/index.tsx
index 821ac8c8d..83936d728 100644
--- a/src/equicordplugins/sidebarChat/index.tsx
+++ b/src/equicordplugins/sidebarChat/index.tsx
@@ -9,9 +9,9 @@ import "./styles.css";
import { NavContextMenuPatchCallback } from "@api/ContextMenu";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
-import { getCurrentChannel, getCurrentGuild } from "@utils/discord";
+import { getCurrentChannel } from "@utils/discord";
import definePlugin from "@utils/types";
-import { Channel, User } from "@vencord/discord-types";
+import { Channel, Guild, User } from "@vencord/discord-types";
import {
DefaultExtractAndLoadChunksRegex,
extractAndLoadChunksLazy,
@@ -26,14 +26,19 @@ import {
ChannelRouter,
ChannelStore,
FluxDispatcher,
+ GuildStore,
Menu,
MessageActions,
MessageStore,
PermissionsBits,
PermissionStore,
PopoutActions,
- React,
+ RelationshipStore,
+ SelectedChannelStore,
+ SelectedGuildStore,
+ useCallback,
useEffect,
+ useLayoutEffect,
UserStore,
useState,
useStateFromStores
@@ -50,61 +55,87 @@ const { HeaderBar, /* HeaderBarIcon*/ } = mapMangledModuleLazy(".themedMobile]:"
// from toolbox
const HeaderBarIcon = findComponentByCodeLazy(".HEADER_BAR_BADGE_TOP:", '.iconBadge,"top"');
-const ArrowsLeftRightIcon = () => {
- return ;
+const { ForumView } = mapMangledModuleLazy("forum-grid-header-section-", {
+ ForumView: filters.byCode("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 Resize = findComponentByCodeLazy("sidebarType:", "RESIZE_HANDLE_WIDTH)");
const ChannelHeader = findComponentByCodeLazy(".forumPostTitle]:", '"channel-".concat');
const PopoutWindow = findComponentByCodeLazy("Missing guestWindow reference");
const FullChannelView = findComponentByCodeLazy("showFollowButton:(null");
+const WanderingCubesLoading = findComponentByCodeLazy('="wanderingCubes"');
// love
const ppStyle = findLazy(m => m?.popoutContent && Object.keys(m).length === 1);
const ChatInputTypes = findByPropsLazy("FORM", "NORMAL");
const Sidebars = findByPropsLazy("ThreadSidebar", "MessageRequestSidebar");
+const ChatClasses = findByPropsLazy("threadSidebarOpen");
const ChannelSectionStore = findStoreLazy("ChannelSectionStore");
-const requireChannelContextMenu = extractAndLoadChunksLazy(["&&this.handleActivitiesPopoutClose(),"], new RegExp(DefaultExtractAndLoadChunksRegex.source + ".{1,150}isFavorite"));
+const requireChannelContextMenu = extractAndLoadChunksLazy(
+ ["&&this.handleActivitiesPopoutClose(),"],
+ new RegExp(DefaultExtractAndLoadChunksRegex.source + ".{1,150}isFavorite")
+);
+const requireForumView = extractAndLoadChunksLazy(
+ ["Missing channel in Channel.renderHeaderToolbar"],
+ new RegExp(DefaultExtractAndLoadChunksRegex.source + '.{1,150}name:"ForumChannel"')
+);
-interface ContextMenuProps {
- channel: Channel;
- guildId?: string;
- user: User;
-}
+const MakeContextMenu = (id: string, guildId: string | null) => {
+ return (
+