stuff
This commit is contained in:
parent
92b04fb3f2
commit
214edf7b8a
|
@ -1022,6 +1022,10 @@
|
|||
WebModulesData.Nonprototype = [
|
||||
"ChannelTextAreaContainer"
|
||||
];
|
||||
WebModulesData.LoadedInComponents = {
|
||||
AutocompleteChannelResult: "AutocompleteComponents.Channel",
|
||||
AutocompleteUserResult: "AutocompleteComponents.User"
|
||||
};
|
||||
WebModulesData.Patchfinder = {
|
||||
Account: "accountinfo",
|
||||
App: "app",
|
||||
|
@ -1048,6 +1052,7 @@
|
|||
QuickSwitchGuildResult: "quickswitchresult",
|
||||
QuickSwitchResult: "quickswitchresult",
|
||||
MemberCard: "guildsettingsmembercard",
|
||||
MessagesPopout: "messagespopout",
|
||||
MutualGuilds: "userprofilebody",
|
||||
MutualFriends: "userprofilebody",
|
||||
NameTag: "nametag",
|
||||
|
@ -1254,6 +1259,9 @@
|
|||
BDFDB.ModuleUtils.unpatch(plugin);
|
||||
for (let patchtype in plugin.patchedModules) for (let type in plugin.patchedModules[patchtype]) {
|
||||
if (WebModulesData.GlobalModules[type] && typeof WebModulesData.GlobalModules[type] == "function") patchInstance(WebModulesData.GlobalModules[type], type, patchtype);
|
||||
else {
|
||||
let component = WebModulesData.LoadedInComponents[type] && BDFDB.ReactUtils.getValue(LibraryComponents, WebModulesData.LoadedInComponents[type]);
|
||||
if (component) patchInstance(component, type, patchtype);
|
||||
else {
|
||||
let mapped = WebModulesData.Patchmap[type];
|
||||
let classname = WebModulesData.Patchfinder[type.split(" _ _ ")[1] || type];
|
||||
|
@ -1266,11 +1274,12 @@
|
|||
else if (DiscordClasses[classname]) checkForInstance(classname, mappedtype, patchtype, WebModulesData.Forceobserve.includes(type.split(" _ _ ")[1] || type));
|
||||
}
|
||||
}
|
||||
}
|
||||
function patchInstance(instance, type, patchtype) {
|
||||
if (instance) {
|
||||
let name = type.split(" _ _ ")[0];
|
||||
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
|
||||
instance = instance.displayName == name || instance.name == name ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up:true}));
|
||||
instance = instance.displayName == name || instance.name == name || WebModulesData.LoadedInComponents[type] ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up:true}));
|
||||
if (instance) {
|
||||
instance = instance._reactInternalFiber && instance._reactInternalFiber.type ? instance._reactInternalFiber.type : instance;
|
||||
let patchfunctions = {};
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue