Update EditUsers.plugin.js

This commit is contained in:
Mirco Wittrien 2021-03-20 12:25:14 +01:00
parent ba492fa300
commit 0c01ce4181
1 changed files with 15 additions and 0 deletions

View File

@ -121,6 +121,7 @@ module.exports = (_ => {
ReactorsComponent: "render",
ChannelReply: "default",
MemberListItem: "render",
AuditLogs: "render",
AuditLog: "render",
GuildSettingsEmoji: "render",
MemberCard: "render",
@ -822,6 +823,20 @@ module.exports = (_ => {
}
}
processAuditLogs (e) {
if (e.instance.props.logs && settings.changeInGuildSettings) {
if (!BDFDB.PatchUtils.isPatched(this, e.instance, "renderUserQuickSelectItem")) BDFDB.PatchUtils.patch(this, e.instance, "renderUserQuickSelectItem", {after: e2 => {if (e2.methodArguments[0] && e2.methodArguments[0].user && changedUsers[e2.methodArguments[0].user.id]) {
let userName = BDFDB.ReactUtils.findChild(e2.returnValue, {props: [["children", e2.methodArguments[0].label]]});
if (userName) {
if (changedUsers[e2.methodArguments[0].user.id].name) userName.props.children = changedUsers[e2.methodArguments[0].user.id].name;
this.changeUserColor(userName, e2.methodArguments[0].user.id);
}
let avatar = BDFDB.ReactUtils.findChild(e2.returnValue, {props: [["className", BDFDB.disCN.auditlogpopoutavatar]]});
if (avatar) avatar.props.src = this.getUserAvatar(e2.methodArguments[0].user.id);
}}}, {force: true, noCache: true});
}
}
processAuditLog (e) {
if (e.instance.props.log && settings.changeInGuildSettings) {
if (e.instance.props.log.user) e.instance.props.log.user = this.getUserData(e.instance.props.log.user.id);