mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 13:43:03 -04:00
Fix Patch
This commit is contained in:
parent
7618040739
commit
5dd3d60cd7
1 changed files with 11 additions and 14 deletions
|
@ -34,23 +34,20 @@ export default definePlugin({
|
||||||
patches: [
|
patches: [
|
||||||
// Taken from AnonymiseFileNames
|
// Taken from AnonymiseFileNames
|
||||||
{
|
{
|
||||||
find: 'type:"UPLOAD_START"',
|
find: "async uploadFiles(",
|
||||||
replacement: {
|
replacement: [
|
||||||
match: /await \i\.uploadFiles\((\i),/,
|
|
||||||
replace: "$1.forEach($self.fixExt),$&"
|
|
||||||
},
|
|
||||||
predicate: () => !Settings.plugins.AnonymiseFileNames.enabled,
|
|
||||||
},
|
|
||||||
// Also taken from AnonymiseFileNames
|
|
||||||
{
|
{
|
||||||
find: "FirstThreadMessage,options",
|
match: /async uploadFiles\((\i),\i\){/,
|
||||||
replacement: {
|
replace: "$&$1.forEach($self.anonymise);"
|
||||||
match: /\i.uploadFilesSimple\((\i)\);/,
|
|
||||||
replace: "$&$1.forEach($self.fixExt);",
|
|
||||||
},
|
},
|
||||||
predicate: () => !Settings.plugins.AnonymiseFileNames.enabled,
|
{
|
||||||
|
match: /async uploadFilesSimple\((\i)\){/,
|
||||||
|
replace: "$&$1.forEach($self.anonymise);"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
predicate: () => !Settings.plugins.AnonymiseFileNames.enabled,
|
||||||
|
},
|
||||||
|
],
|
||||||
fixExt(upload: ExtUpload) {
|
fixExt(upload: ExtUpload) {
|
||||||
const file = upload.filename;
|
const file = upload.filename;
|
||||||
const tarMatch = tarExtMatcher.exec(file);
|
const tarMatch = tarExtMatcher.exec(file);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue