From 9f8c7494216b3d5aadb8d3fec14fa5ac7d8f448a Mon Sep 17 00:00:00 2001
From: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Date: Wed, 10 Jul 2024 04:33:03 -0300
Subject: [PATCH 1/4] Fix broken patches
---
src/plugins/consoleJanitor/index.ts | 2 +-
src/plugins/permissionsViewer/index.tsx | 2 +-
src/plugins/reviewDB/index.tsx | 9 ++++-----
src/plugins/showHiddenChannels/index.tsx | 6 +++---
src/plugins/viewIcons/index.tsx | 4 ++--
5 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/src/plugins/consoleJanitor/index.ts b/src/plugins/consoleJanitor/index.ts
index 30887f5a7..dfb59957d 100644
--- a/src/plugins/consoleJanitor/index.ts
+++ b/src/plugins/consoleJanitor/index.ts
@@ -114,7 +114,7 @@ export default definePlugin({
'("MessageActionCreators")', '("ChannelMessages")',
'("Routing/Utils")', '("RTCControlSocket")',
'("ConnectionEventFramerateReducer")', '("RTCLatencyTestManager")',
- '("OverlayBridgeStore")', '("RPCServer:WSS")'
+ '("OverlayBridgeStore")', '("RPCServer:WSS")', '("RPCServer:IPC")'
].map(logger => ({
find: logger,
predicate: () => settings.store.disableNoisyLoggers,
diff --git a/src/plugins/permissionsViewer/index.tsx b/src/plugins/permissionsViewer/index.tsx
index 6401d9450..6a503f2da 100644
--- a/src/plugins/permissionsViewer/index.tsx
+++ b/src/plugins/permissionsViewer/index.tsx
@@ -34,7 +34,7 @@ import UserPermissions from "./components/UserPermissions";
import { getSortedRoles, sortPermissionOverwrites } from "./utils";
const PopoutClasses = findByPropsLazy("container", "scroller", "list");
-const RoleButtonClasses = findByPropsLazy("button", "buttonInner", "icon", "text");
+const RoleButtonClasses = findByPropsLazy("button", "buttonInner", "icon", "banner");
export const enum PermissionsSortOrder {
HighestRole,
diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx
index 7fdc1509a..456e15a57 100644
--- a/src/plugins/reviewDB/index.tsx
+++ b/src/plugins/reviewDB/index.tsx
@@ -37,8 +37,7 @@ import { getCurrentUserInfo, readNotification } from "./reviewDbApi";
import { settings } from "./settings";
import { showToast } from "./utils";
-const PopoutClasses = findByPropsLazy("container", "scroller", "list");
-const RoleButtonClasses = findByPropsLazy("button", "buttonInner", "icon", "text");
+const RoleButtonClasses = findByPropsLazy("button", "buttonInner", "icon", "banner");
const guildPopoutPatch: NavContextMenuPatchCallback = (children, { guild }: { guild: Guild, onClose(): void; }) => {
if (!guild) return;
@@ -181,9 +180,9 @@ export default definePlugin({
onClick={() => openReviewsModal(user.id, user.username)}
look={Button.Looks.FILLED}
size={Button.Sizes.NONE}
- color={RoleButtonClasses.color}
- className={classes(RoleButtonClasses.button, RoleButtonClasses.banner)}
- innerClassName={classes(RoleButtonClasses.buttonInner, RoleButtonClasses.banner)}
+ color={RoleButtonClasses.bannerColor}
+ className={classes(RoleButtonClasses.button, RoleButtonClasses.icon, RoleButtonClasses.banner)}
+ innerClassName={classes(RoleButtonClasses.buttonInner, RoleButtonClasses.icon, RoleButtonClasses.banner)}
>
diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx
index 538200afa..2d8b0c190 100644
--- a/src/plugins/showHiddenChannels/index.tsx
+++ b/src/plugins/showHiddenChannels/index.tsx
@@ -257,7 +257,7 @@ export default definePlugin({
{
find: '"alt+shift+down"',
replacement: {
- match: /(?<=getChannel\(\i\);return null!=(\i))(?=.{0,150}?>0\)&&\(0,\i\.\i\)\(\i\))/,
+ match: /(?<=getChannel\(\i\);return null!=(\i))(?=.{0,200}?>0\)&&\(0,\i\.\i\)\(\i\))/,
replace: (_, channel) => `&&!$self.isHiddenChannel(${channel})`
}
},
@@ -265,8 +265,8 @@ export default definePlugin({
{
find: ".APPLICATION_STORE&&null!=",
replacement: {
- match: /(?<=getState\(\)\.channelId.{0,30}?\(0,\i\.\i\)\(\i\))(?=\.map\()/,
- replace: ".filter(e=>!$self.isHiddenChannel(e))"
+ match: /getState\(\)\.channelId.+?(?=\.map\(\i=>\i\.id)/,
+ replace: "$&.filter(e=>!$self.isHiddenChannel(e))"
}
},
{
diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx
index b2e7d56df..112f9f755 100644
--- a/src/plugins/viewIcons/index.tsx
+++ b/src/plugins/viewIcons/index.tsx
@@ -213,8 +213,8 @@ export default definePlugin({
{
find: ".canUsePremiumProfileCustomization,{avatarSrc:",
replacement: {
- match: /children:\(0,\i\.jsx\)\(\i,{src:(\i)/,
- replace: "style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},$&"
+ match: /\.avatar,\i\.clickable\),onClick:\i,(?<=avatarSrc:(\i).+?)/,
+ replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},"
}
},
From 04dce64bfd404900930839508b7bd9e4a0d0a7a1 Mon Sep 17 00:00:00 2001
From: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Date: Thu, 11 Jul 2024 16:56:02 -0300
Subject: [PATCH 2/4] Fix broken patches/finds
---
src/plugins/friendsSince/index.tsx | 2 +-
src/plugins/moreUserTags/index.tsx | 3 ++-
src/plugins/viewIcons/index.tsx | 28 +++++++++++++++-------------
3 files changed, 18 insertions(+), 15 deletions(-)
diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx
index 629e8e719..717bd754c 100644
--- a/src/plugins/friendsSince/index.tsx
+++ b/src/plugins/friendsSince/index.tsx
@@ -17,7 +17,7 @@ const container = findByPropsLazy("memberSince");
const getCreatedAtDate = findByCodeLazy('month:"short",day:"numeric"');
const locale = findByPropsLazy("getLocale");
const lastSection = findByPropsLazy("lastSection");
-const section = findLazy((m: any) => m.section !== void 0 && Object.values(m).length === 1);
+const section = findLazy((m: any) => m.section !== void 0 && m.heading !== void 0 && Object.values(m).length === 2);
export default definePlugin({
name: "FriendsSince",
diff --git a/src/plugins/moreUserTags/index.tsx b/src/plugins/moreUserTags/index.tsx
index be81a8a89..45538fb66 100644
--- a/src/plugins/moreUserTags/index.tsx
+++ b/src/plugins/moreUserTags/index.tsx
@@ -256,6 +256,7 @@ export default definePlugin({
// in profiles
{
find: ",overrideDiscriminator:",
+ group: true,
replacement: [
{
// prevent channel id from getting ghosted
@@ -263,7 +264,7 @@ export default definePlugin({
match: /user:\i,nick:\i,/,
replace: "$&moreTags_channelId,"
}, {
- match: /,botType:(\i\((\i)\)),/g,
+ match: /,botType:(\i),(?<=user:(\i).+?)/g,
replace: ",botType:$self.getTag({user:$2,channelId:moreTags_channelId,origType:$1,location:'not-chat'}),"
}
]
diff --git a/src/plugins/viewIcons/index.tsx b/src/plugins/viewIcons/index.tsx
index 112f9f755..6ca9bf2d1 100644
--- a/src/plugins/viewIcons/index.tsx
+++ b/src/plugins/viewIcons/index.tsx
@@ -183,14 +183,24 @@ export default definePlugin({
},
patches: [
- // Profiles Modal pfp
- ...[".MODAL,hasProfileEffect", ".FULL_SIZE,hasProfileEffect:"].map(find => ({
- find,
+ // Avatar component used in User DMs "User Profile" popup in the right and Profiles Modal pfp
+ {
+ find: ".overlay:void 0,status:",
+ replacement: [
+ ...[/"PRESS_VIEW_PROFILE".+?(?=children:)(?<=avatarSrc:(\i).+?)/, /avatarSrc:(\i),eventHandlers:(\i).+?"div",{...\2,/].map(match => ({
+ match,
+ replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},"
+ }))
+ ]
+ },
+ // Old Profiles Modal pfp
+ {
+ find: ".MODAL,hasProfileEffect",
replacement: {
match: /\{src:(\i)(?=,avatarDecoration)/,
replace: "{src:$1,onClick:()=>$self.openImage($1)"
}
- })),
+ },
// Banners
...[".NITRO_BANNER,", "=!1,canUsePremiumCustomization:"].map(find => ({
find,
@@ -202,7 +212,7 @@ export default definePlugin({
'onClick:ev=>$1&&ev.target.style.backgroundImage&&$self.openImage($2),style:{cursor:$1?"pointer":void 0,'
}
})),
- // User DMs "User Profile" popup in the right
+ // Old User DMs "User Profile" popup in the right
{
find: ".avatarPositionPanel",
replacement: {
@@ -210,14 +220,6 @@ export default definePlugin({
replace: "$1style:($2)?{cursor:\"pointer\"}:{},onClick:$2?()=>{$self.openImage($3)}"
}
},
- {
- find: ".canUsePremiumProfileCustomization,{avatarSrc:",
- replacement: {
- match: /\.avatar,\i\.clickable\),onClick:\i,(?<=avatarSrc:(\i).+?)/,
- replace: "$&style:{cursor:\"pointer\"},onClick:()=>{$self.openImage($1)},"
-
- }
- },
// Group DMs top small & large icon
{
find: /\.recipients\.length>=2(?!
Date: Fri, 12 Jul 2024 12:27:28 -0700
Subject: [PATCH 3/4] CtrlEnterSend: fix for new Discord update (#2689)
Co-authored-by: vee
---
src/plugins/ctrlEnterSend/index.ts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/plugins/ctrlEnterSend/index.ts b/src/plugins/ctrlEnterSend/index.ts
index 6c9b7ac1d..4a1b73765 100644
--- a/src/plugins/ctrlEnterSend/index.ts
+++ b/src/plugins/ctrlEnterSend/index.ts
@@ -39,6 +39,15 @@ export default definePlugin({
}
}),
patches: [
+ // Only one of the two patches will be at effect; Discord often updates to switch between them.
+ // See: https://discord.com/channels/1015060230222131221/1032770730703716362/1261398512017477673
+ {
+ find: ".ENTER&&(!",
+ replacement: {
+ match: /(?<=(\i)\.which===\i\.\i.ENTER&&).{0,100}(\(0,\i\.\i\)\(\i\)).{0,100}(?=&&\(\i\.preventDefault)/,
+ replace: "$self.shouldSubmit($1, $2)"
+ }
+ },
{
find: "!this.hasOpenCodeBlock()",
replacement: {
From 0057ab42e8e11f79589c9d17c24dddcafef18272 Mon Sep 17 00:00:00 2001
From: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Date: Fri, 12 Jul 2024 16:40:26 -0300
Subject: [PATCH 4/4] Fix broken experiments patch
---
src/plugins/experiments/index.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/plugins/experiments/index.tsx b/src/plugins/experiments/index.tsx
index 4cf8439bc..33c32b1a0 100644
--- a/src/plugins/experiments/index.tsx
+++ b/src/plugins/experiments/index.tsx
@@ -88,8 +88,8 @@ export default definePlugin({
{
find: "useCanFavoriteChannel",
replacement: {
- match: /!\(\i\.isDM\(\)\|\|\i\.isThread\(\)\)/,
- replace: "true",
+ match: /\i\.isDM\(\)\|\|\i\.isThread\(\)/,
+ replace: "false",
}
}
],