Fixes For Merge

This commit is contained in:
thororen1234 2025-05-21 18:03:08 -04:00
parent 5621847709
commit 1fdbbdde99
No known key found for this signature in database
2 changed files with 5 additions and 6 deletions

View file

@ -34,11 +34,10 @@ export default definePlugin({
patches: [ patches: [
// Taken from AnonymiseFileNames // Taken from AnonymiseFileNames
{ {
find: "instantBatchUpload:", find: 'type:"UPLOAD_START"',
replacement: { replacement: {
match: /uploadFiles:(\i),/, match: /await \i\.uploadFiles\((\i),/,
replace: replace: "$1.forEach($self.fixExt),$&"
"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.fixExt(f)),$1(...args)),",
}, },
predicate: () => !Settings.plugins.AnonymiseFileNames.enabled, predicate: () => !Settings.plugins.AnonymiseFileNames.enabled,
}, },

View file

@ -11,8 +11,8 @@ import { ChannelStore, UploadHandler } from "@webpack/common";
import { FFmpegState, Sticker } from "./types"; import { FFmpegState, Sticker } from "./types";
// eslint-disable-next-line @stylistic/quotes
const MessageUpload = findByPropsLazy("instantBatchUpload"); const MessageUpload = findByPropsLazy(`type:"UPLOAD_START"`, "uploadFiles");
const CloudUpload = findLazy(m => m.prototype?.trackUploadFinished); const CloudUpload = findLazy(m => m.prototype?.trackUploadFinished);
const PendingReplyStore = findByPropsLazy("getPendingReply"); const PendingReplyStore = findByPropsLazy("getPendingReply");
const MessageUtils = findByPropsLazy("sendMessage"); const MessageUtils = findByPropsLazy("sendMessage");