Patch Fixes

This commit is contained in:
thororen1234 2025-01-29 09:32:35 -05:00
parent 7206502f4d
commit 90f2d0895e
9 changed files with 13 additions and 117 deletions

View file

@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
### Extra included plugins
<details>
<summary>147 additional plugins</summary>
<summary>146 additional plugins</summary>
### All Platforms
- AllCallTimers by MaxHerbold & D3SOX
@ -90,7 +90,6 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
- MessageLoggerEnhanced by Aria
- MessagePeek by HypedDomi
- MessageTranslate by Samwich
- ModalFade by Kyuuhachi
- MoreStickers by Leko & Arjix
- NeverPausePreviews by vappstar
- NewPluginsManager by Sqaaakoi

View file

@ -40,7 +40,7 @@ export default definePlugin({
find: "#{intl::HUB_INVITE_ANOTHER_SCHOOL_LINK}",
replacement: [
{
match: /,(\i)&&(\(.{0,15}\i\.TooltipContainer.+)(\i\.\i\.string\(\i\.\i#{intl::GUEST_MEMBERSHIP_EXPLANATION}\))/,
match: /,(\i)&&(\(.{0,50}\i\.tooltipContainer.+)(\i\.\i\.string\(\i\.\i#{intl::GUEST_MEMBERSHIP_EXPLANATION}\))/,
replace: ",($1||((!$1)&&arguments[0].invite.expires_at)) && $2$self.RenderTip($1, $3, arguments[0].invite.expires_at)"
},
{

View file

@ -24,8 +24,8 @@ export default definePlugin({
{
find: "krisp_browser_models",
replacement: {
match: /\i:function\(\)\{/,
replace: "$&return null;"
match: /(\i,\{\i:\(\)=>)\i/,
replace: "$1null"
}
},
// Set Krisp to not supported

View file

@ -313,9 +313,9 @@ export default definePlugin({
settings,
patches: [
{
find: "#{intl::UNREADS_TAB_LABEL}",
find: "#{intl::UNREADS_TAB_LABEL})}",
replacement: {
match: /\i\?\(0,\i\.jsxs\)\(\i\.TabBar\.Item/,
match: /\(0,\i\.jsxs\)\(\i\.\i\i\.Item/,
replace: "$self.keywordTabBar(),$&"
}
},

View file

@ -104,7 +104,7 @@ export default definePlugin({
find: "#{intl::REPLY_QUOTE_MESSAGE_NOT_LOADED}",
replacement: {
// Should match two places
match: /(\i\.Clickable),\{/g,
match: /(\i\.clickable),\{/g,
replace: "$self.ReplyTooltip,{Component:$1,vcProps:arguments[0],"
},
predicate: () => settings.store.onReply,
@ -112,8 +112,8 @@ export default definePlugin({
{
find: "#{intl::MESSAGE_FORWARDED}",
replacement: {
match: /(\i\.Clickable),\{/,
replace: "$self.ForwardTooltip,{Component:$1,vcProps:arguments[0],"
match: /(null:.{0,20})(\i\.\i\i),\{/,
replace: "$1$self.ForwardTooltip,{Component:$2,vcProps:arguments[0],"
},
predicate: () => settings.store.onForward,
},

View file

@ -1,103 +0,0 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2024 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Devs } from "@utils/constants";
import { proxyLazy } from "@utils/lazy";
import definePlugin from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { Forms, useEffect, useRef } from "@webpack/common";
import type { StoreApi, UseBoundStore } from "zustand";
type Modal = {
Layer?: any,
instant?: boolean,
backdropStyle?: "SUBTLE" | "DARK" | "BLUR", "IMMERSIVE",
};
const { useModalContext, useModalsStore } = proxyLazy(() => Forms as any as {
useModalContext(): "default" | "popout";
useModalsStore: UseBoundStore<StoreApi<{
default: Modal[];
popout: Modal[];
}>>,
});
const { animated, useSpring, useTransition } = findByPropsLazy("a", "animated", "useTransition");
const ANIMS = {
SUBTLE: {
off: { opacity: 1 },
on: { opacity: 0.9 },
},
DARK: {
off: { opacity: 1 },
on: { opacity: 0.7 },
},
BLUR: {
off: { opacity: 1, filter: "blur(0px)" },
on: { opacity: 0.7, filter: "blur(8px)" },
},
IMMERSIVE: {
off: { opacity: 1 },
on: { opacity: 0.7 }
}
};
export default definePlugin({
name: "ModalFade",
description: "Makes modals fade the backdrop, rather than dimming",
authors: [Devs.Kyuuhachi],
patches: [
{
find: "contextMenuCallbackNative,!1",
replacement: {
match: /(?<=\()"div"(?=,\{className:\i\(\)\(\i\?\i\.mobileApp:\i.app\))/,
replace: "$self.MainWrapper",
}
},
{
find: ".SUBTLE=\"SUBTLE\"",
replacement: {
match: /\(0,\i\.useTransition\)*/,
replace: "$self.nullTransition"
}
}
],
nullTransition(value: any, args: object) {
return useTransition(value, {
...args,
from: {},
enter: { _: 0 }, // Spring gets unhappy if there's zero animations
leave: {},
});
},
MainWrapper(props: object) {
const context = useModalContext();
const modals = useModalsStore(modals => modals[context] ?? []);
const modal = modals.findLast(modal => modal.Layer == null); // || modal.Layer === AppLayer
const anim = ANIMS[modal?.backdropStyle ?? "DARK"];
const isInstant = modal?.instant;
const prevIsInstant = usePrevious(isInstant);
const style = useSpring({
config: { duration: isInstant || prevIsInstant ? 0 : 300 },
...modal != null ? anim.on : anim.off,
});
return <animated.div style={style} {...props} />;
}
});
function usePrevious<T>(value: T | undefined): T | undefined {
const ref = useRef<T>(undefined);
useEffect(() => {
if (ref !== undefined) {
ref.current = value;
}
}, [value]);
return ref.current;
}

View file

@ -171,7 +171,7 @@ export default definePlugin({
{
find: "#{intl::CUSTOM_STATUS_SET_CUSTOM_STATUS}",
replacement: {
match: /\.ModalFooter,.{0,70}\i\.\i\.string\(\i\.\i#{intl::SAVE}\)\}\)/,
match: /\.\i\i,children:.{0,70}\i\.\i\.string\(\i\.\i#{intl::SAVE}\)\}\)/,
replace: "$&,$self.renderRememberButton(this.state)"
}
},

View file

@ -88,7 +88,7 @@ export default definePlugin({
find: "referencedUsernameProfile,referencedAvatarProfile",
replacement: [
{
match: /CUSTOM_GIFT.*?=(?=\(0,\i.jsx\)\(\i.FocusRing)/,
match: /CUSTOM_GIFT.*?=(?=\(0,\i.jsx\)\(\i.\i\i)/,
replace: "$&!$self.isReplyToBlocked(arguments[0].message)&&",
}
],

View file

@ -212,8 +212,8 @@ export default definePlugin({
{
// Make muted channels also appear as unread if hide unreads is false and the channel is hidden
predicate: () => settings.store.channelStyle === ChannelStyle.MutedUnread || settings.store.channelStyle === ChannelStyle.Unread,
match: /\.LOCKED;if\((?<={channel:(\i).+?)/,
replace: (m, channel) => `${m}!$self.isHiddenChannel(${channel})&&`
match: /(?<=\.LOCKED(?:;if\(|:))(?<={channel:(\i).+?)/,
replace: (_, channel) => `!$self.isHiddenChannel(${channel})&&`
}
]
},