From 1a70b445e2e47de07b1c143b728fc9d0522a9269 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Tue, 6 Jun 2023 22:43:34 +0200 Subject: [PATCH] stuff --- Library/_res/0BDFDB.data.json | 2 ++ Plugins/EditUsers/EditUsers.plugin.js | 23 ++++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index e5f9681284..582f458258 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -468,6 +468,7 @@ "HeaderBar": {"strings": [".hamburger", "scrollable", "themed"]}, "HeaderBarChannelName": {"strings": ["onDoubleClick", ".setName", "maxLen:"]}, "HeaderBarContainer": {"strings": ["isAuthenticated", ".HEADER_BAR"]}, + "HeaderBarRecipient": {"strings": [".Messages.DIRECT_MESSAGE", "getRecipientId", "().avatar", "getName"]}, "HeaderBarTitle": {"strings": [".titleWrapper", ",onContextMenu", "forceLevel:"]}, "HeaderBarTitleIcon": {"strings": ["HEADER_BAR_BADGE", ".iconBadge", ".iconClassName"]}, "HomeButton": {"strings": ["isOnOtherSidebarRoute", "showProgressBadge", "maybeTrackExposure"]}, @@ -2082,6 +2083,7 @@ "channelcontainerdefault": ["ChannelContainer", "containerDefault"], "channelcontent": ["Channel", "content"], "channeldisabled": ["ChannelContainer", "disabled"], + "channelheaderavatar": ["ChatWindow", "avatar"], "channelheaderchannelname": ["ChatWindow", "channelName"], "channelheaderchildren": ["HeaderBar", "children"], "channelheadercursorpointer": ["ChatWindow", "cursorPointer"], diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index 81c8d4ca24..9922c32d3e 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.7.9 + * @version 4.8.0 * @description Allows you to locally edit Users * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -109,7 +109,6 @@ module.exports = (_ => { "GuildInvitationRow", "GuildInvites", "GuildMemberEntry", - "HeaderBarContainer", "MemberListItem", "Message", "MessageContent", @@ -144,6 +143,7 @@ module.exports = (_ => { "DirectMessageAddPopoutRow", "DiscordTag", "GuildInvitationRow", + "HeaderBarRecipient", "IncomingCallModal", "MemberListItem", "Mention", @@ -472,15 +472,16 @@ module.exports = (_ => { } } - processHeaderBarContainer (e) { - if (!this.settings.places.dmHeader) return; - let channel = BDFDB.LibraryStores.ChannelStore.getChannel(e.instance.props.channelId); - if (!channel || !channel.isDM()) return; - let userName = BDFDB.ReactUtils.findChild(e.instance, {props: [["className", BDFDB.disCN.channelheadercursorpointer]]}); - if (!userName) return; - let recipientId = channel.getRecipientId(); - userName.props.children = this.getUserData(recipientId).username; - this.changeUserColor(userName, recipientId); + processHeaderBarRecipient (e) { + if (!this.settings.places.dmHeader || !e.instance.props.channel || !e.instance.props.channel.isDM()) return; + let recipientId = e.instance.props.channel.getRecipientId(); + let avatar = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelheaderavatar]]}); + if (avatar) avatar.props.src = this.getUserAvatar(recipientId); + let userName = BDFDB.ReactUtils.findChild(e.returnvalue, {props: [["className", BDFDB.disCN.channelheadercursorpointer]]}); + if (userName) { + userName.props.children = this.getUserData(recipientId).username; + this.changeUserColor(userName, recipientId); + } } processChannelCallHeader (e) {