From f54b348c51ad9436b35798193abc55e7bb91e0cc Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Thu, 18 Jul 2019 12:18:54 +0200 Subject: [PATCH] fixes --- .../BadgesEverywhere.plugin.js | 21 ++++++------ .../BetterFriendCount.plugin.js | 2 +- Plugins/OwnerTag/OwnerTag.plugin.js | 32 +++++++++---------- .../RemoveNicknames/RemoveNicknames.plugin.js | 17 +++++----- .../TopRoleEverywhere.plugin.js | 12 ++++--- 5 files changed, 44 insertions(+), 40 deletions(-) diff --git a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js index e207337517..c0d93062c1 100644 --- a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js +++ b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js @@ -3,7 +3,7 @@ class BadgesEverywhere { getName () {return "BadgesEverywhere";} - getVersion () {return "1.3.4";} + getVersion () {return "1.3.5";} getAuthor () {return "DevilBro";} @@ -11,12 +11,13 @@ class BadgesEverywhere { initConstructor () { this.changelog = { - "fixed":[["Showing at the bottom","Badges are now properlly at the bottom even when a custom status is set"]] + "fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]] }; this.patchModules = { - "NameTag":"componentDidMount", + "ChannelMember":"componentDidMount", "MessageUsername":"componentDidMount", + "UserPopout":"componentDidMount", "StandardSidebarView":"componentWillUnmount" }; @@ -229,14 +230,8 @@ class BadgesEverywhere { // begin of own functions - processNameTag (instance, wrapper) { - if (!wrapper.classList || !instance || !instance.props) return; - else if (BDFDB.containsClass(wrapper, BDFDB.disCN.membernametag) && BDFDB.getData("showInMemberList", this, "settings")) { - this.addBadges(instance.props.user, wrapper, "list"); - } - else if (BDFDB.containsClass(wrapper, BDFDB.disCN.userpopoutheadertag) && BDFDB.getData("showInPopout", this, "settings")) { - this.addBadges(instance.props.user, BDFDB.getParentEle(BDFDB.dotCN.userpopoutheadertext, wrapper), "popout"); - } + processChannelMember (instance, wrapper) { + if (instance.props && BDFDB.getData("showInMemberList", this, "settings")) this.addBadges(instance.props.user, wrapper.querySelector(BDFDB.dotCN.nametag), "list"); } processMessageUsername (instance, wrapper) { @@ -246,6 +241,10 @@ class BadgesEverywhere { if (username && BDFDB.getData("showInChat", this, "settings")) this.addBadges(message.author, wrapper, "chat"); } } + + processUserPopout (instance, wrapper) { + if (instance.props && BDFDB.getData("showInPopout", this, "settings")) this.addBadges(instance.props.user, wrapper.querySelector(BDFDB.dotCN.userpopoutheadertext), "popout"); + } processStandardSidebarView (instance, wrapper) { if (this.SettingsUpdated) { diff --git a/Plugins/BetterFriendCount/BetterFriendCount.plugin.js b/Plugins/BetterFriendCount/BetterFriendCount.plugin.js index 0f5ef85625..792214dfb4 100644 --- a/Plugins/BetterFriendCount/BetterFriendCount.plugin.js +++ b/Plugins/BetterFriendCount/BetterFriendCount.plugin.js @@ -11,7 +11,7 @@ class BetterFriendCount { initConstructor () { this.changelog = { - "fixed":[["New Structure","Fixed issues that will occure once the avatar/name changes from canary will hit stable/ptb"]] + "fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]] }; this.patchModules = { diff --git a/Plugins/OwnerTag/OwnerTag.plugin.js b/Plugins/OwnerTag/OwnerTag.plugin.js index 9355c76559..7962b65b09 100644 --- a/Plugins/OwnerTag/OwnerTag.plugin.js +++ b/Plugins/OwnerTag/OwnerTag.plugin.js @@ -3,7 +3,7 @@ class OwnerTag { getName () {return "OwnerTag";} - getVersion () {return "1.1.3";} + getVersion () {return "1.1.4";} getAuthor () {return "DevilBro";} @@ -11,12 +11,14 @@ class OwnerTag { initConstructor () { this.changelog = { - "improved":[["Crown","Changed the crown to the new crown icon"]] + "fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]] }; this.patchModules = { - "NameTag":["componentDidMount","componentDidUpdate"], + "ChannelMember":["componentDidMount","componentDidUpdate"], "MessageUsername":["componentDidMount","componentDidUpdate"], + "UserPopout":["componentDidMount","componentDidUpdate"], + "UserProfile":["componentDidMount","componentDidUpdate"], "StandardSidebarView":"componentWillUnmount" }; @@ -142,18 +144,16 @@ class OwnerTag { this.SettingsUpdated = true; } - processNameTag (instance, wrapper) { - let container = null; - if (!instance.props || !wrapper.classList) return; - else if (BDFDB.containsClass(wrapper, BDFDB.disCN.membernametag) && BDFDB.getData("addInMemberList", this, "settings")) { - this.addOwnerTag(instance.props.user, null, wrapper, "list", BDFDB.disCN.bottagnametag + (instance.props.botClass ? (" " + instance.props.botClass) : ""), container); - } - else if ((container = BDFDB.getParentEle(BDFDB.dotCN.userpopout, wrapper)) != null && BDFDB.getData("addInUserPopout", this, "settings")) { - this.addOwnerTag(instance.props.user, null, wrapper, "popout", BDFDB.disCN.bottagnametag + (instance.props.botClass ? (" " + instance.props.botClass) : ""), container); - } - else if ((container = BDFDB.getParentEle(BDFDB.dotCN.userprofile, wrapper)) != null && BDFDB.getData("addInUserProfil", this, "settings")) { - this.addOwnerTag(instance.props.user, null, wrapper, "profile", BDFDB.disCN.bottagnametag + (instance.props.botClass ? (" " + instance.props.botClass) : ""), container); - } + processChannelMember (instance, wrapper) { + if (instance.props && BDFDB.getData("addInMemberList", this, "settings")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "list", BDFDB.disCN.bottagnametag, null); + } + + processUserPopout (instance, wrapper) { + if (instance.props && BDFDB.getData("addInUserPopout", this, "settings")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "popout", BDFDB.disCN.bottagnametag, wrapper); + } + + processUserProfile (instance, wrapper) { + if (instance.props && BDFDB.getData("addInUserProfil", this, "settings")) this.addOwnerTag(instance.props.user, null, wrapper.querySelector(BDFDB.dotCN.nametag), "profile", BDFDB.disCN.bottagnametag, wrapper); } processMessageUsername (instance, wrapper, methodnames) { @@ -162,7 +162,7 @@ class OwnerTag { let username = wrapper.querySelector(BDFDB.dotCN.messageusername); if (username) { let messagegroup = BDFDB.getParentEle(BDFDB.dotCN.messagegroup, wrapper); - this.addOwnerTag(message.author, message.channel_id, username.parentElement, "chat", BDFDB.disCN.bottagmessage + " " + (BDFDB.containsClass(messagegroup, BDFDB.disCN.messagegroupcozy) ? BDFDB.disCN.bottagmessagecozy : BDFDB.disCN.bottagmessagecompact), null); + this.addOwnerTag(message.author, message.channel_id, username.parentElement, "chat", BDFDB.containsClass(messagegroup, BDFDB.disCN.messagegroupcozy) ? BDFDB.disCN.bottagmessagecozy : BDFDB.disCN.bottagmessagecompact, null); } } } diff --git a/Plugins/RemoveNicknames/RemoveNicknames.plugin.js b/Plugins/RemoveNicknames/RemoveNicknames.plugin.js index c20af3fed7..def4a2fb90 100644 --- a/Plugins/RemoveNicknames/RemoveNicknames.plugin.js +++ b/Plugins/RemoveNicknames/RemoveNicknames.plugin.js @@ -3,7 +3,7 @@ class RemoveNicknames { getName () {return "RemoveNicknames";} - getVersion () {return "1.2.2";} + getVersion () {return "1.2.3";} getAuthor () {return "DevilBro";} @@ -11,13 +11,13 @@ class RemoveNicknames { initConstructor () { this.changelog = { - "improved":[["Normalized Classes","Normalized Classes no longer make the plugin be rendered useless in the member list"]] + "fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]] }; this.patchModules = { - "NameTag":"componentDidMount", - "TypingUsers":"componentDidUpdate", + "ChannelMember":"componentDidMount", "MessageUsername":"componentDidMount", + "TypingUsers":"componentDidUpdate", "Clickable":"componentDidMount", "StandardSidebarView":"componentWillUnmount" }; @@ -126,10 +126,11 @@ class RemoveNicknames { return settings.addNickname ? (settings.swapPositions ? (member.nick + " (" + username + ")") : (username + " (" + member.nick + ")")) : username; } - processNameTag (instance, wrapper) { - if (wrapper && !BDFDB.getParentEle(BDFDB.dotCNC.userprofile + BDFDB.dotCN.userpopout, wrapper)) { - let username = wrapper.parentElement.querySelector("." + instance.props.usernameClass.replace(/ /g, ".")); - if (username) BDFDB.setInnerText(username, this.getNewName(instance.props.user)); + processChannelMember (instance, wrapper) { + let user = BDFDB.getReactValue(instance, "props.user"); + if (user) { + let username = wrapper.querySelector(BDFDB.dotCN.memberusername); + if (username) BDFDB.setInnerText(username, this.getNewName(user)); } } diff --git a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js index 0115082579..598ed987a0 100644 --- a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js +++ b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js @@ -3,15 +3,19 @@ class TopRoleEverywhere { getName () {return "TopRoleEverywhere";} - getVersion () {return "2.7.9";} + getVersion () {return "2.8.0";} getAuthor () {return "DevilBro";} getDescription () {return "Adds the highest role of a user as a tag.";} initConstructor () { + this.changelog = { + "fixed":[["New Structure","Fixed issues that will occur once the avatar/name changes from canary will hit stable/ptb"]] + }; + this.patchModules = { - "NameTag":"componentDidMount", + "ChannelMember":"componentDidMount", "MessageUsername":"componentDidMount", "StandardSidebarView":"componentWillUnmount" }; @@ -132,8 +136,8 @@ class TopRoleEverywhere { // begin of own functions - processNameTag (instance, wrapper) { - if (instance.props && BDFDB.containsClass(wrapper, BDFDB.disCN.membernametag) && BDFDB.getData("showInMemberList", this, "settings")) { + processChannelMember (instance, wrapper) { + if (instance.props && BDFDB.getData("showInMemberList", this, "settings")) { this.addRoleTag(instance.props.user, wrapper.querySelector(BDFDB.dotCN.memberusername), "list"); } }