aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-11-11 16:43:40 +0100
committerVendicated <vendicated@riseup.net>2022-11-11 16:43:40 +0100
commit2133823bd369efa145474f6e558a82a960d48d52 (patch)
tree4bf70ebe3db18c7b0b7db70547c4dcbb32385b6a
parent1176896a1b7aa5615b4aae28cc885683f0dadd1a (diff)
downloadVencord-2133823bd369efa145474f6e558a82a960d48d52.tar.gz
Vencord-2133823bd369efa145474f6e558a82a960d48d52.tar.bz2
Vencord-2133823bd369efa145474f6e558a82a960d48d52.zip
more plugin fixes
-rw-r--r--report.md38
-rw-r--r--src/plugins/apiMessageAccessories.ts6
-rw-r--r--src/plugins/pronoundb/index.ts3
-rw-r--r--src/utils/types.ts3
-rw-r--r--src/webpack/patchWebpack.ts2
5 files changed, 47 insertions, 5 deletions
diff --git a/report.md b/report.md
new file mode 100644
index 0000000..2f6c9fe
--- /dev/null
+++ b/report.md
@@ -0,0 +1,38 @@
+# Vencord Report
+
+## Bad Patches
+- BetterGifAltText (had no effect)
+ - ID: `866358`
+ - Match: ```/(return .{1,2}\.createElement.{0,50}isWindowFocused)/ ```
+- Webhook Tags (had no effect)
+ - ID: `696278`
+ - Match: ```/return null==(.)\?null:.\.createElement\((.)\.Z/ ```
+- MessageAccessoriesAPI (had no effect)
+ - ID: `96063`
+ - Match: ```/\(\)\.container\)},(.+?)\)};return/ ```
+- NoBlockedMessages (had no effect)
+ - ID: `748241`
+ - Match: ```/collapsedReason;return (?=\w{1,2}.createElement)/ ```
+- IgnoreActivities (had no effect)
+ - ID: `413620`
+ - Match: ```/(.:\(\)=>.)(.+)(function (.)\(.{1,10}\.width.+\)\)\)})/ ```
+- IgnoreActivities (had no effect)
+ - ID: `529622`
+ - Match: ```/(this.renderLastPlayed\(\)\),this.renderOverlayToggle\(\))/ ```
+- IgnoreActivities (errored)
+ - ID: `529622`
+ - Match: ```/;(.\.renderOverlayToggle=function\(\).+?\)\)\)};)/ ```
+ - Error: ```Unexpected end of input ```
+- ViewIcons (had no effect)
+ - ID: `847018`
+ - Match: ```/(?<=createElement\((.{1,5}),\{id:"leave-guild".{0,100},)(.{1,2}\.createElement)\((.{1,5}),null,(.{1,2})\)(?=\)\}function)/ ```
+- PlainFolderIcon (found no module)
+ - ID: `-`
+ - Match: ```().expandedFolderIconWrapperabaa ```
+
+## Bad Starts
+- NitroBypass
+ - Error: ```tets error ```
+## Discord Errors
+- ```Failed to load resource: the server responded with a status of 429 () ```
+- ```Failed to load resource: the server responded with a status of 404 () ```
diff --git a/src/plugins/apiMessageAccessories.ts b/src/plugins/apiMessageAccessories.ts
index 5f6c693..ee3ee90 100644
--- a/src/plugins/apiMessageAccessories.ts
+++ b/src/plugins/apiMessageAccessories.ts
@@ -27,9 +27,9 @@ export default definePlugin({
{
find: "_messageAttachmentToEmbedMedia",
replacement: {
- match: /\(\)\.container,children:[[^\]]*]\)},(.+?)\)};return/,
- replace: (_, accessories) =>
- `().container)},Vencord.Api.MessageAccessories._modifyAccessories([${accessories}],this.props))};return`,
+ match: /(\(\)\.container\)?,children:)(\[[^\]]+\])(}\)\};return)/,
+ replace: (_, pre, accessories, post) =>
+ `${pre}Vencord.Api.MessageAccessories._modifyAccessories(${accessories},this.props)${post}`,
},
},
],
diff --git a/src/plugins/pronoundb/index.ts b/src/plugins/pronoundb/index.ts
index 121e0d6..499a73a 100644
--- a/src/plugins/pronoundb/index.ts
+++ b/src/plugins/pronoundb/index.ts
@@ -46,11 +46,12 @@ export default definePlugin({
{
find: "currentPronouns:",
all: true,
+ noWarn: true,
replacement: {
match: /\(0,.{1,3}\.jsxs?\)\((.{1,10}),(\{[^[}]*currentPronouns:[^}]*(\w)\.pronouns[^}]*\})\)/,
replace: (original, PronounComponent, pronounProps, fullProps) => {
// UserSettings
- if (fullProps.includes("onPronounsChange")) return original;
+ if (pronounProps.includes("onPronounsChange")) return original;
return `Vencord.Plugins.plugins.PronounDB.PronounsProfileWrapper(${PronounComponent}, ${pronounProps}, ${fullProps})`;
}
diff --git a/src/utils/types.ts b/src/utils/types.ts
index 689baa7..dd0a9c5 100644
--- a/src/utils/types.ts
+++ b/src/utils/types.ts
@@ -34,7 +34,10 @@ export interface Patch {
plugin: string;
find: string;
replacement: PatchReplacement | PatchReplacement[];
+ /** Whether this patch should apply to multiple modules */
all?: boolean;
+ /** Do not warn if this patch did no changes */
+ noWarn?: boolean;
predicate?(): boolean;
}
diff --git a/src/webpack/patchWebpack.ts b/src/webpack/patchWebpack.ts
index f14ab0b..40a16a6 100644
--- a/src/webpack/patchWebpack.ts
+++ b/src/webpack/patchWebpack.ts
@@ -141,7 +141,7 @@ function patchPush() {
try {
const newCode = code.replace(replacement.match, replacement.replace);
- if (newCode === code) {
+ if (newCode === code && !replacement.noWarn) {
logger.warn(`Patch by ${patch.plugin} had no effect (Module id is ${id}): ${replacement.match}`);
if (IS_DEV) {
logger.debug("Function Source:\n", code);