Update EditUsers.plugin.js

This commit is contained in:
Mirco Wittrien 2021-06-03 18:32:06 +02:00
parent 5542f12709
commit 72c009d0ea
1 changed files with 27 additions and 25 deletions

View File

@ -2,7 +2,7 @@
* @name EditUsers * @name EditUsers
* @author DevilBro * @author DevilBro
* @authorId 278543574059057154 * @authorId 278543574059057154
* @version 4.2.7 * @version 4.2.8
* @description Allows you to locally edit Users * @description Allows you to locally edit Users
* @invite Jx3TjNS * @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien * @donate https://www.paypal.me/MircoWittrien
@ -17,7 +17,7 @@ module.exports = (_ => {
"info": { "info": {
"name": "EditUsers", "name": "EditUsers",
"author": "DevilBro", "author": "DevilBro",
"version": "4.2.7", "version": "4.2.8",
"description": "Allows you to locally edit Users" "description": "Allows you to locally edit Users"
}, },
"changeLog": { "changeLog": {
@ -106,7 +106,7 @@ module.exports = (_ => {
HeaderBarContainer: "render", HeaderBarContainer: "render",
ChannelEditorContainer: "render", ChannelEditorContainer: "render",
AutocompleteUserResult: "render", AutocompleteUserResult: "render",
UserPopoutInfo: "default", UserPopout: "render",
UserProfile: "render", UserProfile: "render",
UserInfo: "default", UserInfo: "default",
NowPlayingHeader: "Header", NowPlayingHeader: "Header",
@ -491,12 +491,11 @@ module.exports = (_ => {
} }
} }
processUserPopoutInfo (e) { processUserPopout (e) {
if (e.instance.props.user && this.settings.places.userPopout) { if (e.instance.props.user && this.settings.places.userPopout) {
let data = changedUsers[e.instance.props.user.id]; let data = changedUsers[e.instance.props.user.id];
if (!e.returnvalue) {
e.instance.props.user = this.getUserData(e.instance.props.user.id, true, true);
if (data) { if (data) {
e.instance.props.user = this.getUserData(e.instance.props.user.id, true, true);
if (data.name && !(data.useServerNick && e.instance.props.nickname)) { if (data.name && !(data.useServerNick && e.instance.props.nickname)) {
let name = [data.name, data.showServerNick && e.instance.props.nickname && `(${e.instance.props.nickname})`].filter(n => n).join(" "); let name = [data.name, data.showServerNick && e.instance.props.nickname && `(${e.instance.props.nickname})`].filter(n => n).join(" ");
e.instance.props.nickname = name; e.instance.props.nickname = name;
@ -505,7 +504,11 @@ module.exports = (_ => {
if (data.removeStatus || data.status || data.statusEmoji) e.instance.props.customStatusActivity = this.createCustomStatus(data); if (data.removeStatus || data.status || data.statusEmoji) e.instance.props.customStatusActivity = this.createCustomStatus(data);
} }
} }
else { }
processUserPopoutInfo (e) {
if (e.instance.props.user && this.settings.places.userPopout) {
let data = changedUsers[e.instance.props.user.id];
if (data && (data.color1 || data.color2 || data.tag)) { if (data && (data.color1 || data.color2 || data.tag)) {
let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]}); let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {props: [["className", BDFDB.disCN.userpopoutheadernickname]]});
if (index > -1) { if (index > -1) {
@ -519,7 +522,6 @@ module.exports = (_ => {
} }
} }
} }
}
processUserProfile (e) { processUserProfile (e) {
if (e.instance.props.user && this.settings.places.userProfile) { if (e.instance.props.user && this.settings.places.userProfile) {