This commit is contained in:
Mirco Wittrien 2020-03-31 09:06:17 +02:00
parent e27eab0d6e
commit 9689b56456
4 changed files with 24 additions and 11 deletions

View File

@ -30,6 +30,8 @@
const loadId = Math.round(Math.random() * 10000000000000000);
BDFDB.InternalData.loadId = loadId;
const isGuildFolderThere = false; //REMOVE
if (typeof Array.prototype.flat != "function") Array.prototype.flat = function () {return this;}
InternalBDFDB.defaults = {
@ -873,9 +875,6 @@
}
return itemLayer;
};
BDFDB.TooltipUtils.update = function (tooltip) {
tooltip.update();
};
BDFDB.ObjectUtils = {};
BDFDB.ObjectUtils.is = function (obj) {
@ -1084,6 +1083,8 @@
return InternalBDFDB.getWebModuleReq.req;
};
isGuildFolderThere = !!BDFDB.ModuleUtils.findByName("GuildFolder"); //REMOVE
var WebModulesData = {};
WebModulesData.PatchTypes = ["before", "instead", "after"];
WebModulesData.PatchMap = {
@ -1116,7 +1117,7 @@
"UserInfo"
];
WebModulesData.MemoComponent = [
"GuildFolder",
!isGuildFolderThere && "GuildFolder", //REMOVE
"MessageContent",
"NowPlayingHeader"
];
@ -1133,7 +1134,7 @@
V2C_ContentColumn: ins => ins && ins.return && ins.return.stateNode && ins.return.stateNode.props && typeof ins.return.stateNode.props.title == "string" && (ins.return.stateNode.props.title.toUpperCase().indexOf("PLUGINS") == 0 || ins.return.stateNode.props.title.toUpperCase().indexOf("THEMES") == 0) && ins.return.type,
V2C_PluginCard: ins => ins && ins.return && ins.return.stateNode && ins.return.stateNode.props && ins.return.stateNode.props.addon && ins.return.stateNode.props.addon.plugin && ins.return.type,
V2C_ThemeCard: ins => ins && ins.return && ins.return.stateNode && ins.return.stateNode.props && ins.return.stateNode.props.addon && ins.return.stateNode.props.addon.css && ins.return.type,
GuildFolder: ins => ins && ins.return && ins.return.memoizedProps && ins.return.memoizedProps.folderId && ins.return.memoizedProps.guildIds && ins.return.type
GuildFolder: isGuildFolderThere ? null :ins => ins && ins.return && ins.return.memoizedProps && ins.return.memoizedProps.folderId && ins.return.memoizedProps.guildIds && ins.return.type //REMOVE
};
WebModulesData.PatchFinder = {
Account: "accountinfo",
@ -1149,7 +1150,7 @@
DirectMessage: "guildouter",
EmojiPicker: "emojipicker",
Guild: "guildouter",
GuildFolder: "guildfolderwrapper",
GuildFolder: isGuildFolderThere ? null :"guildfolderwrapper", //REMOVE
GuildIcon: "avataricon",
Guilds: "guildswrapper",
GuildSettingsBans: "guildsettingsbannedcard",
@ -1388,6 +1389,7 @@
if (!BDFDB.ObjectUtils.is(plugin) || !BDFDB.ObjectUtils.is(plugin.patchedModules)) return;
BDFDB.ModuleUtils.unpatch(plugin);
for (let patchType in plugin.patchedModules) for (let type in plugin.patchedModules[patchType]) {
if (isGuildFolderThere && type == "GuildFolder") plugin.patchedModules[patchType][type] = "render"; //REMOVE
let unmappedType = type.split(" _ _ ")[1] || type;
let component = WebModulesData.LoadedInComponents[type] && BDFDB.ReactUtils.getValue(InternalComponents, WebModulesData.LoadedInComponents[type]);
if (component) patchInstance(WebModulesData.NonRender.includes(unmappedType) ? (BDFDB.ModuleUtils.find(m => m == component, false) || {}).exports : component, type, patchType);

File diff suppressed because one or more lines are too long

View File

@ -69,7 +69,7 @@ var PluginRepo = (_ => {
return class PluginRepo {
getName () {return "PluginRepo";}
getVersion () {return "1.9.5";}
getVersion () {return "1.9.6";}
getAuthor () {return "DevilBro";}
@ -689,8 +689,19 @@ var PluginRepo = (_ => {
extractConfigInfo(plugin, JSON.parse('{"info":' + bodyWithoutSpecial.substring(configreg.index).split(configreg[0])[1].split("};")[0].split("}},")[0] + '}'));
}
catch (err) {
try {extractConfigInfo(plugin, JSON.parse(('{"info":' + bodyWithoutSpecial.substring(configreg.index).split(configreg[0])[1].split("};")[0].split("}},")[0] + '}').replace(/,/g, ',"').replace(/:/g, '":').replace(/{/g, '{"').replace(/""/g, '"').replace(/" /g, ' ').replace(/,"{/g, ',{').replace(/,"\[/g, ',[').replace(/":\/\//g, ':\/\/')));}
catch (err2) {}
try {
let i = 0, j = 0, configString = "";
for (let c of (bodyWithoutSpecial.substring(configreg.index).split(configreg[0])[1].split("};")[0].split("}},")[0]).replace(/,/g, ',"').replace(/:/g, '":').replace(/{/g, '{"').replace(/""/g, '"').replace(/" /g, ' ').replace(/,"{/g, ',{').replace(/,"\[/g, ',[').replace(/":\/\//g, ':\/\/')) {
configString += c;
if (c == "{") i++;
else if (c == "}") j++;
if (i > 0 && i == j) break;
}
extractConfigInfo(plugin, JSON.parse('{"info":' + configString + '}'));
}
catch (err2) {
console.log(err2);
}
}
}
else {

View File

@ -125,7 +125,7 @@ var ThemeRepo = (_ => {
return class ThemeRepo {
getName () {return "ThemeRepo";}
getVersion () {return "1.9.5";}
getVersion () {return "1.9.6";}
getAuthor () {return "DevilBro";}