aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/showHiddenChannels/index.tsx
diff options
context:
space:
mode:
authorNuckyz <61953774+Nuckyz@users.noreply.github.com>2023-03-05 18:49:59 -0300
committerGitHub <noreply@github.com>2023-03-05 22:49:59 +0100
commitbed5e98bb03a2c7073f9f421a396fa7616d56ac5 (patch)
treedd862f2649c4a59f9242ab5c73d57221c52c61ec /src/plugins/showHiddenChannels/index.tsx
parenta5392e5c53675e5206a4d5fcf97b9d6a8d07727b (diff)
downloadVencord-bed5e98bb03a2c7073f9f421a396fa7616d56ac5.tar.gz
Vencord-bed5e98bb03a2c7073f9f421a396fa7616d56ac5.tar.bz2
Vencord-bed5e98bb03a2c7073f9f421a396fa7616d56ac5.zip
Misc fixes and improvements (#555)
Co-authored-by: Ven <vendicated@riseup.net>
Diffstat (limited to 'src/plugins/showHiddenChannels/index.tsx')
-rw-r--r--src/plugins/showHiddenChannels/index.tsx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx
index fe14fe6..60e0c51 100644
--- a/src/plugins/showHiddenChannels/index.tsx
+++ b/src/plugins/showHiddenChannels/index.tsx
@@ -26,7 +26,7 @@ import { findByPropsLazy } from "@webpack";
import { ChannelStore, PermissionStore, Tooltip } from "@webpack/common";
import { Channel } from "discord-types/general";
-import HiddenChannelLockScreen from "./components/HiddenChannelLockScreen";
+import HiddenChannelLockScreen, { setChannelBeginHeaderComponent, setEmojiComponent } from "./components/HiddenChannelLockScreen";
const ChannelListClasses = findByPropsLazy("channelName", "subtitle", "modeMuted", "iconContainer");
@@ -239,8 +239,8 @@ export default definePlugin({
{
find: 'jumboable?"jumbo":"default"',
replacement: {
- match: /(?<=\i:\(\)=>\i)(?=}.+?(?<component>\i)=function.{1,20}node,\i=\i.isInteracting)/,
- replace: ",hc1:()=>$<component>" // Blame Ven length check for the small name :pensive_cry:
+ match: /(?<=(?<component>\i)=function.{1,20}node,\i=\i.isInteracting.+?}}\)},)/,
+ replace: "shcEmojiComponentExport=($self.setEmojiComponent($<component>),void 0),"
}
},
{
@@ -248,8 +248,8 @@ export default definePlugin({
replacement: [
{
// Export the channel beggining header
- match: /(?<=\i:\(\)=>\i)(?=}.+?function (?<component>\i).{1,600}computePermissionsForRoles)/,
- replace: ",hc2:()=>$<component>"
+ match: /(?<=function (?<component>\i)\(.{1,600}computePermissionsForRoles.+?}\)})(?=var)/,
+ replace: "$self.setChannelBeginHeaderComponent($<component>);"
},
{
// Patch the header to only return allowed users and roles if it's a hidden channel (Like when it's used on the HiddenChannelLockScreen)
@@ -325,6 +325,9 @@ export default definePlugin({
}
],
+ setEmojiComponent,
+ setChannelBeginHeaderComponent,
+
isHiddenChannel(channel: Channel & { channelId?: string; }) {
if (!channel) return false;