diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 186bf6fd9f..d59e9a7e1f 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -1279,6 +1279,7 @@ "ModalMiniContent": {"props": ["modal", "content"], "length": 2}, "ModalSub": {"props": ["modal", "sizeLarge"]}, "NameContainer": {"props": ["nameAndDecorators", "name"]}, + "NameContainerState": {"props": ["interactive", "selected", "muted"]}, "NameTag": {"props": ["bot", "nameTag"]}, "NitroStore": {"props": ["applicationStore", "marketingHeader"]}, "NoteTextarea": {"props": ["textarea"], "length": 1}, @@ -2609,14 +2610,14 @@ "modeselectable": ["FormText", "modeSelectable"], "namecontainer": ["NameContainer", "container"], "namecontaineravatar": ["NameContainer", "avatar"], - "namecontainerchildren": ["NameContainer", "children"], - "namecontainerclickable": ["NameContainer", "clickable"], "namecontainercontent": ["NameContainer", "content"], + "namecontainerinteractive": ["NameContainerState", "interactive"], "namecontainerlayout": ["NameContainer", "layout"], + "namecontainermuted": ["NameContainerState", "muted"], "namecontainername": ["NameContainer", "name"], "namecontainernamecontainer": ["NotFound", "nameContainerNameContainer"], "namecontainernamewrapper": ["NameContainer", "nameAndDecorators"], - "namecontainerselected": ["NameContainer", "selected"], + "namecontainerselected": ["NameContainerState", "selected"], "namecontainersubtext": ["NameContainer", "subText"], "nametag": ["NameTag", "nameTag"], "nitrostore": ["NitroStore", "applicationStore"], diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index 12c46721b3..e4c11b425b 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -2,7 +2,7 @@ * @name EditUsers * @author DevilBro * @authorId 278543574059057154 - * @version 4.4.5 + * @version 4.4.6 * @description Allows you to locally edit Users * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,7 +17,7 @@ module.exports = (_ => { "info": { "name": "EditUsers", "author": "DevilBro", - "version": "4.4.5", + "version": "4.4.6", "description": "Allows you to locally edit Users" } }; @@ -433,7 +433,7 @@ module.exports = (_ => { let userName = BDFDB.ReactUtils.findChild(children, {name: "AutocompleteRowHeading"}); if (userName) this.changeUserColor(userName, e.instance.props.user.id); return children; - }, "", this); + }, "Error in Children Render of AutocompleteUserResult!", this); } } } @@ -653,7 +653,7 @@ module.exports = (_ => { let userName = BDFDB.ReactUtils.findChild(renderedChildren, {name: "PanelTitle"}); if (userName) this.changeUserColor(userName, e.instance.props.currentUser.id); return renderedChildren; - }, "", this); + }, "Error in Tooltip Children Render of Account!", this); } } } @@ -748,7 +748,7 @@ module.exports = (_ => { let renderedChildren = renderChildren(...args); this.changeUserColor(renderedChildren, author.id, {guildId: (BDFDB.LibraryModules.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id}); return renderedChildren; - }, "", this); + }, "Error in Children Render of MessageUsername!", this); } else this.changeUserColor(messageUsername, author.id, {guildId: (BDFDB.LibraryModules.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id}); } @@ -859,7 +859,7 @@ module.exports = (_ => { let children = renderChildren(...args); this.changeMention(BDFDB.ReactUtils.findChild(children, {name: "Mention"}), changedUsers[e.instance.props.userId]); return children; - }, "", this); + }, "Error in Children Render of UserMention!", this); } else this.changeMention(BDFDB.ReactUtils.findChild(e.returnvalue, {name: "Mention"}), changedUsers[e.instance.props.userId]); } @@ -880,7 +880,7 @@ module.exports = (_ => { let children = renderChildren(...args); this.changeMention(children, data); return children; - }, "", this); + }, "Error in Children Render of RichUserMention!", this); } else this.changeMention(e.returnvalue, data); } @@ -959,7 +959,7 @@ module.exports = (_ => { if (changedUsers[e2.methodArguments[0].user.id].name) userName.props.children = changedUsers[e2.methodArguments[0].user.id].name; this.changeUserColor(userName, e2.methodArguments[0].user.id); } - let avatar = BDFDB.ReactUtils.findChild(e2.returnValue, {props: [["className", BDFDB.disCN.selectfilterpopoutavatar]]}); + let avatar = BDFDB.ReactUtils.findChild(e2.returnValue, {props: [["className", BDFDB.disCN.auditlogpopoutavatar]]}); if (avatar) avatar.props.src = this.getUserAvatar(e2.methodArguments[0].user.id); }}}, {force: true, noCache: true}); } @@ -1056,7 +1056,7 @@ module.exports = (_ => { let renderedChildren = childrenRender(...args); if (renderedChildren && renderedChildren.props) renderedChildren.props.icon = this.getUserAvatar(recipientId); return renderedChildren; - }, "", this); + }, "Error in Avatar Render of DirectMessage!", this); } } } @@ -1078,7 +1078,7 @@ module.exports = (_ => { let children = childrenRender(...args); this._processPrivateChannel(e.instance, children); return children; - }, "", this); + }, "Error in Children Render of PrivateChannel!", this); } else this._processPrivateChannel(e.instance, e.returnvalue); } @@ -1086,11 +1086,12 @@ module.exports = (_ => { } _processPrivateChannel (instance, returnvalue) { - returnvalue.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getUserData(instance.props.user.id).username}); - this.changeUserColor(returnvalue.props.name, instance.props.user.id, {modify: BDFDB.ObjectUtils.extract(Object.assign({}, instance.props, instance.state), "hovered", "selected", "hasUnreadMessages", "muted")}); - returnvalue.props.avatar.props.src = this.getUserAvatar(instance.props.user.id); - returnvalue.props.decorators = [returnvalue.props.decorators].flat(10); - this.injectBadge(returnvalue.props.decorators, instance.props.user.id, null, 1); + const wrapper = returnvalue.props.avatar ? returnvalue : BDFDB.ReactUtils.findChild(returnvalue, {props: ["avatar"]}); + wrapper.props.name = BDFDB.ReactUtils.createElement("span", {children: this.getUserData(instance.props.user.id).username}); + this.changeUserColor(wrapper.props.name, instance.props.user.id, {modify: BDFDB.ObjectUtils.extract(Object.assign({}, instance.props, instance.state), "hovered", "selected", "hasUnreadMessages", "muted")}); + if (wrapper.props.avatar) wrapper.props.avatar.props.src = this.getUserAvatar(instance.props.user.id); + wrapper.props.decorators = [wrapper.props.decorators].flat(10); + this.injectBadge(wrapper.props.decorators, instance.props.user.id, null, 1); } processQuickSwitchUserResult (e) { @@ -1158,7 +1159,7 @@ module.exports = (_ => { this.changeUserColor(userName, recipientId); } return renderedChildren; - }, "", this); + }, "Error in Children Render of RTCConnection!", this); } } diff --git a/Plugins/PinDMs/PinDMs.plugin.js b/Plugins/PinDMs/PinDMs.plugin.js index 51479a19f0..25ab23016d 100644 --- a/Plugins/PinDMs/PinDMs.plugin.js +++ b/Plugins/PinDMs/PinDMs.plugin.js @@ -2,7 +2,7 @@ * @name PinDMs * @author DevilBro * @authorId 278543574059057154 - * @version 1.8.6 + * @version 1.8.7 * @description Allows you to pin DMs, making them appear at the top of your DMs/ServerList * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,7 +17,7 @@ module.exports = (_ => { "info": { "name": "PinDMs", "author": "DevilBro", - "version": "1.8.6", + "version": "1.8.7", "description": "Allows you to pin DMs, making them appear at the top of your DMs/ServerList" } }; @@ -94,9 +94,6 @@ module.exports = (_ => { }; this.css = ` - ${BDFDB.dotCNS.dmchannel + BDFDB.dotCN.namecontainerchildren} { - display: flex; - } ${BDFDB.dotCN.dmchannel}:hover ${BDFDB.dotCN._pindmsunpinbutton} { display: block; } @@ -606,7 +603,7 @@ module.exports = (_ => { let children = childrenRender(...args); this.injectCategories(instance, children, categories); return children; - }, "", this); + }, "Error in Children Render of PrivateChannelList!", this); } else if (BDFDB.ArrayUtils.is(returnvalue)) { for (let child of returnvalue) this.injectCategories(instance, child, categories); @@ -685,7 +682,7 @@ module.exports = (_ => { let children = childrenRender(...args); this._processPrivateChannel(e.instance, children, category); return children; - }, "", this); + }, "Error in Children Render of PrivateChannel!", this); } else this._processPrivateChannel(e.instance, e.returnvalue, category); } @@ -694,23 +691,22 @@ module.exports = (_ => { } _processPrivateChannel (instance, returnvalue, category) { - returnvalue.props.children = [ - BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, { - text: BDFDB.LanguageUtils.LanguageStrings.UNPIN, - children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, { - className: BDFDB.disCN._pindmsunpinbutton, - onClick: event => { - BDFDB.ListenerUtils.stopEvent(event); - this.removeFromCategory(instance.props.channel.id, category, "channelList"); - }, - children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { - className: BDFDB.disCN._pindmsunpinicon, - name: BDFDB.LibraryComponents.SvgIcon.Names.PIN - }) + const interactive = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.namecontainerinteractive]]}); + if (!interactive) return; + interactive.props.children.splice(interactive.props.children.length == 1 ? 1 : -1, 0, BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, { + text: BDFDB.LanguageUtils.LanguageStrings.UNPIN, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Clickable, { + className: BDFDB.disCN._pindmsunpinbutton, + onClick: event => { + BDFDB.ListenerUtils.stopEvent(event); + this.removeFromCategory(instance.props.channel.id, category, "channelList"); + }, + children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { + className: BDFDB.disCN._pindmsunpinicon, + name: BDFDB.LibraryComponents.SvgIcon.Names.PIN }) - }), - returnvalue.props.children - ].flat(10).filter(n => n); + }) + })); } processDirectMessage (e) {