added support for colored Text in EditUsers

This commit is contained in:
Mirco Wittrien 2018-12-30 09:50:26 +01:00
parent a13554963a
commit 64b770792b
1 changed files with 14 additions and 2 deletions

View File

@ -14,7 +14,8 @@ class EditUsers {
"CallAvatar":"componentDidMount",
"PrivateChannel":"componentDidMount",
"HeaderBar":["componentDidMount","componentDidUpdate"],
"Clickable":"componentDidMount"
"Clickable":"componentDidMount",
"MessageContent":["componentDidMount","componentDidUpdate"]
};
this.css = `
@ -147,7 +148,7 @@ class EditUsers {
getDescription () {return "Allows you to change the icon, name, tag and color of users. Does not work in compact mode.";}
getVersion () {return "3.1.0";}
getVersion () {return "3.1.1";}
getAuthor () {return "DevilBro";}
@ -564,6 +565,17 @@ class EditUsers {
}
}
processMessageContent (instance, wrapper) {
if (instance.props && instance.props.message && instance.props.message.author) {
let markup = wrapper.querySelector(BDFDB.dotCN.messagemarkup);
if (markup) {
let info = instance.props.message.author;
let data = BDFDB.loadData(info.id, this, "users") || {};
markup.style.setProperty("color", settingsCookie["bda-gs-7"] ? BDFDB.colorCONVERT(data.color1 || info.colorString, "RGB") : null, "important");
}
}
}
changeName (info, username, guildid = this.LastGuildStore.getGuildId()) {
if (!info || !username || !username.parentElement) return;
if (username.EditUsersChangeObserver && typeof username.EditUsersChangeObserver.disconnect == "function") username.EditUsersChangeObserver.disconnect();