Update RemoveNicknames.plugin.js

This commit is contained in:
Mirco Wittrien 2021-01-07 14:11:23 +01:00
parent 35830d5bf8
commit 9e70ff6059
1 changed files with 2 additions and 2 deletions

View File

@ -100,13 +100,13 @@ module.exports = (_ => {
}
onStart () {
BDFDB.PatchUtils.patch(this, BDFDB.ModuleUtils.findByProperties("getMessageAuthor"), "getMessageAuthor", {after: e => {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageAuthorUtils, "getMessageAuthor", {after: e => {
if (settings.changeInChatWindow && e.methodArguments[0] && e.methodArguments[0].id) {
let newName = this.getNewName(BDFDB.LibraryModules.UserStore.getUser(e.methodArguments[0].id));
if (newName) e.returnValue.nick = newName;
}
}});
BDFDB.PatchUtils.patch(this, BDFDB.ModuleUtils.findByProperties("getMessageAuthor"), "default", {after: e => {
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageAuthorUtils, "default", {after: e => {
if (settings.changeInChatWindow && e.methodArguments[0] && e.methodArguments[0].author) {
let newName = this.getNewName(e.methodArguments[0].author);
if (newName) e.returnValue.nick = newName;