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: [
// Taken from AnonymiseFileNames
{
find: "instantBatchUpload:",
find: 'type:"UPLOAD_START"',
replacement: {
match: /uploadFiles:(\i),/,
replace:
"uploadFiles:(...args)=>(args[0].uploads.forEach(f=>f.filename=$self.fixExt(f)),$1(...args)),",
match: /await \i\.uploadFiles\((\i),/,
replace: "$1.forEach($self.fixExt),$&"
},
predicate: () => !Settings.plugins.AnonymiseFileNames.enabled,
},

View file

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