Revert "stuff"

This reverts commit 86e7a1d4b9.
This commit is contained in:
Mirco Wittrien 2021-03-03 11:20:00 +01:00
parent 4a3071103c
commit e37067e9f1
7 changed files with 68 additions and 27 deletions

View File

@ -16,10 +16,15 @@ module.exports = (_ => {
"info": {
"name": "BDFDB",
"author": "DevilBro",
"version": "1.4.1",
"version": "1.4.0",
"description": "Give other plugins utility functions"
},
"rawUrl": "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js"
"rawUrl": "https://mwittrien.github.io/BetterDiscordAddons/Library/0BDFDB.plugin.js",
"changeLog": {
"progress": {
"New Meta Headers": "Adjusted Update Check for new Plugin Meta Headers"
}
}
};
const DiscordObjects = {};
@ -1839,12 +1844,15 @@ module.exports = (_ => {
stringFind: InternalData.ModuleUtilsConfig.Finder[unmappedType] && InternalData.ModuleUtilsConfig.Finder[unmappedType].strings,
propertyFind: InternalData.ModuleUtilsConfig.Finder[unmappedType] && InternalData.ModuleUtilsConfig.Finder[unmappedType].props,
specialFilter: InternalData.ModuleUtilsConfig.Finder[unmappedType] && InternalData.ModuleUtilsConfig.Finder[unmappedType].special && InternalBDFDB.createFilter(InternalData.ModuleUtilsConfig.Finder[unmappedType].special),
memoComponent: InternalData.ModuleUtilsConfig.MemoComponent.includes(unmappedType),
subRender: InternalData.ModuleUtilsConfig.SubRender.includes(unmappedType),
forceObserve: InternalData.ModuleUtilsConfig.ForceObserve.includes(unmappedType),
nonRender: BDFDB.ObjectUtils.toArray(pluginData.patchTypes).flat(10).filter(n => n && !InternalData.ModuleUtilsConfig.InstanceFunctions.includes(n)).length > 0,
exported: InternalData.ModuleUtilsConfig.Finder[unmappedType] && InternalData.ModuleUtilsConfig.Finder[unmappedType].exported || false,
mapped: InternalData.ModuleUtilsConfig.PatchMap[type]
};
config.nonRender = config.specialFilter || BDFDB.ObjectUtils.toArray(pluginData.patchTypes).flat(10).filter(n => n && !InternalData.ModuleUtilsConfig.InstanceFunctions.includes(n)).length > 0;
config.nonPrototype = !!(config.codeFind || config.propertyFind || config.nonRender);
config.ignoreCheck = !!(config.codeFind || config.propertyFind || config.specialFilter || config.nonRender || config.memoComponent);
config.nonPrototype = InternalData.ModuleUtilsConfig.NonPrototype.includes(unmappedType) || !!(config.codeFind || config.propertyFind || config.nonRender);
let component = InternalData.ModuleUtilsConfig.LoadedInComponents[type] && BDFDB.ObjectUtils.get(InternalComponents, InternalData.ModuleUtilsConfig.LoadedInComponents[type]);
if (component) InternalBDFDB.patchComponent(pluginData, config.nonRender ? (BDFDB.ModuleUtils.find(m => m == component, config.exported) || {}).exports : component, type, config);
@ -1861,7 +1869,7 @@ module.exports = (_ => {
let patchSpecial = (func, argument) => {
let module = BDFDB.ModuleUtils[func](argument, config.exported);
let exports = module && !config.exported && module.exports || module;
exports && InternalBDFDB.patchComponent(pluginData, InternalBDFDB.isMemo(exports) ? exports.default : exports, mappedType, config);
exports && InternalBDFDB.patchComponent(pluginData, config.memoComponent ? exports.default : exports, mappedType, config);
};
if (config.classNames.length) InternalBDFDB.checkForInstance(pluginData, mappedType, config);
else if (config.stringFind) patchSpecial("findByString", config.stringFind);
@ -1876,11 +1884,11 @@ module.exports = (_ => {
if (pluginDataObjs.length && instance) {
let name = type.split(" _ _ ")[0];
instance = instance[BDFDB.ReactUtils.instanceKey] && instance[BDFDB.ReactUtils.instanceKey].type ? instance[BDFDB.ReactUtils.instanceKey].type : instance;
instance = config.nonPrototype || BDFDB.ReactUtils.isCorrectInstance(instance, name) || InternalData.ModuleUtilsConfig.LoadedInComponents[type] ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up: true}));
instance = config.ignoreCheck || BDFDB.ReactUtils.isCorrectInstance(instance, name) || InternalData.ModuleUtilsConfig.LoadedInComponents[type] ? instance : (BDFDB.ReactUtils.findConstructor(instance, name) || BDFDB.ReactUtils.findConstructor(instance, name, {up: true}));
if (instance) {
instance = instance[BDFDB.ReactUtils.instanceKey] && instance[BDFDB.ReactUtils.instanceKey].type ? instance[BDFDB.ReactUtils.instanceKey].type : instance;
let toBePatched = config.nonPrototype || !instance.prototype ? instance : instance.prototype;
toBePatched = toBePatched && toBePatched.type && typeof toBePatched.type.render == "function" ? toBePatched.type : toBePatched;
let toBePatched = config.nonPrototype ? instance : instance.prototype;
toBePatched = config.subRender && toBePatched ? toBePatched.type : toBePatched;
for (let pluginData of pluginDataObjs) for (let patchType in pluginData.patchTypes) {
let patchMethods = {};
patchMethods[patchType] = e => {
@ -1891,7 +1899,7 @@ module.exports = (_ => {
patchtypes: [patchType]
});
};
BDFDB.PatchUtils.patch(pluginData.plugin, toBePatched, pluginData.patchTypes[patchType], patchMethods);
BDFDB.PatchUtils.patch(pluginData.plugin, toBePatched, config.subRender ? "render" : pluginData.patchTypes[patchType], patchMethods);
}
}
}
@ -1902,9 +1910,6 @@ module.exports = (_ => {
return value && (!prop.value || [prop.value].flat(10).filter(n => typeof n == "string").some(n => value.toUpperCase().indexOf(n.toUpperCase()) == 0));
}) && ins.return.type;
};
InternalBDFDB.isMemo = function (exports) {
return exports && exports.default && typeof exports.default.$$typeof == "symbol" && (exports.default.$$typeof.toString() || "").indexOf("memo") > -1
};
InternalBDFDB.checkEle = function (pluginDataObjs, ele, type, config) {
pluginDataObjs = [pluginDataObjs].flat(10).filter(n => n);
let unmappedType = type.split(" _ _ ")[1] || type;
@ -1914,7 +1919,7 @@ module.exports = (_ => {
if (component) {
if (config.nonRender) {
let exports = (BDFDB.ModuleUtils.find(m => m == component, false) || {}).exports;
InternalBDFDB.patchComponent(pluginDataObjs, InternalBDFDB.isMemo(exports) ? exports.default : exports, type, config);
InternalBDFDB.patchComponent(pluginDataObjs, exports && config.memoComponent ? exports.default : exports, type, config);
}
else InternalBDFDB.patchComponent(pluginDataObjs, component, type, config);
BDFDB.PatchUtils.forceAllUpdates(pluginDataObjs.map(n => n.plugin), type);
@ -7334,7 +7339,7 @@ module.exports = (_ => {
InternalBDFDB.patchedModules = {
after: {
DiscordTag: "default",
Message: "type",
Message: "default",
MessageHeader: "default",
MemberListItem: ["componentDidMount", "componentDidUpdate"],
PrivateChannel: ["componentDidMount", "componentDidUpdate"],
@ -7361,7 +7366,7 @@ module.exports = (_ => {
if (MessageHeaderExport && BDFDB.ObjectUtils.get(e, "instance.props.childrenHeader.type.type.name") && BDFDB.ObjectUtils.get(e, "instance.props.childrenHeader.props.message")) {
e.instance.props.childrenHeader.type = MessageHeaderExport.exports.default;
}
if (BDFDB.ObjectUtils.get(e, "returnvalue.props.children.props")) {
if (e.returnvalue && e.returnvalue.props && e.returnvalue.props.children && e.returnvalue.props.children.props) {
let message;
for (let key in e.instance.props) {
if (!message) message = BDFDB.ObjectUtils.get(e.instance.props[key], "props.message");

View File

@ -14,8 +14,19 @@ module.exports = (_ => {
"info": {
"name": "ChatFilter",
"author": "DevilBro",
"version": "3.5.2",
"version": "3.5.1",
"description": "Allows the user to censor Words or block complete Messages/Statuses"
},
"changeLog": {
"added": {
"Ignore own Messages/Status": "Added option to ignore your own Messages/Status"
},
"improved": {
"Zero Width Spaces": "Ignores any zero width space, since some ppl like to troll with it"
},
"fixed": {
"Settings Update": "Fixed issue where the settings panel wouldn't show new words without having to close it first"
}
}
};
@ -84,7 +95,7 @@ module.exports = (_ => {
this.patchedModules = {
before: {
Message: "type",
Message: "default",
MessageContent: "type",
UserPopout: "render",
UserProfile: "render",

View File

@ -14,8 +14,13 @@ module.exports = (_ => {
"info": {
"name": "CompleteTimestamps",
"author": "DevilBro",
"version": "1.5.3",
"version": "1.5.2",
"description": "Replace all timestamps with complete timestamps"
},
"changeLog": {
"fixed": {
"Mini Stamp Tooltip": "Fixes the issue where tooltips for mini time stamps wouldn't show, smh this is discord's own fault for their shitty css"
}
}
};
@ -89,7 +94,7 @@ module.exports = (_ => {
this.patchedModules = {
after: {
Message: "type",
Message: "default",
MessageHeader: "default",
MessageContent: "type",
Embed: "render",

View File

@ -14,8 +14,13 @@ module.exports = (_ => {
"info": {
"name": "DisplayServersAsChannels",
"author": "DevilBro",
"version": "1.4.7",
"version": "1.4.6",
"description": "Display servers in a similar way as channels"
},
"changeLog": {
"fixed": {
"Works again": "Can discord stop messing with the server list, jeez"
}
}
};
@ -79,7 +84,7 @@ module.exports = (_ => {
DefaultHomeButton: "render",
DirectMessage: "render",
Guild: "render",
GuildFolder: "render",
GuildFolder: "type",
CircleIconButton: "render",
UnavailableGuildsButton: "UnavailableGuildsButton"
}

View File

@ -14,8 +14,13 @@ module.exports = (_ => {
"info": {
"name": "EditUsers",
"author": "DevilBro",
"version": "4.1.7",
"version": "4.1.6",
"description": "Allow you to change the icon, name, tag and color of users"
},
"changeLog": {
"fixed": {
"Mentions": ""
}
}
};
@ -107,7 +112,7 @@ module.exports = (_ => {
NowPlayingHeader: "Header",
VoiceUser: "render",
Account: "render",
Message: "type",
Message: "default",
MessageUsername: "default",
MessageContent: "type",
ReactorsComponent: "render",

View File

@ -14,8 +14,13 @@ module.exports = (_ => {
"info": {
"name": "RemoveBlockedMessages",
"author": "DevilBro",
"version": "1.2.5",
"version": "1.2.4",
"description": "Removes blocked messages/users completely"
},
"changeLog": {
"fixed": {
"Mentions": ""
}
}
};
@ -81,7 +86,7 @@ module.exports = (_ => {
this.patchedModules = {
before: {
Message: "type",
Message: "default",
ReactorsComponent: "render",
ChannelMembers: "render",
PrivateChannelRecipients: "default",

View File

@ -14,8 +14,13 @@ module.exports = (_ => {
"info": {
"name": "ServerFolders",
"author": "DevilBro",
"version": "6.8.9",
"version": "6.8.8",
"description": "Patch Discords native Folders in a way to open Servers within a Folder in a new bar to the right, also adds a bunch of new features to more easily organize, customize and manage your Folders"
},
"changeLog": {
"improved": {
"Canary Changes": "Preparing Plugins for the changes that are already done on Discord Canary"
}
}
};
@ -399,7 +404,7 @@ module.exports = (_ => {
this.patchedModules = {
after: {
AppView: "default",
GuildFolder: "render",
GuildFolder: "type",
Guilds: "render",
Guild: ["componentDidMount", "render"],
GuildFolderSettingsModal: ["componentDidMount", "render"]