diff --git a/Plugins/EditChannels/EditChannels.plugin.js b/Plugins/EditChannels/EditChannels.plugin.js index e52f91c3d9..619dd219c9 100644 --- a/Plugins/EditChannels/EditChannels.plugin.js +++ b/Plugins/EditChannels/EditChannels.plugin.js @@ -2,7 +2,7 @@ * @name EditChannels * @author DevilBro * @authorId 278543574059057154 - * @version 4.3.7 + * @version 4.3.8 * @description Allows you to locally edit Channels * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,13 +17,8 @@ module.exports = (_ => { "info": { "name": "EditChannels", "author": "DevilBro", - "version": "4.3.7", + "version": "4.3.8", "description": "Allows you to locally edit Channels" - }, - "changeLog": { - "fixed": { - "App Title": "Fixed an Issue where a changed App Title for a changed Channel would persist to the Friends Page" - } } }; @@ -101,7 +96,7 @@ module.exports = (_ => { AutocompleteChannelResult: "render", GuildSettingsAuditLogEntry: "render", SettingsInvites: "render", - HeaderBarContainer: "render", + HeaderBarContainer: "default", ChannelCategoryItem: "type", ChannelItem: "default", GuildSidebarThreadListEntry: "type", @@ -114,7 +109,7 @@ module.exports = (_ => { ThreadCreated: "default", AutocompleteChannelResult: "render", GuildSettingsAuditLogEntry: "render", - HeaderBarContainer: "render", + HeaderBarContainer: "default", ThreadSidebar: "default", ThreadCard: "type", FocusRing: "default", @@ -223,8 +218,7 @@ module.exports = (_ => { this.changeAppTitle(); BDFDB.PatchUtils.forceAllUpdates(this); - BDFDB.ChannelUtils.rerenderAll(instant); - BDFDB.ReactUtils.forceUpdate(BDFDB.ReactUtils.findOwner(document.querySelector(BDFDB.dotCN.app), {name: "Channel", unlimited: true})); + BDFDB.DiscordUtils.rerenderAll(instant); } onChannelContextMenu (e) { diff --git a/Plugins/EditUsers/EditUsers.plugin.js b/Plugins/EditUsers/EditUsers.plugin.js index e5464d7937..de2fb8be45 100644 --- a/Plugins/EditUsers/EditUsers.plugin.js +++ b/Plugins/EditUsers/EditUsers.plugin.js @@ -2,7 +2,7 @@ * @name EditUsers * @author DevilBro * @authorId 278543574059057154 - * @version 4.5.4 + * @version 4.5.6 * @description Allows you to locally edit Users * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,13 +17,8 @@ module.exports = (_ => { "info": { "name": "EditUsers", "author": "DevilBro", - "version": "4.5.5", + "version": "4.5.6", "description": "Allows you to locally edit Users" - }, - "changeLog": { - "fixed": { - "App Title": "Fixed an Issue where a changed App Title for a changed User DM would persist to the Friends Page" - } } }; @@ -104,7 +99,7 @@ module.exports = (_ => { this.patchedModules = { before: { - HeaderBarContainer: "render", + HeaderBarContainer: "default", ChannelEditorContainer: "render", AutocompleteUserResult: "render", UserBanner: "default", @@ -206,6 +201,12 @@ module.exports = (_ => { onStart () { let observer = new MutationObserver(_ => {this.changeAppTitle();}); BDFDB.ObserverUtils.connect(this, document.head.querySelector("title"), {name: "appTitleObserver", instance: observer}, {childList: true}); + + BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.StageChannelUtils, "getMutableParticipants", {after: e => { + if (BDFDB.ArrayUtils.is(e.returnValue)) for (let i in e.returnValue) { + if (e.returnValue[i] && e.returnValue[i].user && changedUsers[e.returnValue[i].user.id]) e.returnValue[i] = Object.assign({}, e.returnValue[i], {user: this.getUserData(e.returnValue[i].user.id)}); + } + }}); BDFDB.PatchUtils.patch(this, BDFDB.LibraryModules.MessageAuthorUtils, ["default", "getMessageAuthor"], {after: e => { if (this.settings.places.chatWindow && e.methodArguments[0] && e.methodArguments[0].author && changedUsers[e.methodArguments[0].author.id] && this.shouldChangeInChat(e.methodArguments[0].channel_id)) { @@ -363,15 +364,10 @@ module.exports = (_ => { forceUpdateAll () { changedUsers = BDFDB.DataUtils.load(this, "users"); - // REMOVE 21.04.2022 - for (let id in changedUsers) if (changedUsers[id].color5) { - changedUsers[id].color2 = changedUsers[id].color5; - delete changedUsers[id].color5; - } this.changeAppTitle(); BDFDB.PatchUtils.forceAllUpdates(this); - BDFDB.MessageUtils.rerenderAll(); + BDFDB.DiscordUtils.rerenderAll(); } onDMContextMenu (e) { @@ -685,8 +681,6 @@ module.exports = (_ => { e.instance.props.currentUser = this.getUserData(e.instance.props.currentUser.id); if (data && (data.removeStatus || data.status || data.statusEmoji)) e.instance.props.customStatusActivity = this.createCustomStatus(data); } - else { - } } } @@ -793,7 +787,8 @@ module.exports = (_ => { else this.changeUserColor(messageUsername, author.id, {guildId: (BDFDB.LibraryModules.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id}); } } - this.injectBadge(e.returnvalue.props.children, author.id, (BDFDB.LibraryModules.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id, e.instance.props.compact ? 0 : 2, { + let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "Popout"}); + if (index > -1) this.injectBadge(children, author.id, (BDFDB.LibraryModules.ChannelStore.getChannel(e.instance.props.message.channel_id) || {}).guild_id, e.instance.props.compact ? index : (index + 1), { tagClass: e.instance.props.compact ? BDFDB.disCN.messagebottagcompact : BDFDB.disCN.messagebottagcozy, useRem: true }); @@ -944,7 +939,10 @@ module.exports = (_ => { }; changeMentionName(mention); } - if (data.color1) mention.props.color = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(data.color1) ? data.color1[0] : data.color1, "INT"); + if (data.color1) { + mention.props.color = BDFDB.ColorUtils.convert(BDFDB.ObjectUtils.is(data.color1) ? data.color1[0] : data.color1, "INT"); + if (mention.props.children && mention.props.children.props) mention.props.children.props.color = mention.props.color; + } } processChannelReply (e) { diff --git a/Plugins/StaffTag/StaffTag.plugin.js b/Plugins/StaffTag/StaffTag.plugin.js index 86620d321a..792fa9ac3f 100644 --- a/Plugins/StaffTag/StaffTag.plugin.js +++ b/Plugins/StaffTag/StaffTag.plugin.js @@ -2,7 +2,7 @@ * @name StaffTag * @author DevilBro * @authorId 278543574059057154 - * @version 1.5.0 + * @version 1.5.1 * @description Adds a Crown/Tag to Server Owners (or Admins/Management) * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,13 +17,8 @@ module.exports = (_ => { "info": { "name": "StaffTag", "author": "DevilBro", - "version": "1.5.0", + "version": "1.5.1", "description": "Adds a Crown/Tag to Server Owners (or Admins/Management)" - }, - "changeLog": { - "added": { - "More Management Permission Sub Types": "Added new Sub Types (Threads, Event, Voice Channels [kick, mute, move])" - } } }; @@ -250,9 +245,11 @@ module.exports = (_ => { processMessageUsername (e) { if (!e.instance.props.message || !this.settings.tagPlaces.chat) return; + let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "Popout"}); + if (index == -1) return; const author = e.instance.props.userOverride || e.instance.props.message.author; let userType = this.getUserType(author, e.instance.props.message.channel_id); - if (userType) this.injectStaffTag(e.returnvalue.props.children, author, userType, e.instance.props.compact ? 0 : 2, { + if (userType) this.injectStaffTag(children, author, userType, e.instance.props.compact ? index : (index + 1), { channelId: e.instance.props.message.channel_id, tagClass: e.instance.props.compact ? BDFDB.disCN.messagebottagcompact : BDFDB.disCN.messagebottagcozy, useRem: true diff --git a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js index 4807d6c557..71819ce44c 100644 --- a/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js +++ b/Plugins/TopRoleEverywhere/TopRoleEverywhere.plugin.js @@ -2,7 +2,7 @@ * @name TopRoleEverywhere * @author DevilBro * @authorId 278543574059057154 - * @version 3.0.7 + * @version 3.0.8 * @description Adds the highest Role of a User as a Tag * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -17,13 +17,8 @@ module.exports = (_ => { "info": { "name": "TopRoleEverywhere", "author": "DevilBro", - "version": "3.0.7", + "version": "3.0.8", "description": "Adds the highest Role of a User as a Tag" - }, - "changeLog": { - "fixed": { - "Role/ID Swap": "Added Option to swap userId/role" - } } }; @@ -184,12 +179,14 @@ module.exports = (_ => { processMessageUsername (e) { if (!e.instance.props.message) return; + let [children, index] = BDFDB.ReactUtils.findParent(e.returnvalue, {name: "Popout"}); + if (index == -1) return; const author = e.instance.props.userOverride || e.instance.props.message.author; - if (this.settings.places.chat) this.injectRoleTag(e.returnvalue.props.children, author, "chat", e.instance.props.compact ? 0 : 2, { + if (this.settings.places.chat) this.injectRoleTag(children, author, "chat", e.instance.props.compact ? index : (index + 1), { tagClass: e.instance.props.compact ? BDFDB.disCN.messagebottagcompact : BDFDB.disCN.messagebottagcozy, useRem: true }); - if (this.settings.general.addUserId) this.injectIdTag(e.returnvalue.props.children, author, "chat", (e.instance.props.compact ? 0 : 2) + (this.settings.general.userIdFirst ? 0 : 1), { + if (this.settings.general.addUserId) this.injectIdTag(e.returnvalue.props.children, author, "chat", (e.instance.props.compact ? index : (index + 1)) + (this.settings.general.userIdFirst ? 0 : 1), { tagClass: e.instance.props.compact ? BDFDB.disCN.messagebottagcompact : BDFDB.disCN.messagebottagcozy, useRem: true });