This commit is contained in:
Mirco Wittrien 2020-06-16 17:07:08 +02:00
parent 0be46932fc
commit 647ff2203e
33 changed files with 176 additions and 178 deletions

View File

@ -1821,69 +1821,6 @@
return key != null && props[key] != null && value != null && (key == "className" ? (" " + props[key] + " ").indexOf(" " + value + " ") > -1 : BDFDB.equals(props[key], value));
}
};
BDFDB.ReactUtils.findChildren = function (nodeOrInstance, config) {
if (!nodeOrInstance || !BDFDB.ObjectUtils.is(config) || !config.name && !config.key && !config.props && !config.filter) return [null, -1];
let instance = Node.prototype.isPrototypeOf(nodeOrInstance) ? BDFDB.ReactUtils.getInstance(nodeOrInstance) : nodeOrInstance;
if (!BDFDB.ObjectUtils.is(instance) && !BDFDB.ArrayUtils.is(instance)) return [null, -1];
config.name = config.name && [config.name].flat().filter(n => n);
config.key = config.key && [config.key].flat().filter(n => n);
config.props = config.props && [config.props].flat().filter(n => n);
config.filter = typeof config.filter == "function" && config.filter;
let parent = firstArray = instance;
while (!BDFDB.ArrayUtils.is(firstArray) && firstArray.props && firstArray.props.children) firstArray = firstArray.props.children;
if (!BDFDB.ArrayUtils.is(firstArray)) {
if (parent && parent.props) {
parent.props.children = [parent.props.children];
firstArray = parent.props.children;
}
else firstArray = [];
}
return getChildren(instance);
function getChildren (children) {
let result = [firstArray, -1];
if (!children) return result;
if (!BDFDB.ArrayUtils.is(children)) {
if (check(children)) result = found(children);
else if (children.props && children.props.children) {
parent = children;
result = getChildren(children.props.children);
}
}
else {
for (let i = 0; result[1] == -1 && i < children.length; i++) if (children[i]) {
if (BDFDB.ArrayUtils.is(children[i])) {
parent = children;
result = getChildren(children[i]);
}
else if (check(children[i])) {
parent = children;
result = found(children[i]);
}
else if (children[i].props && children[i].props.children) {
parent = children[i];
result = getChildren(children[i].props.children);
}
}
}
return result;
}
function found (child) {
if (BDFDB.ArrayUtils.is(parent)) return [parent, parent.indexOf(child)];
else {
parent.props.children = [];
parent.props.children.push(child);
return [parent.props.children, 0];
}
}
function check (instance) {
if (!instance) return false;
let props = instance.stateNode ? instance.stateNode.props : instance.props;
return instance.type && config.name && config.name.some(name => InternalBDFDB.isInstanceCorrect(instance, name)) || config.key && config.key.some(key => instance.key == key) || props && config.props && config.props[config.someProps ? "some" : "every"](prop => BDFDB.ArrayUtils.is(prop) ? (BDFDB.ArrayUtils.is(prop[1]) ? prop[1].some(checkvalue => propCheck(props, prop[0], checkvalue)) : propCheck(props, prop[0], prop[1])) : props[prop] !== undefined) || config.filter && config.filter(instance);
}
function propCheck (props, key, value) {
return key != null && props[key] != null && value != null && (key == "className" ? (" " + props[key] + " ").indexOf(" " + value + " ") > -1 : BDFDB.equals(props[key], value));
}
};
BDFDB.ReactUtils.setChild = function (parent, stringOrChild) {
if (!BDFDB.ReactUtils.isValidElement(parent) || (!BDFDB.ReactUtils.isValidElement(stringOrChild) && typeof stringOrChild != "string" && !BDFDB.ArrayUtils.is(stringOrChild))) return;
let set = false;
@ -2035,6 +1972,69 @@
return result;
}
};
BDFDB.ReactUtils.findParent = function (nodeOrInstance, config) {
if (!nodeOrInstance || !BDFDB.ObjectUtils.is(config) || !config.name && !config.key && !config.props && !config.filter) return [null, -1];
let instance = Node.prototype.isPrototypeOf(nodeOrInstance) ? BDFDB.ReactUtils.getInstance(nodeOrInstance) : nodeOrInstance;
if (!BDFDB.ObjectUtils.is(instance) && !BDFDB.ArrayUtils.is(instance)) return [null, -1];
config.name = config.name && [config.name].flat().filter(n => n);
config.key = config.key && [config.key].flat().filter(n => n);
config.props = config.props && [config.props].flat().filter(n => n);
config.filter = typeof config.filter == "function" && config.filter;
let parent = firstArray = instance;
while (!BDFDB.ArrayUtils.is(firstArray) && firstArray.props && firstArray.props.children) firstArray = firstArray.props.children;
if (!BDFDB.ArrayUtils.is(firstArray)) {
if (parent && parent.props) {
parent.props.children = [parent.props.children];
firstArray = parent.props.children;
}
else firstArray = [];
}
return getParent(instance);
function getParent (children) {
let result = [firstArray, -1];
if (!children) return result;
if (!BDFDB.ArrayUtils.is(children)) {
if (check(children)) result = found(children);
else if (children.props && children.props.children) {
parent = children;
result = getParent(children.props.children);
}
}
else {
for (let i = 0; result[1] == -1 && i < children.length; i++) if (children[i]) {
if (BDFDB.ArrayUtils.is(children[i])) {
parent = children;
result = getParent(children[i]);
}
else if (check(children[i])) {
parent = children;
result = found(children[i]);
}
else if (children[i].props && children[i].props.children) {
parent = children[i];
result = getParent(children[i].props.children);
}
}
}
return result;
}
function found (child) {
if (BDFDB.ArrayUtils.is(parent)) return [parent, parent.indexOf(child)];
else {
parent.props.children = [];
parent.props.children.push(child);
return [parent.props.children, 0];
}
}
function check (instance) {
if (!instance) return false;
let props = instance.stateNode ? instance.stateNode.props : instance.props;
return instance.type && config.name && config.name.some(name => InternalBDFDB.isInstanceCorrect(instance, name)) || config.key && config.key.some(key => instance.key == key) || props && config.props && config.props[config.someProps ? "some" : "every"](prop => BDFDB.ArrayUtils.is(prop) ? (BDFDB.ArrayUtils.is(prop[1]) ? prop[1].some(checkvalue => propCheck(props, prop[0], checkvalue)) : propCheck(props, prop[0], prop[1])) : props[prop] !== undefined) || config.filter && config.filter(instance);
}
function propCheck (props, key, value) {
return key != null && props[key] != null && value != null && (key == "className" ? (" " + props[key] + " ").indexOf(" " + value + " ") > -1 : BDFDB.equals(props[key], value));
}
};
BDFDB.ReactUtils.findProps = function (nodeOrInstance, config) {
if (!BDFDB.ObjectUtils.is(config)) return null;
if (!nodeOrInstance || !config.name && !config.key) return null;
@ -2220,7 +2220,7 @@
let MessagesPrototype = BDFDB.ReactUtils.getValue(MessagesIns, "_reactInternalFiber.type.prototype");
if (MessagesIns && MessagesPrototype) {
BDFDB.ModuleUtils.patch(BDFDB, MessagesPrototype, "render", {after: e => {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnValue, {props: ["message", "channel"]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnValue, {props: ["message", "channel"]});
if (index > -1) for (let ele of children) if (ele.props.message) ele.props.message = new BDFDB.DiscordObjects.Message(ele.props.message);
}}, {once: true});
BDFDB.ReactUtils.forceUpdate(MessagesIns);
@ -2390,7 +2390,7 @@
let GuildsPrototype = BDFDB.ReactUtils.getValue(GuildsIns, "_reactInternalFiber.type.prototype");
if (GuildsIns && GuildsPrototype) {
BDFDB.ModuleUtils.patch(BDFDB, GuildsPrototype, "render", {after: e => {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnValue, {name: "ConnectedUnreadDMs"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnValue, {name: "ConnectedUnreadDMs"});
if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement("div", {}));
BDFDB.ReactUtils.forceUpdate(GuildsIns);
}}, {once: true});
@ -9363,7 +9363,7 @@
InternalBDFDB.processV2CContentColumn = function (e) {
if (window.PluginUpdates && window.PluginUpdates.plugins && typeof e.instance.props.title == "string" && e.instance.props.title.toUpperCase().indexOf("PLUGINS") == 0) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {key: "folder-button"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {key: "folder-button"});
if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TooltipContainer, {
text: "Only checks for updates of plugins, which support the updatecheck. Rightclick for a list of supported plugins. (Listed ≠ Outdated)",
tooltipConfig: {
@ -9494,7 +9494,7 @@
for (let type of newBadges) if (!e.thisObject.state[`${type}Mask`]) e.thisObject.state[`${type}Mask`] = new InternalComponents.LibraryComponents.Animations.Controller({spring: 0});
},
after: e => {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnValue, {name: "TransitionGroup"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnValue, {name: "TransitionGroup"});
if (index > -1) {
children[index].props.children.push(!e.thisObject.props.lowerLeftBadge ? null : BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.BadgeAnimationContainer, {
className: BDFDB.disCN.guildlowerleftbadge,
@ -9509,7 +9509,7 @@
children: e.thisObject.props.upperLeftBadge
}));
}
[children, index] = BDFDB.ReactUtils.findChildren(e.returnValue, {name: "mask"});
[children, index] = BDFDB.ReactUtils.findParent(e.returnValue, {name: "mask"});
if (index > -1) {
children[index].props.children.push(BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Animations.animated.rect, {
x: -4,
@ -9663,6 +9663,8 @@
BDFDB.ModuleUtils.forceAllUpdates(BDFDB);
InternalBDFDB.addContextListeners(BDFDB);
BDFDB.ReactUtils.findParent = BDFDB.ReactUtils.findChildren;
if (BDFDB.UserUtils.me.id == myId) {
for (let module in DiscordClassModules) if (!DiscordClassModules[module]) BDFDB.LogUtils.warn(module + " not initialized in DiscordClassModules");
@ -9818,8 +9820,4 @@
InternalBDFDB.reloadLib();
}
}, 10000);
let seenWelcomeModal = BDFDB.DataUtils.load(BDFDB, "welcomeScreen", "seen"), inMyGuild = !!BDFDB.LibraryModules.GuildStore.getGuild(myGuildId);
if (seenWelcomeModal === null) BDFDB.DataUtils.save(inMyGuild, BDFDB, "welcomeScreen", "seen");
else if (!inMyGuild && seenWelcomeModal === true) BDFDB.DataUtils.save(false, BDFDB, "welcomeScreen", "seen");
})();

File diff suppressed because one or more lines are too long

View File

@ -341,14 +341,14 @@ var BadgesEverywhere = (_ => {
processMessageHeader (e) {
if (e.instance.props.message && settings.showInChat) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue.props.children.slice(1), {name: "Popout", props: [["className", BDFDB.disCN.messageusername]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue.props.children.slice(1), {name: "Popout", props: [["className", BDFDB.disCN.messageusername]]});
if (index > -1) this.injectBadges(e.instance, children, e.instance.props.message.author, "chat");
}
}
processUserPopout (e) {
if (e.instance.props.user && settings.showInPopout) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "CustomStatus"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "CustomStatus"});
if (index > -1) this.injectBadges(e.instance, children, e.instance.props.user, "popout", e.instance.props.activity && e.instance.props.activity.type != BDFDB.DiscordConstants.ActivityTypes.CUSTOM_STATUS);
}
}

View File

@ -72,9 +72,9 @@ var BetterNsfwTag = (_ => {
processChannelItem (e) {
if (e.instance.props.channel && e.instance.props.channel.nsfw) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]});
if (index > -1 && children[index].props && children[index].props.children) {
let [oldTagParent, oldTagIndex] = BDFDB.ReactUtils.findChildren(children[index], {key: "NSFW-badge"});
let [oldTagParent, oldTagIndex] = BDFDB.ReactUtils.findParent(children[index], {key: "NSFW-badge"});
if (oldTagIndex > -1) oldTagParent.splice(oldTagIndex, 1);
children[index].props.children.push(BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS._betternsfwtagtag + BDFDB.disCN.channelchildiconbase,

View File

@ -103,7 +103,7 @@ var BetterSearchPage = (_ => {
processSearchResultsInner (e) {
if (e.instance.props.search) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"SearchPagination"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name:"SearchPagination"});
if (index > -1) {
let currentpage = parseInt(Math.floor(e.instance.props.search.offset / BDFDB.DiscordConstants.SEARCH_PAGE_SIZE)) + 1;
let maxpage = e.instance.props.search.totalResults > 5000 ? parseInt(Math.ceil(5000 / BDFDB.DiscordConstants.SEARCH_PAGE_SIZE)) : parseInt(Math.ceil(e.instance.props.search.totalResults / BDFDB.DiscordConstants.SEARCH_PAGE_SIZE));

View File

@ -121,7 +121,7 @@ var CharCounter = (_ => {
// Begin of own functions
processChannelTextAreaContainer (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "ChannelEditorContainer"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ChannelEditorContainer"});
if (index > -1 && children[index].props.type && maxLenghts[children[index].props.type] && !children[index].props.disabled) {
if (!BDFDB.ArrayUtils.is(e.returnvalue.props.children)) e.returnvalue.props.children = [e.returnvalue.props.children];
this.injectCounter(e.returnvalue, e.returnvalue.props.children, children[index].props.type, BDFDB.dotCN.textarea, true);
@ -129,14 +129,14 @@ var CharCounter = (_ => {
}
processNote (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: ["TextAreaAutosize", "TextArea", "PlainTextArea"]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["TextAreaAutosize", "TextArea", "PlainTextArea"]});
if (index > -1) this.injectCounter(e.returnvalue, children, e.instance.props.className && e.instance.props.className.indexOf(BDFDB.disCN.usernotepopout) > -1 ? "popout" : "profile", "textarea");
}
processChangeNickname (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "FormItem"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FormItem"});
if (index > -1) {
let [children2, index2] = BDFDB.ReactUtils.findChildren(children[index], {name: "TextInput"});
let [children2, index2] = BDFDB.ReactUtils.findParent(children[index], {name: "TextInput"});
if (index2 > -1) this.injectCounter(children[index], children2, "nickname", BDFDB.dotCN.input);
}
}

View File

@ -266,7 +266,7 @@ var ChatFilter = (_ => {
}
processMessages (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: ["message", "channel"]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: ["message", "channel"]});
if (index > -1) for (let ele of children) if (ele && ele.props && ele.props.message) {
let {blocked, censored, content} = this.parseContent(ele.props.message.content);
let oldContent = ele.props.message.content;

View File

@ -243,13 +243,13 @@ var CompleteTimestamps = (_ => {
processMessage (e) {
if (BDFDB.ReactUtils.getValue(e, "instance.props.childrenHeader.type.type.displayName") == "MessageTimestamp" && settings.changeForChat) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: e.instance.props.childrenHeader.type});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: e.instance.props.childrenHeader.type});
if (index > -1) this.changeTimestamp(children, index, {child:false, tooltip:true});
}
}
processMessageHeader (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "MessageTimestamp"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "MessageTimestamp"});
if (index > -1) {
this.changeTimestamp(children, index, {child:settings.showInChat, tooltip:settings.changeForChat});
this.setMaxWidth(children[index], e.instance.props.compact);
@ -258,21 +258,21 @@ var CompleteTimestamps = (_ => {
processMessageContent (e) {
if (e.instance.props.message.editedTimestamp && settings.changeForEdit) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "SuffixEdited"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "SuffixEdited"});
if (index > -1) this.changeTimestamp(children, index, {child:false, tooltip:true});
}
}
processEmbed (e) {
if (e.instance.props.embed.timestamp && settings.showInEmbed) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.embedfootertext]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.embedfootertext]]});
if (index > -1 && BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children.splice(children[index].props.children.length - 1, 1, this.getTimestamp(languages[choices.creationDateLang].id, e.instance.props.embed.timestamp._i));
}
}
processSystemMessage (e) {
if (settings.showInChat) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "time"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "time"});
if (index > -1) children[index].props.children = this.getTimestamp(languages[choices.creationDateLang].id, e.instance.props.timestamp._i);
}
}
@ -283,7 +283,7 @@ var CompleteTimestamps = (_ => {
let stamp = type(parent[index].props), tooltipWrapper;
if (stamp.type.displayName == "Tooltip") tooltipWrapper = stamp;
else {
let [children, tooltipIndex] = BDFDB.ReactUtils.findChildren(stamp, {name: "Tooltip"});
let [children, tooltipIndex] = BDFDB.ReactUtils.findParent(stamp, {name: "Tooltip"});
if (tooltipIndex > -1) tooltipWrapper = children[tooltipIndex];
}
if (tooltipWrapper) {

View File

@ -243,7 +243,7 @@ var CreationDate = (_ => {
processUserPopout (e) {
if (e.instance.props.user && settings.addInUserPopout) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "CustomStatus"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "CustomStatus"});
if (index > -1) this.injectDate(children, 2, e.instance.props.user);
}
}
@ -253,7 +253,7 @@ var CreationDate = (_ => {
let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = (...args) => {
let renderedChildren = renderChildren(...args);
let [children, index] = BDFDB.ReactUtils.findChildren(renderedChildren, {name: ["DiscordTag", "ColoredFluxTag"]});
let [children, index] = BDFDB.ReactUtils.findParent(renderedChildren, {name: ["DiscordTag", "ColoredFluxTag"]});
if (index > -1) this.injectDate(children, 1, children[index].props.user);
return renderedChildren;
};

View File

@ -131,7 +131,7 @@ var DisplayServersAsChannels = (_ => {
}
processGuilds (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "FluxContainer(<Unknown>)"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FluxContainer(<Unknown>)"});
if (index > -1) children[index] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.GuildComponents.Items.UnavailableGuildsButton, {
unavailableGuilds: BDFDB.LibraryModules.GuildUnavailableStore.totalUnavailableGuilds
});
@ -211,12 +211,12 @@ var DisplayServersAsChannels = (_ => {
}
removeTooltip (parent) {
let [children, index] = BDFDB.ReactUtils.findChildren(parent, {name: ["Tooltip", "ListItemTooltip", "GuildTooltip", "BDFDB_TooltipContainer"]});
let [children, index] = BDFDB.ReactUtils.findParent(parent, {name: ["Tooltip", "ListItemTooltip", "GuildTooltip", "BDFDB_TooltipContainer"]});
if (index > -1) children[index] = children[index].props.children;
}
removeMask (parent) {
let [children, index] = BDFDB.ReactUtils.findChildren(parent, {name: "BlobMask"});
let [children, index] = BDFDB.ReactUtils.findParent(parent, {name: "BlobMask"});
if (index > -1) {
let badges = [];
for (let key of Object.keys(children[index].props)) if (key && key.endsWith("Badge") && BDFDB.ReactUtils.isValidElement(children[index].props[key])) badges.push(children[index].props[key]);
@ -229,11 +229,11 @@ var DisplayServersAsChannels = (_ => {
}
addElementName (parent, name, options = {}) {
let [children, index] = BDFDB.ReactUtils.findChildren(parent, {name: ["NavItem", "Clickable"], props:[["className",BDFDB.disCN.guildserrorinner]]});
let [children, index] = BDFDB.ReactUtils.findParent(parent, {name: ["NavItem", "Clickable"], props:[["className",BDFDB.disCN.guildserrorinner]]});
if (index > -1) {
delete children[index].props.icon;
delete children[index].props.name;
let [children2, index2] = BDFDB.ReactUtils.findChildren(children[index].props.children, {name:"FolderIcon", props:[["className",BDFDB.disCN.guildfoldericonwrapper]]});
let [children2, index2] = BDFDB.ReactUtils.findParent(children[index].props.children, {name:"FolderIcon", props:[["className",BDFDB.disCN.guildfoldericonwrapper]]});
if (index2 > -1) children2.splice(index2, 1);
let childEles = [
BDFDB.ReactUtils.createElement("div", {

View File

@ -233,12 +233,12 @@ var EditChannels = (_ => {
if (e.instance.props.category) e.instance.props.category = this.getChannelData(e.instance.props.category.id);
}
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.marginleft4]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.marginleft4]]});
if (index > -1) this.changeChannelColor(children[index], e.instance.props.channel.id);
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.autocompleteicon]]});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.autocompleteicon]]});
if (index > -1) this.changeChannelIconColor(children[index], e.instance.props.channel.id, {alpha: 0.6});
if (e.instance.props.category) {
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.autocompletedescription]]});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.autocompletedescription]]});
if (index > -1) this.changeChannelColor(children[index], e.instance.props.category.id);
}
}
@ -250,7 +250,7 @@ var EditChannels = (_ => {
if (channel && settings.changeInAuditLog) {
if (!e.returnvalue) e.instance.props.log.options.channel = this.getChannelData(channel.id);
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["children", [["#" + channel.name]]]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["children", [["#" + channel.name]]]]});
if (index > -1) this.changeChannelColor(children[index], channel.id);
}
}
@ -267,14 +267,14 @@ var EditChannels = (_ => {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(e.instance.props.channelId);
if (channel && BDFDB.ChannelUtils.isTextChannel(channel) && settings.changeInChannelHeader) {
if (!e.returnvalue) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.instance, {name: "Title"});
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {name: "Title"});
if (index > -1) {
children[index].props.children = this.getChannelData(channel.id).name;
this.changeChannelColor(children[index], channel.id);
}
}
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.instance, {name: "Icon"});
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {name: "Icon"});
if (index > -1) {
let icon = BDFDB.ReactUtils.createElement(children[index].props.icon, {
className: BDFDB.disCN.channelheadericon
@ -294,9 +294,9 @@ var EditChannels = (_ => {
if (!e.returnvalue) e.instance.props.channel = this.getChannelData(e.instance.props.channel.id);
else {
let modify = BDFDB.ObjectUtils.extract(e.instance.props, "muted", "locked", "selected", "unread", "connected");
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.categoryname]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.categoryname]]});
if (index > -1) this.changeChannelColor(children[index], e.instance.props.channel.id, modify);
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.categoryicon]]});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.categoryicon]]});
if (index > -1) this.changeChannelIconColor(children[index], e.instance.props.channel.id, Object.assign({alpha: 0.6}, modify));
}
}
@ -307,9 +307,9 @@ var EditChannels = (_ => {
if (!e.returnvalue) e.instance.props.channel = this.getChannelData(e.instance.props.channel.id);
else {
let modify = BDFDB.ObjectUtils.extract(e.instance.props, "muted", "locked", "selected", "unread", "connected");
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.channelname]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.channelname]]});
if (index > -1) this.changeChannelColor(children[index], e.instance.props.channel.id, modify);
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.channelicon]]});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.channelicon]]});
if (index > -1) this.changeChannelIconColor(children[index], e.instance.props.channel.id, Object.assign({alpha: 0.6}, modify));
}
}
@ -323,12 +323,12 @@ var EditChannels = (_ => {
}
else {
let modify = BDFDB.ObjectUtils.extract(e.instance.props, "focused", "unread", "mentions");
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresultmatch]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresultmatch]]});
if (index > -1) this.changeChannelColor(children[index], e.instance.props.channel.id, modify);
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresulticon]]});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresulticon]]});
if (index > -1) this.changeChannelIconColor(children[index], e.instance.props.channel.id, Object.assign({alpha: 0.6}, modify));
if (e.instance.props.category) {
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresultnote]]});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresultnote]]});
if (index > -1) this.changeChannelColor(children[index], e.instance.props.category.id);
}
}
@ -337,13 +337,13 @@ var EditChannels = (_ => {
processMessagesPopout (e) {
if (settings.changeInRecentMentions) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "VerticalScroller"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "VerticalScroller"});
if (index > -1 && children[index].props.children && BDFDB.ArrayUtils.is(children[index].props.children[0])) for (let i in children[index].props.children[0]) {
let divider = children[index].props.children[0][i];
if (divider && divider.props && divider.props.className == BDFDB.disCN.messagespopoutchannelseparator) {
let channel = BDFDB.ReactUtils.findValue(children[index].props.children[0][parseInt(i)+1], "channel");
if (BDFDB.ChannelUtils.isTextChannel(channel)) {
let [children2, index2] = BDFDB.ReactUtils.findChildren(divider, {props:[["className", BDFDB.disCN.messagespopoutchannelname]]});
let [children2, index2] = BDFDB.ReactUtils.findParent(divider, {props:[["className", BDFDB.disCN.messagespopoutchannelname]]});
if (index2 > -1) {
children2[index2].props.children = "#" + this.getChannelData(channel.id).name;
this.changeChannelColor(children2[index2], channel.id);

View File

@ -198,7 +198,7 @@ var EditServers = (_ => {
if (e.returnvalue) {
let data = changedGuilds[e.instance.props.guild.id];
if (data && (data.color3 || data.color4)) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: ["GuildTooltip", "BDFDB_TooltipContainer"]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["GuildTooltip", "BDFDB_TooltipContainer"]});
if (index > -1) children[index] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
tooltipConfig: {
type: "right",
@ -217,7 +217,7 @@ var EditServers = (_ => {
processBlobMask (e) {
if (settings.changeInGuildList) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "NavItem"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "NavItem"});
if (index > -1 && children[index].props.to && children[index].props.to.pathname) {
let guild = BDFDB.LibraryModules.GuildStore.getGuild((children[index].props.to.pathname.split("/channels/")[1] || "").split("/")[0]);
if (guild) {
@ -239,7 +239,7 @@ var EditServers = (_ => {
let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = (...args) => {
let renderedChildren = renderChildren(...args);
let [children, index] = BDFDB.ReactUtils.findChildren(renderedChildren, {props:[["className", BDFDB.disCN.guildiconacronym]]});
let [children, index] = BDFDB.ReactUtils.findParent(renderedChildren, {props:[["className", BDFDB.disCN.guildiconacronym]]});
if (index > -1) {
let fontGradient = BDFDB.ObjectUtils.is(data.color2);
children[index].props.style = Object.assign({}, children[index].props.style, {
@ -296,13 +296,13 @@ var EditServers = (_ => {
processMessagesPopout (e) {
if (settings.changeInRecentMentions) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "VerticalScroller"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "VerticalScroller"});
if (index > -1 && children[index].props.children && BDFDB.ArrayUtils.is(children[index].props.children[0])) for (let i in children[index].props.children[0]) {
let divider = children[index].props.children[0][i];
if (divider && divider.props && divider.props.className == BDFDB.disCN.messagespopoutchannelseparator) {
let channel = BDFDB.ReactUtils.findValue(children[index].props.children[0][parseInt(i)+1], "channel");
if (BDFDB.ChannelUtils.isTextChannel(channel)) {
let [children2, index2] = BDFDB.ReactUtils.findChildren(divider, {props:[["className", BDFDB.disCN.messagespopoutguildname]]});
let [children2, index2] = BDFDB.ReactUtils.findParent(divider, {props:[["className", BDFDB.disCN.messagespopoutguildname]]});
if (index2 > -1) children2[index2].props.children = this.getGuildData(channel.guild_id).name;
}
}

View File

@ -308,7 +308,7 @@ var EditUsers = (_ => {
if (data && data.name) e.instance.props.nick = data.name;
}
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.marginleft8]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.marginleft8]]});
if (index > -1) this.changeUserColor(children[index], e.instance.props.user.id);
}
}
@ -317,7 +317,7 @@ var EditUsers = (_ => {
processHeaderBarContainer (e) {
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(e.instance.props.channelId);
if (channel && channel.type == BDFDB.DiscordConstants.ChannelTypes.DM && settings.changeInDmHeader) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.instance, {name: "Title"});
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {name: "Title"});
if (index > -1) {
let recipientId = channel.getRecipientId();
children[index].props.children = this.getUserData(recipientId).username;
@ -353,7 +353,7 @@ var EditUsers = (_ => {
break;
}
if (change) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.username]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.username]]});
if (index > -1) this.changeUserColor(children[index], e.instance.props.user.id, {
changeBackground: changeBackground
});
@ -381,7 +381,7 @@ var EditUsers = (_ => {
}
else {
if (data && (data.color1 || data.color2 || data.tag)) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]});
if (index > -1) {
this.changeUserColor(children[index], e.instance.props.user.id, {changeBackground:true});
this.injectBadge(children, e.instance.props.user.id, BDFDB.LibraryModules.LastGuildStore.getGuildId(), 2, {
@ -424,7 +424,7 @@ var EditUsers = (_ => {
if (titleIsName) e.instance.props.title = e.instance.props.priorityUser.user.username;
}
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "Header"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "Header"});
if (index > -1) this.changeUserColor(children[index], e.instance.props.priorityUser.user.id);
}
}
@ -438,7 +438,7 @@ var EditUsers = (_ => {
if (data && data.name) e.instance.props.nick = data.name;
}
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.voicename]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.voicename]]});
if (index > -1) this.changeUserColor(children[index], e.instance.props.user.id, {modify: e.instance.props});
}
}
@ -453,12 +453,12 @@ var EditUsers = (_ => {
}
else {
if (data && (data.color1 || data.color2)) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "Tooltip"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "Tooltip"});
if (index > -1 && typeof children[index].props.children == "function") {
let renderChildren = children[index].props.children;
children[index].props.children = (...args) => {
let renderedChildren = renderChildren(...args);
let [children2, index2] = BDFDB.ReactUtils.findChildren(renderedChildren, {name: "PanelTitle"});
let [children2, index2] = BDFDB.ReactUtils.findParent(renderedChildren, {name: "PanelTitle"});
if (index2 > -1) this.changeUserColor(children2[index2], e.instance.props.currentUser.id);
return renderedChildren;
}
@ -472,15 +472,15 @@ var EditUsers = (_ => {
if (e.instance.props.channel && e.instance.props.channel.type == BDFDB.DiscordConstants.ChannelTypes.DM && settings.changeInChatWindow) {
let recipientId = e.instance.props.channel.getRecipientId();
let name = this.getUserData(recipientId).username;
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue.props.children, {props:"src"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue.props.children, {props:"src"});
if (index > -1) children[index].props.src = this.getUserAvatar(recipientId);
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue.props.children, {name:"h1"});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue.props.children, {name:"h1"});
if (index > -1) {
children[index].props.children = BDFDB.ReactUtils.createElement("span", {children: name});
this.changeUserColor(children[index].props.children, recipientId);
}
if (index > -1) children[index].props.src = this.getUserAvatar(recipientId);
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue.props.children, {name:"strong"});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue.props.children, {name:"strong"});
if (index > -1) {
children[index].props.children = "@" + name;
this.changeUserColor(children[index], recipientId);
@ -516,7 +516,7 @@ var EditUsers = (_ => {
processMessageHeader (e) {
if (e.instance.props.message && settings.changeInChatWindow) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue.props.children.slice(1), {name: "Popout", props: [["className", BDFDB.disCN.messageusername]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue.props.children.slice(1), {name: "Popout", props: [["className", BDFDB.disCN.messageusername]]});
if (index > -1) {
let data = changedUsers[e.instance.props.message.author.id];
if (data && (data.color1 || data.color2)) {
@ -656,7 +656,7 @@ var EditUsers = (_ => {
if (e.instance.props.user && settings.changeInInviteList) {
if (!e.returnvalue) e.instance.props.user = this.getUserData(e.instance.props.user.id);
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.invitemodalinviterowname]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.invitemodalinviterowname]]});
if (index > -1) this.changeUserColor(children[index], e.instance.props.user.id);
}
}
@ -670,7 +670,7 @@ var EditUsers = (_ => {
processInviteModalUserRow (e) {
if (e.instance.props.user && settings.changeInInviteList) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.searchpopoutddmaddnickname]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.searchpopoutddmaddnickname]]});
if (index > -1) this.changeUserColor(children[index], e.instance.props.user.id);
}
}
@ -679,7 +679,7 @@ var EditUsers = (_ => {
if (BDFDB.ObjectUtils.is(e.instance.props.typingUsers) && Object.keys(e.instance.props.typingUsers).length && settings.changeInTyping) {
let users = Object.keys(e.instance.props.typingUsers).filter(id => id != BDFDB.UserUtils.me.id).filter(id => !BDFDB.LibraryModules.FriendUtils.isBlocked(id)).map(id => BDFDB.LibraryModules.UserStore.getUser(id)).filter(user => user);
if (users.length) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.typingtext]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.typingtext]]});
if (index > -1 && BDFDB.ArrayUtils.is(children[index].props.children)) for (let child of children[index].props.children) if (child.type == "strong") {
let userId = (users.shift() || {}).id;
if (userId) {
@ -695,9 +695,9 @@ var EditUsers = (_ => {
processDirectMessage (e) {
if (e.instance.props.channel && e.instance.props.channel.type == BDFDB.DiscordConstants.ChannelTypes.DM && settings.changeInRecentDms) {
let recipientId = e.instance.props.channel.getRecipientId();
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "ListItemTooltip"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ListItemTooltip"});
if (index > -1) children[index].props.text = this.getUserData(recipientId).username;
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "NavItem"});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "NavItem"});
if (index > -1) children[index].props.icon = this.getUserAvatar(recipientId);
}
}
@ -726,7 +726,7 @@ var EditUsers = (_ => {
if (e.instance.props.user && settings.changeInQuickSwitcher) {
if (!e.returnvalue) e.instance.props.user = this.getUserData(e.instance.props.user.id);
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresultmatch]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.quickswitchresultmatch]]});
if (index > -1) {
let data = changedUsers[e.instance.props.user.id];
if (data && data.name) children[index].props.children = data.name;
@ -744,7 +744,7 @@ var EditUsers = (_ => {
processSearchPopoutUserResult (e) {
if (e.instance.props.result && e.instance.props.result.user && settings.changeInSearchPopout) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.searchpopoutdisplayednick]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.searchpopoutdisplayednick]]});
if (index > -1) {
let data = changedUsers[e.instance.props.result.user.id];
if (data && data.name) children[index].props.children = data.name;
@ -766,7 +766,7 @@ var EditUsers = (_ => {
e.instance.props.avatarUrl = this.getUserAvatar(user.id);
}
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.callmembers]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.callmembers]]});
if (index > -1) this.changeUserColor(children[index], user.id);
}
}

