Skip to content

Commit dd37398

Browse files
authored
Merge pull request #36 from Vendicated/main
General Fixes (1.10.7)
2 parents 3cf6a00 + 7ef536c commit dd37398

File tree

96 files changed

+500
-305
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+500
-305
lines changed

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vencord",
33
"private": "true",
4-
"version": "1.10.5",
4+
"version": "1.10.7",
55
"description": "The cutest Discord client mod",
66
"homepage": "https://github.com/Vendicated/Vencord#readme",
77
"bugs": {
@@ -35,6 +35,7 @@
3535
"testTsc": "tsc --noEmit"
3636
},
3737
"dependencies": {
38+
"@intrnl/xxhash64": "^0.1.2",
3839
"@sapphi-red/web-noise-suppressor": "0.3.5",
3940
"@vap/core": "0.0.12",
4041
"@vap/shiki": "0.10.5",

pnpm-lock.yaml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/generateReport.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ page.on("console", async e => {
225225
plugin,
226226
type,
227227
id,
228-
match: regex.replace(/\[A-Za-z_\$\]\[\\w\$\]\*/g, "\\i"),
228+
match: regex.replace(/\(\?:\[A-Za-z_\$\]\[\\w\$\]\*\)/g, "\\i"),
229229
error: await maybeGetError(e.args()[3])
230230
});
231231

src/components/Icons.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818

1919
import "./iconStyles.css";
2020

21-
import { getTheme, Theme } from "@utils/discord";
21+
import { getIntlMessage, getTheme, Theme } from "@utils/discord";
2222
import { classes } from "@utils/misc";
23-
import { i18n } from "@webpack/common";
2423
import type { PropsWithChildren } from "react";
2524

2625
interface BaseIconProps extends IconProps {
@@ -133,7 +132,7 @@ export function InfoIcon(props: IconProps) {
133132
export function OwnerCrownIcon(props: IconProps) {
134133
return (
135134
<Icon
136-
aria-label={i18n.Messages.GUILD_OWNER}
135+
aria-label={getIntlMessage("GUILD_OWNER")}
137136
{...props}
138137
className={classes(props.className, "vc-owner-crown-icon")}
139138
role="img"

src/components/VencordSettings/PatchHelperTab.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function FullPatchInput({ setFind, setParsedFind, setMatch, setReplacement }: Fu
247247
}
248248

249249
try {
250-
const parsed = (0, eval)(`(${fullPatch})`) as Patch;
250+
const parsed = (0, eval)(`([${fullPatch}][0])`) as Patch;
251251

252252
if (!parsed.find) throw new Error("No 'find' field");
253253
if (!parsed.replacement) throw new Error("No 'replacement' field");

src/debug/loadLazyChunks.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ export async function loadLazyChunks() {
3131
const lazyChunks = factoryCode.matchAll(LazyChunkRegex);
3232
const validChunkGroups = new Set<[chunkIds: number[], entryPoint: number]>();
3333

34-
// Workaround for a chunk that depends on the ChannelMessage component but may be be force loaded before
35-
// the chunk containing the component
36-
const shouldForceDefer = factoryCode.includes(".Messages.GUILD_FEED_UNFEATURE_BUTTON_TEXT");
34+
const shouldForceDefer = false;
3735

3836
await Promise.all(Array.from(lazyChunks).map(async ([, rawChunkIds, entryPoint]) => {
3937
const chunkIds = rawChunkIds ? Array.from(rawChunkIds.matchAll(Webpack.ChunkIdsRegex)).map(m => Number(m[1])) : [];

src/plugins/_api/memberListDecorators.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default definePlugin({
3131
match: /let\{[^}]*lostPermissionTooltipText:\i[^}]*\}=(\i),/,
3232
replace: "$&vencordProps=$1,"
3333
}, {
34-
match: /\.Messages\.GUILD_OWNER(?=.+?decorators:(\i)\(\)).+?\1=?\(\)=>.+?children:\[/,
34+
match: /#{intl::GUILD_OWNER}(?=.+?decorators:(\i)\(\)).+?\1=?\(\)=>.+?children:\[/,
3535
replace: "$&...(typeof vencordProps=='undefined'?[]:Vencord.Api.MemberListDecorators.__getDecorators(vencordProps)),"
3636
}
3737
]

src/plugins/_api/messageAccessories.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default definePlugin({
2525
authors: [Devs.Cyn],
2626
patches: [
2727
{
28-
find: ".Messages.REMOVE_ATTACHMENT_BODY",
28+
find: "#{intl::REMOVE_ATTACHMENT_BODY}",
2929
replacement: {
3030
match: /(?<=.container\)?,children:)(\[.+?\])/,
3131
replace: "Vencord.Api.MessageAccessories._modifyAccessories($1,this.props)",

src/plugins/_api/messageDecorations.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default definePlugin({
2727
{
2828
find: '"Message Username"',
2929
replacement: {
30-
match: /\.Messages\.GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE.+?}\),\i(?=\])/,
30+
match: /#{intl::GUILD_COMMUNICATION_DISABLED_BOTTOM_SHEET_TITLE}.+?}\),\i(?=\])/,
3131
replace: "$&,...Vencord.Api.MessageDecorations.__addDecorationsToMessage(arguments[0])"
3232
}
3333
}

src/plugins/_api/messageEvents.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default definePlugin({
2525
authors: [Devs.Arjix, Devs.hunt, Devs.Ven],
2626
patches: [
2727
{
28-
find: ".Messages.EDIT_TEXTAREA_HELP",
28+
find: "#{intl::EDIT_TEXTAREA_HELP}",
2929
replacement: {
3030
match: /(?<=,channel:\i\}\)\.then\().+?(?=return \i\.content!==this\.props\.message\.content&&\i\((.+?)\))/,
3131
replace: (match, args) => "" +

src/plugins/_api/messagePopover.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export default definePlugin({
2424
description: "API to add buttons to message popovers.",
2525
authors: [Devs.KingFish, Devs.Ven, Devs.Nuckyz],
2626
patches: [{
27-
find: "Messages.MESSAGE_UTILITIES_A11Y_LABEL",
27+
find: "#{intl::MESSAGE_UTILITIES_A11Y_LABEL}",
2828
replacement: {
29-
match: /\.jsx\)\((\i\.\i),\{label:\i\.\i\.Messages\.MESSAGE_ACTION_REPLY.{0,200}?"reply-self".{0,50}?\}\):null(?=,.+?message:(\i))/,
29+
match: /\.jsx\)\((\i\.\i),\{label:\i\.\i\.string\(\i\.\i#{intl::MESSAGE_ACTION_REPLY}.{0,200}?"reply-self".{0,50}?\}\):null(?=,.+?message:(\i))/,
3030
replace: "$&,Vencord.Api.MessagePopover._buildPopoverElements($1,$2)"
3131
}
3232
}],

src/plugins/_api/serverList.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ export default definePlugin({
2525
description: "Api required for plugins that modify the server list",
2626
patches: [
2727
{
28-
find: "Messages.DISCODO_DISABLED",
28+
find: "#{intl::DISCODO_DISABLED}",
2929
replacement: {
30-
match: /(?<=Messages\.DISCODO_DISABLED.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/,
30+
match: /(?<=#{intl::DISCODO_DISABLED}.+?return)(\(.{0,75}?tutorialContainer.+?}\))(?=}function)/,
3131
replace: "[$1].concat(Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.Above))"
3232
}
3333
},
3434
{
35-
find: "Messages.SERVERS,children",
35+
find: "#{intl::SERVERS}),children",
3636
replacement: {
37-
match: /(?<=Messages\.SERVERS,children:)\i\.map\(\i\)/,
37+
match: /(?<=#{intl::SERVERS}\),children:)\i\.map\(\i\)/,
3838
replace: "Vencord.Api.ServerList.renderAll(Vencord.Api.ServerList.ServerListRenderPosition.In).concat($&)"
3939
}
4040
}

src/plugins/_core/noTrack.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,7 @@ export default definePlugin({
5959
replace: "$&return;"
6060
}
6161
]
62-
},
63-
{
64-
find: ".installedLogHooks)",
65-
replacement: {
66-
// if getDebugLogging() returns false, the hooks don't get installed.
67-
match: "getDebugLogging(){",
68-
replace: "getDebugLogging(){return false;"
69-
}
70-
},
62+
}
7163
],
7264

7365
startAt: StartAt.Init,

src/plugins/_core/settings.tsx

+17-11
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ import ThemesTab from "@components/VencordSettings/ThemesTab";
2525
import UpdaterTab from "@components/VencordSettings/UpdaterTab";
2626
import VencordTab from "@components/VencordSettings/VencordTab";
2727
import { Devs } from "@utils/constants";
28+
import { getIntlMessage } from "@utils/discord";
2829
import definePlugin, { OptionType } from "@utils/types";
29-
import { i18n, React } from "@webpack/common";
30+
import { React } from "@webpack/common";
3031

3132
import gitHash from "~git-hash";
3233

@@ -57,20 +58,20 @@ export default definePlugin({
5758
]
5859
},
5960
{
60-
find: "Messages.ACTIVITY_SETTINGS",
61+
find: ".SEARCH_NO_RESULTS&&0===",
6162
replacement: [
6263
{
6364
match: /(?<=section:(.{0,50})\.DIVIDER\}\))([,;])(?=.{0,200}(\i)\.push.{0,100}label:(\i)\.header)/,
6465
replace: (_, sectionTypes, commaOrSemi, elements, element) => `${commaOrSemi} $self.addSettings(${elements}, ${element}, ${sectionTypes}) ${commaOrSemi}`
6566
},
6667
{
67-
match: /({(?=.+?function (\i).{0,120}(\i)=\i\.useMemo.{0,60}return \i\.useMemo\(\(\)=>\i\(\3).+?function\(\){return )\2(?=})/,
68+
match: /({(?=.+?function (\i).{0,160}(\i)=\i\.useMemo.{0,140}return \i\.useMemo\(\(\)=>\i\(\3).+?function\(\){return )\2(?=})/,
6869
replace: (_, rest, settingsHook) => `${rest}$self.wrapSettingsHook(${settingsHook})`
6970
}
7071
]
7172
},
7273
{
73-
find: "Messages.USER_SETTINGS_ACTIONS_MENU_LABEL",
74+
find: "#{intl::USER_SETTINGS_ACTIONS_MENU_LABEL}",
7475
replacement: {
7576
match: /(?<=function\((\i),\i\)\{)(?=let \i=Object.values\(\i.\i\).*?(\i\.\i)\.open\()/,
7677
replace: "$2.open($1);return;"
@@ -148,13 +149,18 @@ export default definePlugin({
148149

149150
if (!header) return;
150151

151-
const names = {
152-
top: i18n.Messages.USER_SETTINGS,
153-
aboveNitro: i18n.Messages.BILLING_SETTINGS,
154-
belowNitro: i18n.Messages.APP_SETTINGS,
155-
aboveActivity: i18n.Messages.ACTIVITY_SETTINGS
156-
};
157-
return header === names[settingsLocation];
152+
try {
153+
const names = {
154+
top: getIntlMessage("USER_SETTINGS"),
155+
aboveNitro: getIntlMessage("BILLING_SETTINGS"),
156+
belowNitro: getIntlMessage("APP_SETTINGS"),
157+
aboveActivity: getIntlMessage("ACTIVITY_SETTINGS")
158+
};
159+
160+
return header === names[settingsLocation];
161+
} catch {
162+
return firstChild === "PREMIUM";
163+
}
158164
},
159165

160166
patchedSettings: new WeakSet(),

src/plugins/_core/supportHelper.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ export default definePlugin({
147147
settings,
148148

149149
patches: [{
150-
find: ".BEGINNING_DM.format",
150+
find: "#{intl::BEGINNING_DM}",
151151
replacement: {
152-
match: /BEGINNING_DM\.format\(\{.+?\}\),(?=.{0,300}(\i)\.isMultiUserDM)/,
152+
match: /#{intl::BEGINNING_DM},{.+?}\),(?=.{0,300}(\i)\.isMultiUserDM)/,
153153
replace: "$& $self.renderContributorDmWarningCard({ channel: $1 }),"
154154
}
155155
}],

src/plugins/accountPanelServerProfile/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export default definePlugin({
6969

7070
patches: [
7171
{
72-
find: ".Messages.ACCOUNT_SPEAKING_WHILE_MUTED",
72+
find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}",
7373
group: true,
7474
replacement: [
7575
{

src/plugins/alwaysAnimate/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default definePlugin({
4141
},
4242
{
4343
// Status emojis
44-
find: ".Messages.GUILD_OWNER,",
44+
find: "#{intl::GUILD_OWNER}",
4545
replacement: {
4646
match: /(?<=\.activityEmoji,.+?animate:)\i/,
4747
replace: "!0"

src/plugins/anonymiseFileNames/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ export default definePlugin({
8686
}
8787
},
8888
{
89-
find: ".Messages.ATTACHMENT_UTILITIES_SPOILER",
89+
find: "#{intl::ATTACHMENT_UTILITIES_SPOILER}",
9090
replacement: {
91-
match: /(?<=children:\[)(?=.{10,80}tooltip:.{0,100}\i\.\i\.Messages\.ATTACHMENT_UTILITIES_SPOILER)/,
91+
match: /(?<=children:\[)(?=.{10,80}tooltip:.{0,100}#{intl::ATTACHMENT_UTILITIES_SPOILER})/,
9292
replace: "arguments[0].canEdit!==false?$self.renderIcon(arguments[0]):null,"
9393
},
9494
},

src/plugins/banger/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export default definePlugin({
3636
settings,
3737
patches: [
3838
{
39-
find: "BAN_CONFIRM_TITLE.",
39+
find: "#{intl::BAN_CONFIRM_TITLE}",
4040
replacement: {
4141
match: /src:\i\("?\d+"?\)/g,
4242
replace: "src:$self.source"

src/plugins/betterFolders/index.tsx

+14-9
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818

1919
import { definePluginSettings } from "@api/Settings";
2020
import { Devs } from "@utils/constants";
21+
import { getIntlMessage } from "@utils/discord";
2122
import definePlugin, { OptionType } from "@utils/types";
2223
import { findByPropsLazy, findLazy, findStoreLazy } from "@webpack";
23-
import { FluxDispatcher, i18n, useMemo } from "@webpack/common";
24+
import { FluxDispatcher, useMemo } from "@webpack/common";
2425

2526
import FolderSideBar from "./FolderSideBar";
2627

@@ -172,7 +173,7 @@ export default definePlugin({
172173
// Disable expanding and collapsing folders transition in the normal GuildsBar sidebar
173174
{
174175
predicate: () => !settings.store.keepIcons,
175-
match: /(?<=\.Messages\.SERVER_FOLDER_PLACEHOLDER.+?useTransition\)\()/,
176+
match: /(?<=#{intl::SERVER_FOLDER_PLACEHOLDER}.+?useTransition\)\()/,
176177
replace: "$self.shouldShowTransition(arguments[0])&&"
177178
},
178179
// If we are rendering the normal GuildsBar sidebar, we avoid rendering guilds from folders that are expanded
@@ -205,7 +206,7 @@ export default definePlugin({
205206
}
206207
},
207208
{
208-
find: ".Messages.DISCODO_DISABLED",
209+
find: "#{intl::DISCODO_DISABLED}",
209210
predicate: () => settings.store.closeAllHomeButton,
210211
replacement: {
211212
// Close all folders when clicking the home button
@@ -274,12 +275,16 @@ export default definePlugin({
274275
},
275276

276277
makeGuildsBarGuildListFilter(isBetterFolders: boolean) {
277-
return child => {
278-
if (isBetterFolders) {
279-
return child?.props?.["aria-label"] === i18n.Messages.SERVERS;
280-
}
281-
return true;
282-
};
278+
return child => {
279+
if (isBetterFolders) {
280+
try {
281+
return child?.props?.["aria-label"] === getIntlMessage("SERVERS");
282+
} catch (e) {
283+
console.error(e);
284+
}
285+
}
286+
return true;
287+
};
283288
},
284289

285290
makeGuildsBarTreeFilter(isBetterFolders: boolean) {

src/plugins/betterGifAltText/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export default definePlugin({
3434
},
3535
},
3636
{
37-
find: ".Messages.GIF,",
37+
find: "#{intl::GIF}",
3838
replacement: {
39-
match: /alt:(\i)=(\i\.\i\.Messages\.GIF)(?=,[^}]*\}=(\i))/,
39+
match: /alt:(\i)=(\i\.\i\.string\(\i\.\i#{intl::GIF}\))(?=,[^}]*\}=(\i))/,
4040
replace:
4141
// rename prop so we can always use default value
4242
"alt_$$:$1=$self.altify($3)||$2",

src/plugins/betterNotes/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ export default definePlugin({
6363
}
6464
},
6565
{
66-
find: "Messages.NOTE_PLACEHOLDER",
66+
find: "#{intl::NOTE_PLACEHOLDER}",
6767
replacement: {
68-
match: /\.NOTE_PLACEHOLDER,/,
68+
match: /#{intl::NOTE_PLACEHOLDER}\),/,
6969
replace: "$&spellCheck:!$self.noSpellCheck,"
7070
}
7171
}

src/plugins/betterRoleDot/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default definePlugin({
4747
},
4848

4949
{
50-
find: ".ADD_ROLE_A11Y_LABEL",
50+
find: "#{intl::ADD_ROLE_A11Y_LABEL}",
5151
all: true,
5252
predicate: () => Settings.plugins.BetterRoleDot.copyRoleColorInProfilePopout && !Settings.plugins.BetterRoleDot.bothStyles,
5353
noWarn: true,

src/plugins/betterSessions/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default definePlugin({
6060

6161
patches: [
6262
{
63-
find: "Messages.AUTH_SESSIONS_SESSION_LOG_OUT",
63+
find: "#{intl::AUTH_SESSIONS_SESSION_LOG_OUT}",
6464
replacement: [
6565
// Replace children with a single label with state
6666
{

0 commit comments

Comments
 (0)