stuff
This commit is contained in:
parent
b636b87dd5
commit
5fd7c51880
|
@ -14,7 +14,7 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "EditUsers",
|
"name": "EditUsers",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "4.1.0",
|
"version": "4.1.1",
|
||||||
"description": "Allow you to change the icon, name, tag and color of users"
|
"description": "Allow you to change the icon, name, tag and color of users"
|
||||||
},
|
},
|
||||||
"changeLog": {
|
"changeLog": {
|
||||||
|
@ -198,18 +198,8 @@ module.exports = (_ => {
|
||||||
let observer = new MutationObserver(_ => {this.changeAppTitle();});
|
let observer = new MutationObserver(_ => {this.changeAppTitle();});
|
||||||
BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name: "appTitleObserver", instance: observer}, {childList: true});
|
BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name: "appTitleObserver", instance: observer}, {childList: true});
|
||||||
|
|
||||||
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageAuthorUtils, "getMessageAuthor", {after: e => {
|
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageAuthorUtils, ["default", "getMessageAuthor"], {after: e => {
|
||||||
if (settings.changeInChatWindow && e.methodArguments[0] && e.methodArguments[0].id && changedUsers[e.methodArguments[0].id]) {
|
if (settings.changeInChatWindow && e.methodArguments[0] && e.methodArguments[0].author && changedUsers[e.methodArguments[0].author.id] && this.shouldChangeInChat(e.methodArguments[0].channel_id)) {
|
||||||
let data = changedUsers[e.methodArguments[0].id];
|
|
||||||
if (data.name || data.color1) {
|
|
||||||
let color1 = data.color1 && data.useRoleColor && (BDFDB.LibraryModules.MemberStore.getMember(e.methodArguments[0].guild_id, e.methodArguments[0].id) || {}).colorString || data.color1;
|
|
||||||
if (data.name) e.returnValue.nick = data.name;
|
|
||||||
if (color1) e.returnValue.colorString = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(color1) ? color1[0] : color1, "HEX");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}});
|
|
||||||
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageAuthorUtils, "default", {after: e => {
|
|
||||||
if (settings.changeInChatWindow && e.methodArguments[0] && e.methodArguments[0].author && changedUsers[e.methodArguments[0].author.id]) {
|
|
||||||
let data = changedUsers[e.methodArguments[0].author.id];
|
let data = changedUsers[e.methodArguments[0].author.id];
|
||||||
if (data.name || data.color1) {
|
if (data.name || data.color1) {
|
||||||
let color1 = data.color1 && data.useRoleColor && (BDFDB.LibraryModules.MemberStore.getMember((BDFDB.LibraryModules.ChannelStore.getChannel(e.methodArguments[0].channel_id) || {}).guild_id, e.methodArguments[0].author.id) || {}).colorString || data.color1;
|
let color1 = data.color1 && data.useRoleColor && (BDFDB.LibraryModules.MemberStore.getMember((BDFDB.LibraryModules.ChannelStore.getChannel(e.methodArguments[0].channel_id) || {}).guild_id, e.methodArguments[0].author.id) || {}).colorString || data.color1;
|
||||||
|
|
|
@ -100,13 +100,7 @@ module.exports = (_ => {
|
||||||
}
|
}
|
||||||
|
|
||||||
onStart () {
|
onStart () {
|
||||||
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageAuthorUtils, "getMessageAuthor", {after: e => {
|
BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageAuthorUtils, ["default", "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.LibraryModules.MessageAuthorUtils, "default", {after: e => {
|
|
||||||
if (settings.changeInChatWindow && e.methodArguments[0] && e.methodArguments[0].author) {
|
if (settings.changeInChatWindow && e.methodArguments[0] && e.methodArguments[0].author) {
|
||||||
let newName = this.getNewName(e.methodArguments[0].author);
|
let newName = this.getNewName(e.methodArguments[0].author);
|
||||||
if (newName) e.returnValue.nick = newName;
|
if (newName) e.returnValue.nick = newName;
|
||||||
|
|
Loading…
Reference in New Issue