From 4aea853b017c5a761ef152650251ea968f9d04ac Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Wed, 7 Oct 2020 10:05:43 +0200 Subject: [PATCH] stuff --- .../BadgesEverywhere/BadgesEverywhere.plugin.js | 11 ++++++++--- Plugins/OwnerTag/OwnerTag.plugin.js | 11 ++++++++--- .../TopRoleEverywhere.plugin.js | 16 ++++++++++------ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js index d773af82c6..a949c5a805 100644 --- a/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js +++ b/Plugins/BadgesEverywhere/BadgesEverywhere.plugin.js @@ -5,8 +5,13 @@ module.exports = (_ => { "info": { "name": "BadgesEverywhere", "author": "DevilBro", - "version": "1.6.0", + "version": "1.6.1", "description": "Displays Badges (Nitro, HypeSquad, etc...) in the chat/memberlist/userpopout." + }, + "changeLog": { + "fixed": { + "Chat": "Works again in chat" + } } }; return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { @@ -374,8 +379,8 @@ module.exports = (_ => { processMessageHeader (e) { if (e.instance.props.message && settings.showInChat) { - 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"); + let headerText = BDFDB.ReactUtils.findChild(e.returnvalue.props.children, {props: [["className", BDFDB.disCN.messageheadertext]]}); + if (headerText && headerText.props && headerText.props.children) this.injectBadges(e.instance, headerText.props.children && headerText.props.children.props ? headerText.props.children.props.children : headerText.props.children, e.instance.props.message.author, "chat"); } } diff --git a/Plugins/OwnerTag/OwnerTag.plugin.js b/Plugins/OwnerTag/OwnerTag.plugin.js index 4a015b65d7..616b2c6461 100644 --- a/Plugins/OwnerTag/OwnerTag.plugin.js +++ b/Plugins/OwnerTag/OwnerTag.plugin.js @@ -5,8 +5,13 @@ module.exports = (_ => { "info": { "name": "OwnerTag", "author": "DevilBro", - "version": "1.3.3", + "version": "1.3.4", "description": "Adds a tag or crown to the server owner (or admins/management)." + }, + "changeLog": { + "fixed": { + "Chat": "Works again in chat" + } } }; return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { @@ -193,8 +198,8 @@ module.exports = (_ => { if (e.instance.props.message && settings.addInChatWindow) { let userType = this.getUserType(e.instance.props.message.author, e.instance.props.message.channel_id); if (userType) { - 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, { + let headerText = BDFDB.ReactUtils.findChild(e.returnvalue.props.children, {props: [["className", BDFDB.disCN.messageheadertext]]}); + if (headerText && headerText.props && headerText.props.children) this.injectOwnerTag(headerText.props.children && headerText.props.children.props ? headerText.props.children.props.children : headerText.props.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 }); diff --git a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js index 795cdd3032..e2463d22b4 100644 --- a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js +++ b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js @@ -5,8 +5,13 @@ module.exports = (_ => { "info": { "name": "TopRoleEverywhere", "author": "DevilBro", - "version": "3.0.3", + "version": "3.0.4", "description": "Adds the highest role of a user as a tag." + }, + "changeLog": { + "fixed": { + "Chat": "Works again in chat" + } } }; return !window.BDFDB_Global || (!window.BDFDB_Global.loaded && !window.BDFDB_Global.started) ? class { @@ -89,6 +94,7 @@ module.exports = (_ => { } ${BDFDB.dotCNS.messagecompact + BDFDB.dotCNS.messageheader + BDFDB.dotCN._toproleseverywhererolestyle} { margin-right: 0.3rem; + text-indent: 0; } ${BDFDB.dotCN._toproleseverywhererolestyle} { display: inline-flex; @@ -97,9 +103,6 @@ module.exports = (_ => { ${BDFDB.dotCNS._toproleseverywhererolestyle + BDFDB.dotCN.userpopoutrolecircle} { flex: 0 0 auto; } - ${BDFDB.dotCNS.messagecompact + BDFDB.dotCNS.messageheader + BDFDB.dotCN._toproleseverywhererolestyle} { - text-indent: 0; - } `; } @@ -164,8 +167,9 @@ module.exports = (_ => { processMessageHeader (e) { if (e.instance.props.message) { - let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue.props.children.slice(1), {name: "Popout", props: [["className", BDFDB.disCN.messageusername]]}); - if (index > -1) { + let headerText = BDFDB.ReactUtils.findChild(e.returnvalue.props.children, {props: [["className", BDFDB.disCN.messageheadertext]]}); + if (headerText && headerText.props && headerText.props.children) { + let children = headerText.props.children && headerText.props.children.props ? headerText.props.children.props.children : headerText.props.children; if (settings.showInChat) this.injectRoleTag(children, e.instance.props.message.author, "chat", { tagClass: e.instance.props.compact ? BDFDB.disCN.messagebottagcompact : BDFDB.disCN.messagebottagcozy, useRem: true