View File

@ -97,7 +97,7 @@ var EmojiStatistics = (_ => {
processEmojiPicker (e) {
this.loadEmojiList();
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"DiversitySelector"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name:"DiversitySelector"});
if (index > -1) children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: "Emoji Statistics",
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, {

View File

@ -511,7 +511,7 @@ var FriendNotifications = (_ => {
processGuilds (e) {
if (settings.addOnlineCount) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "ConnectedUnreadDMs"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ConnectedUnreadDMs"});
if (index > -1) children.splice(index, 0, BDFDB.ReactUtils.createElement(FriendOnlineCounter, {
amount: BDFDB.LibraryModules.StatusMetaUtils.getOnlineFriendCount()
}));

View File

@ -280,9 +280,9 @@ var GoogleTranslateOption = (_ => {
processChannelTextAreaContainer (e) {
if (settings.addTranslateButton) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "ChannelEditorContainer"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ChannelEditorContainer"});
if (index > -1 && children[index].props.type == BDFDB.DiscordConstants.TextareaTypes.NORMAL && !children[index].props.disabled) {
let [children2, index2] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.textareapickerbuttons]]});
let [children2, index2] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.textareapickerbuttons]]});
if (index2 > -1 && children2[index2].props && children2[index2].props.children) children2[index2].props.children.unshift(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.PopoutContainer, {
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ChannelTextAreaButton, {
key: "translate-button",
@ -395,7 +395,7 @@ var GoogleTranslateOption = (_ => {
originalDescription: e.instance.props.embed.originalDescription || e.instance.props.embed.rawDescription
});
else {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.embeddescription]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.embeddescription]]});
if (index > -1) children[index].props.children.push(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: `From: ${this.getLanguageName(translation.input)}\nTo: ${this.getLanguageName(translation.output)}`,
tooltipConfig: {style: "max-width: 400px"},

View File

@ -98,7 +98,7 @@ var ImageZoom = (_ => {
processImageModal (e) {
if (e.returnvalue) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.downloadlink]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.downloadlink]]});
if (index > -1) {
let openContext = event => {
BDFDB.ContextMenuUtils.open(this, event, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, {

View File

@ -245,7 +245,7 @@ var JoinedAtDate = (_ => {
processUserPopout (e) {
if (e.instance.props.user && settings.addInUserPopout) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "CustomStatus"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "CustomStatus"});
if (index > -1) this.injectDate(e.instance, children, 2, e.instance.props.user);
}
}
@ -255,7 +255,7 @@ var JoinedAtDate = (_ => {
let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = (...args) => {
let renderedChildren = renderChildren(...args);
let [children, index] = BDFDB.ReactUtils.findChildren(renderedChildren, {name: ["DiscordTag", "ColoredFluxTag"]});
let [children, index] = BDFDB.ReactUtils.findParent(renderedChildren, {name: ["DiscordTag", "ColoredFluxTag"]});
if (index > -1) this.injectDate(e.instance, children, 1, children[index].props.user);
return renderedChildren;
};

View File

@ -256,7 +256,7 @@ var LastMessageDate = (_ => {
processUserPopout (e) {
if (e.instance.props.user && settings.addInUserPopout) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "CustomStatus"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "CustomStatus"});
if (index > -1) this.injectDate(e.instance, children, 2, e.instance.props.user);
}
}
@ -266,7 +266,7 @@ var LastMessageDate = (_ => {
let renderChildren = e.returnvalue.props.children;
e.returnvalue.props.children = (...args) => {
let renderedChildren = renderChildren(...args);
let [children, index] = BDFDB.ReactUtils.findChildren(renderedChildren, {name: ["DiscordTag", "ColoredFluxTag"]});
let [children, index] = BDFDB.ReactUtils.findParent(renderedChildren, {name: ["DiscordTag", "ColoredFluxTag"]});
if (index > -1) this.injectDate(e.instance, children, 1, children[index].props.user);
return renderedChildren;
};

View File

@ -453,7 +453,7 @@ var NotificationSounds = (_ => {
}
processShakeable (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "IncomingCalls"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "IncomingCalls"});
if (index > -1) {
if (repatchIncoming) {
children[index] = null;

View File

@ -189,7 +189,7 @@ var OldTitleBar = (_ => {
}
processApp (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.instance, {props:[["type",["WINDOWS", "MACOS"]]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.instance, {props:[["type",["WINDOWS", "MACOS"]]]});
if (index > -1) children[index] = null;
}
@ -201,7 +201,7 @@ var OldTitleBar = (_ => {
if (!settings.addOldBar) return;
let children = BDFDB.ReactUtils.getValue(e.returnvalue, "props.toolbar.props.children");
if (!children) {
let [oldToolbarParent, oldToolbarIndex] = BDFDB.ReactUtils.findChildren(e.returnvalue, {key: "OldTitleBar-toolbar"});
let [oldToolbarParent, oldToolbarIndex] = BDFDB.ReactUtils.findParent(e.returnvalue, {key: "OldTitleBar-toolbar"});
if (oldToolbarIndex > -1) oldToolbarParent.splice(oldToolbarIndex, 1);
let toolbar = BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS.channelheadertoolbar + BDFDB.disCN._oldtitlebartoolbar,

View File

@ -175,7 +175,7 @@ var OwnerTag = (_ => {
if (e.instance.props.message && settings.addInChatWindow) {
let userType = this.getUserType(e.instance.props.message.author);
if (userType) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue.props.children.slice(1), {name: "Popout", props: [["className", BDFDB.disCN.messageusername]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue.props.children.slice(1), {name: "Popout", props: [["className", BDFDB.disCN.messageusername]]});
if (index > -1) this.injectOwnerTag(children, e.instance.props.message.author, userType, e.instance.props.compact ? 0 : 2, {
tagClass: e.instance.props.compact ? BDFDB.disCN.messagebottagcompact : BDFDB.disCN.messagebottagcozy,
useRem: true
@ -212,7 +212,7 @@ var OwnerTag = (_ => {
if (e.instance.props.user && settings.addInUserPopout) {
let userType = this.getUserType(e.instance.props.user);
if (userType) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadertagwithnickname]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadertagwithnickname]]});
if (index > -1) this.injectOwnerTag(children, e.instance.props.user, userType, 2, {
tagClass: BDFDB.disCNS.userpopoutheaderbottagwithnickname + BDFDB.disCN.bottagnametag
});
@ -223,7 +223,7 @@ var OwnerTag = (_ => {
injectOwnerTag (children, user, userType, insertIndex, config = {}) {
if (!BDFDB.ArrayUtils.is(children) || !user) return;
if (settings.useCrown || settings.hideNativeCrown) {
let [_, index] = BDFDB.ReactUtils.findChildren(children, {props: [["text",[BDFDB.LanguageUtils.LanguageStrings.GROUP_OWNER, BDFDB.LanguageUtils.LanguageStrings.GUILD_OWNER]]]});
let [_, index] = BDFDB.ReactUtils.findParent(children, {props: [["text",[BDFDB.LanguageUtils.LanguageStrings.GROUP_OWNER, BDFDB.LanguageUtils.LanguageStrings.GUILD_OWNER]]]});
if (index > -1) children[index] = null;
}
let channel = BDFDB.LibraryModules.ChannelStore.getChannel(BDFDB.LibraryModules.LastChannelStore.getChannelId());

View File

@ -157,7 +157,7 @@ var PersonalPins = (_ => {
}
processHeaderBarContainer (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(BDFDB.ReactUtils.getValue(e.returnvalue, "props.toolbar"), {name: "FluxContainer(Search)"});
let [children, index] = BDFDB.ReactUtils.findParent(BDFDB.ReactUtils.getValue(e.returnvalue, "props.toolbar"), {name: "FluxContainer(Search)"});
if (index > -1) children.splice(index, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.PopoutContainer, {
children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: this.labels.popout_note_text,

View File

@ -552,11 +552,11 @@ var PinDMs = (_ => {
BDFDB.ReactUtils.forceUpdate(e.instance);
}
if (draggedChannel) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {filter: child => BDFDB.ReactUtils.getValue(child, "props.channel.id") == draggedChannel});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: child => BDFDB.ReactUtils.getValue(child, "props.channel.id") == draggedChannel});
children.splice(index, 1);
}
if (this.hoveredChannel) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {filter: child => BDFDB.ReactUtils.getValue(child, "props.channel.id") == this.hoveredChannel});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {filter: child => BDFDB.ReactUtils.getValue(child, "props.channel.id") == this.hoveredChannel});
children.splice(index + 1, 0, BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS.guildouter + BDFDB.disCN._pindmsrecentplaceholder,
children: BDFDB.ReactUtils.createElement("div", {
@ -712,7 +712,7 @@ var PinDMs = (_ => {
BDFDB.ModuleUtils.forceAllUpdates(this, "PrivateChannelsList");
}
if (e.returnvalue && this.isPinned(e.instance.props.channel.id, "pinnedRecents") && BDFDB.DataUtils.get(this, "settings", "showPinIcon")) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"BlobMask"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name:"BlobMask"});
if (index > -1) children[index].props.upperLeftBadge = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.IconBadge, {
className: BDFDB.disCN.guildiconbadge,
disableColor: true,

View File

@ -273,7 +273,7 @@ var PluginRepo = (_ => {
onUserSettingsCogContextMenu (e) {
BDFDB.TimeUtils.timeout(_ => {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["label", "BandagedBD"]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["label", "BandagedBD"]]});
if (index > -1 && BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: "Plugin Repo",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "repo"),
@ -287,7 +287,7 @@ var PluginRepo = (_ => {
processV2CContentColumn (e) {
if (typeof e.instance.props.title == "string" && e.instance.props.title.toUpperCase().indexOf("PLUGINS") == 0) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {key: "folder-button"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {key: "folder-button"});
if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: "Open Plugin Repo",
children: BDFDB.ReactUtils.createElement("button", {

View File

@ -187,14 +187,14 @@ var ReadAllNotificationsButton = (_ => {
onUserContextMenu (e) {
if (e.instance.props.channel && e.type == "DMUserContextMenu") {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: BDFDB.LibraryComponents.MenuItems.MenuGroup});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: BDFDB.LibraryComponents.MenuItems.MenuGroup});
if (index > -1) this.injectItem(children, e.instance.props.channel.id);
}
}
onGroupDMContextMenu (e) {
if (e.instance.props.channel) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: BDFDB.LibraryComponents.MenuItems.MenuGroup});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: BDFDB.LibraryComponents.MenuItems.MenuGroup});
if (index > -1) this.injectItem(children, e.instance.props.channel.id);
}
}
@ -214,7 +214,7 @@ var ReadAllNotificationsButton = (_ => {
}
processGuilds (e) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "ConnectedUnreadDMs"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ConnectedUnreadDMs"});
if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCNS.guildouter + BDFDB.disCN._readallnotificationsbuttonframe,
style: {height: 20},

View File

@ -151,7 +151,7 @@ var RemoveNicknames = (_ => {
if (BDFDB.ObjectUtils.is(e.instance.props.typingUsers) && Object.keys(e.instance.props.typingUsers).length && settings.changeInTyping) {
let users = Object.keys(e.instance.props.typingUsers).filter(id => id != BDFDB.UserUtils.me.id).filter(id => !BDFDB.LibraryModules.FriendUtils.isBlocked(id)).map(id => BDFDB.LibraryModules.UserStore.getUser(id)).filter(user => user);
if (users.length) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["className", BDFDB.disCN.typingtext]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.typingtext]]});
if (index > -1 && BDFDB.ArrayUtils.is(children[index].props.children)) for (let child of children[index].props.children) if (child.type == "strong") {
let newName = this.getNewName(users.shift());
if (newName) BDFDB.ReactUtils.setChild(child, newName);

View File

@ -101,7 +101,7 @@ var SendLargeMessages = (_ => {
processChannelTextAreaContainer (e) {
if (e.returnvalue.ref && e.returnvalue.ref.current && BDFDB.DOMUtils.getParent(BDFDB.dotCN.chatform, e.returnvalue.ref.current)) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "SlateCharacterCount"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "SlateCharacterCount"});
if (index > -1) {
let text = BDFDB.LibraryModules.SlateSelectionUtils.serialize(children[index].props.document, "raw");
if (text.length > BDFDB.DiscordConstants.MAX_MESSAGE_LENGTH) children[index] = BDFDB.ReactUtils.createElement("div", {

View File

@ -592,7 +592,7 @@ var ServerFolders = (_ => {
processAppView (e) {
if (settings.extraColumn) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: ["FluxContainer(Guilds)", "FluxContainer(NavigableGuilds)"]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["FluxContainer(Guilds)", "FluxContainer(NavigableGuilds)"]});
if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(folderGuildContentComponent, {
themeOverride: children[index].props.themeOverride
}));
@ -619,7 +619,7 @@ var ServerFolders = (_ => {
}
folderStates[e.instance.props.folderId] = state;
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "ListItemTooltip"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ListItemTooltip"});
if (index > -1) children[index] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: e.instance.props.folderName || BDFDB.FolderUtils.getDefaultName(e.instance.props.folderId),
tooltipConfig: {
@ -635,7 +635,7 @@ var ServerFolders = (_ => {
let folderIcons = this.loadAllIcons(), icontype = e.instance.props.expanded ? "openicon" : "closedicon";
let icon = folderIcons[data.iconID] ? (!folderIcons[data.iconID].customID ? this.createBase64SVG(folderIcons[data.iconID][icontype], data.color1, data.color2) : folderIcons[data.iconID][icontype]) : null;
if (icon) {
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "FolderIcon"});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "FolderIcon"});
if (index > -1) children[index] = BDFDB.ReactUtils.createElement("div", {
className: BDFDB.disCN.guildfoldericonwrapper,
style: {background: `url(${icon}) center/cover no-repeat`}
@ -643,7 +643,7 @@ var ServerFolders = (_ => {
}
}
if (settings.showCountBadge) {
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name:"BlobMask"});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name:"BlobMask"});
if (index > -1) {
children[index].props.upperLeftBadgeWidth = BDFDB.LibraryComponents.Badges.getBadgeWidthForValue(e.instance.props.guildIds.length);
children[index].props.upperLeftBadge = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Badges.NumberBadge, {
@ -671,7 +671,7 @@ var ServerFolders = (_ => {
guildStates[e.instance.props.guild.id] = state;
if (e.returnvalue) {
let data = this.getFolderConfig(folder.folderId);
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: ["GuildTooltip", "BDFDB_TooltipContainer"]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["GuildTooltip", "BDFDB_TooltipContainer"]});
if (index > -1) children[index] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
tooltipConfig: Object.assign({
type: "right",
@ -702,7 +702,7 @@ var ServerFolders = (_ => {
if (e.returnvalue) {
let folder = BDFDB.LibraryModules.FolderStore.getGuildFolderById(e.instance.props.folderId);
let data = this.getFolderConfig(e.instance.props.folderId);
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: ["ModalHeader", "Header"]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["ModalHeader", "Header"]});
if (index > -1) {
children[index].props.className = BDFDB.DOMUtils.formatClassName(children[index].props.className, BDFDB.disCN.modalheaderhassibling),
children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Flex, {
@ -732,7 +732,7 @@ var ServerFolders = (_ => {
})
}));
}
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "Content"});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "Content"});
if (index > -1) children[index].props.children = [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ModalComponents.ModalTabContent, {
tab: this.labels.modal_tabheader1_text,
@ -827,7 +827,7 @@ var ServerFolders = (_ => {
children: BDFDB.ReactUtils.createElement(folderIconCustomPreviewComponent, {})
})
];
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: ["ModalFooter", "Footer"]});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: ["ModalFooter", "Footer"]});
if (index > -1) children[index].props.children = [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Button, {
children: BDFDB.LanguageUtils.LanguageStrings.SAVE,

View File

@ -154,7 +154,7 @@ var ServerHider = (_ => {
let hiddenGuildIds = BDFDB.DataUtils.load(this, "hidden", "servers") || [];
let hiddenFolderIds = BDFDB.DataUtils.load(this, "hidden", "folders") || [];
if (hiddenGuildIds.length || hiddenFolderIds.length) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:["folderId", "guildId"], someProps:true});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:["folderId", "guildId"], someProps:true});
if (index > -1) for (let i in children) {
let child = children[i];
if (child.props.folderId) {

View File

@ -276,7 +276,7 @@ var ShowHiddenChannels = (_ => {
onChannelContextMenu (e) {
if (e.instance.props.channel) {
if (e.instance.props.channel.id.endsWith("hidden") && e.instance.props.channel.type == BDFDB.DiscordConstants.ChannelTypes.GUILD_CATEGORY) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "ChannelMuteItem"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "ChannelMuteItem"});
if (index > -1) children.splice(index, 1);
}
let isHidden = this.isChannelHidden(e.instance.props.channel.id);
@ -372,12 +372,12 @@ var ShowHiddenChannels = (_ => {
}
if (e.instance.props.channel && this.isChannelHidden(e.instance.props.channel.id)) {
if (e.returnvalue) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {name: "Icon"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "Icon"});
if (index > -1) children[index] = BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, {
nativeClass: true,
iconSVG: `<svg class="${BDFDB.disCN.channelicon}" width="24" height="24" viewBox="0 0 24 24"><mask id="${this.name + e.instance.props.channel.id}" fill="black"><path d="M 0 0 H 24 V 24 H 0 Z" fill="white"></path><path d="M24 0 H 13 V 12 H 24 Z" fill="black"></path></mask><path mask="url(#${this.name + e.instance.props.channel.id})" fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="${this.channelIcons[BDFDB.DiscordConstants.ChannelTypes[e.instance.props.channel.type]] || this.channelIcons.DEFAULT}"></path><path fill="currentColor" d="M 21.025 5 V 4 C 21.025 2.88 20.05 2 19 2 C 17.95 2 17 2.88 17 4 V 5 C 16.4477 5 16 5.44772 16 6 V 9 C 16 9.55228 16.4477 10 17 10 H 19 H 21 C 21.5523 10 22 9.55228 22 9 V 5.975C22 5.43652 21.5635 5 21.025 5 Z M 20 5 H 18 V 4 C 18 3.42857 18.4667 3 19 3 C 19.5333 3 20 3.42857 20 4 V 5 Z"></path></svg>`
});
[children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]});
[children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props:[["className", BDFDB.disCN.channelchildren]]});
if (index > -1 && children[index].props && children[index].props.children) {
children[index].props.children = [BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: BDFDB.LanguageUtils.LanguageStrings.CHANNEL_LOCKED_SHORT,

View File

@ -334,7 +334,7 @@ var ThemeRepo = (_ => {
onUserSettingsCogContextMenu (e) {
BDFDB.TimeUtils.timeout(_ => {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {props: [["label", "BandagedBD"]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["label", "BandagedBD"]]});
if (index > -1 && BDFDB.ArrayUtils.is(children[index].props.children)) children[index].props.children.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: "Theme Repo",
id: BDFDB.ContextMenuUtils.createItemId(this.name, "repo"),
@ -348,7 +348,7 @@ var ThemeRepo = (_ => {
processV2CContentColumn (e) {
if (typeof e.instance.props.title == "string" && e.instance.props.title.toUpperCase().indexOf("THEMES") == 0) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue, {key: "folder-button"});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {key: "folder-button"});
if (index > -1) children.splice(index + 1, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, {
text: "Open Theme Repo",
children: BDFDB.ReactUtils.createElement("button", {

View File

@ -168,7 +168,7 @@ var TopRoleEverywhere = (_ => {
processMessageHeader (e) {
if (e.instance.props.message) {
let [children, index] = BDFDB.ReactUtils.findChildren(e.returnvalue.props.children.slice(1), {name: "Popout", props: [["className", BDFDB.disCN.messageusername]]});
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue.props.children.slice(1), {name: "Popout", props: [["className", BDFDB.disCN.messageusername]]});
if (index > -1) {
if (settings.showInChat) this.injectRoleTag(children, e.instance.props.message.author, "chat", {
tagClass: e.instance.props.compact ? BDFDB.disCN.messagebottagcompact : BDFDB.disCN.messagebottagcozy,