diff --git a/Library/0BDFDB.plugin.js b/Library/0BDFDB.plugin.js index be6ec98825..19fa5c20c8 100644 --- a/Library/0BDFDB.plugin.js +++ b/Library/0BDFDB.plugin.js @@ -2,7 +2,7 @@ * @name BDFDB * @author DevilBro * @authorId 278543574059057154 - * @version 2.7.7 + * @version 2.7.8 * @description Required Library for DevilBro's Plugins * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -8013,6 +8013,8 @@ module.exports = (_ => { before: [ "BlobMask", "EmojiPickerListRow", + "Menu", + "MessageActionsContextMenu", "MessageHeader", "SearchBar" ], @@ -8226,6 +8228,9 @@ module.exports = (_ => { Internal.processMemberListItem = function (e) { Internal._processAvatarMount(e.instance.props.user, e.node.querySelector(BDFDB.dotCN.avatarwrapper), e.node); }; + Internal.processMessageActionsContextMenu = function (e) { + e.instance.props.updatePosition = _ => {}; + }; Internal.processMessageHeader = function (e) { if (e.instance.props.message && e.instance.props.message.author) { if (e.instance.props.avatar && e.instance.props.avatar.props && typeof e.instance.props.avatar.props.children == "function") { @@ -8281,8 +8286,11 @@ module.exports = (_ => { let module = e.methodArguments[0] && (e.methodArguments[0].type || e.methodArguments[0].render || e.methodArguments[0]); if (!module || typeof module != "function") return; if (PluginStores.modulePatches.before) for (const type in PluginStores.modulePatches.before) if (Internal.isCorrectModule(module, type, true)) { - let children = [...e.methodArguments].slice(2); - if (children.length && (!e.methodArguments[1].children || !e.methodArguments[1].children.length)) e.methodArguments[1].children = children; + let hasArgumentChildren = false, children = [...e.methodArguments].slice(2); + if (children.length && e.methodArguments[1].children === undefined) { + hasArgumentChildren = true; + e.methodArguments[1].children = children; + } for (let plugin of PluginStores.modulePatches.before[type].flat(10)) Internal.initiatePatch(plugin, type, { arguments: e.methodArguments, instance: {props: e.methodArguments[1]}, @@ -8292,6 +8300,11 @@ module.exports = (_ => { methodname: "default", patchtypes: ["before"] }); + if (hasArgumentChildren) { + [].splice.call(e.methodArguments, 2); + for (let child of e.methodArguments[1].children) [].push.call(e.methodArguments, child); + delete e.methodArguments[1].children; + } break; } if (PluginStores.modulePatches.after && module.prototype && typeof module.prototype.render == "function") { diff --git a/Library/_res/0BDFDB.data.json b/Library/_res/0BDFDB.data.json index 450cf785b5..9eb3fca77d 100644 --- a/Library/_res/0BDFDB.data.json +++ b/Library/_res/0BDFDB.data.json @@ -333,7 +333,6 @@ "GuildEntryContextMenu": "guild-entry-context", "GuildHeaderContextMenu": "guild-header-popout", "ImageContextMenu": "image-context", - "MessageActionsContextMenu": "message-actions", "MessageContextMenu": "message", "ThreadContextMenu": "thread-context", "UserContextMenu": "user-context", @@ -368,10 +367,12 @@ "Menu": {"strings": ["\"empty\"", "getItemProps", "isUsingKeyboardNavigation"]}, "Message": {"strings": ["childrenMessageContent", "childrenRepliedMessage", "zalgo", ".buttonContainer"]}, "MessageAccessories": {"protos": ["renderGiftCodes", "renderEmbeds", "renderActivityInvite"]}, + "MessageActionsContextMenu": {"strings": ["REPORT_MESSAGE_MENU_OPTION", "message-actions"]}, "MessageContextMenu": {"strings": ["MESSAGE_ACTIONS_MENU_LABEL", "navId:\"message", "getGuildId"]}, "MessageHeader": {"strings": ["showTimestampOnHover", "usernameClassName", "isVisibleOnlyOnHover:"]}, "Messages": {"strings": ["messageGroupSpacing", "groupSpacing", "jumpToPresent"]}, "MessageSearchResultContextMenu": {"strings": ["MESSAGE_ACTIONS_MENU_LABEL", "navId:\"message"], "nonStrings": ["getGuildId"]}, + "MessageToolbar": {"strings": ["Messages.MORE", "hasDeveloperMode", "openPopoutType"]}, "ModalCarousel": {"strings": [".gotoNext", "currentIndex", "gotoPrevThrottled"]}, "NowPlayingHeader": {"strings": ["ACTIVITY_FEED_NOW_PLAYING_HEADER", "partiedMembers"]}, "NowPlayingItem": {"strings": [".wrapper", "padded:"]}, diff --git a/Plugins/BetterNsfwTag/BetterNsfwTag.plugin.js b/Plugins/BetterNsfwTag/BetterNsfwTag.plugin.js index 37770612ce..7b54b8465e 100644 --- a/Plugins/BetterNsfwTag/BetterNsfwTag.plugin.js +++ b/Plugins/BetterNsfwTag/BetterNsfwTag.plugin.js @@ -2,7 +2,7 @@ * @name BetterNsfwTag * @author DevilBro * @authorId 278543574059057154 - * @version 1.3.1 + * @version 1.3.2 * @description Adds a more noticeable Tag to NSFW Channels * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -59,7 +59,7 @@ module.exports = (_ => { return class BetterNsfwTag extends Plugin { onLoad () { this.modulePatches = { - after: [ + before: [ "ChannelItem" ] }; diff --git a/Plugins/CopyRawMessage/CopyRawMessage.plugin.js b/Plugins/CopyRawMessage/CopyRawMessage.plugin.js index 01f073892f..8ec8f5d268 100644 --- a/Plugins/CopyRawMessage/CopyRawMessage.plugin.js +++ b/Plugins/CopyRawMessage/CopyRawMessage.plugin.js @@ -2,7 +2,7 @@ * @name CopyRawMessage * @author DevilBro * @authorId 278543574059057154 - * @version 1.1.3 + * @version 1.1.4 * @description Allows you to copy the raw Contents of a Message * @invite Jx3TjNS * @donate https://www.paypal.me/MircoWittrien @@ -57,7 +57,14 @@ module.exports = (_ => { } } : (([Plugin, BDFDB]) => { return class CopyRawMessage extends Plugin { - onLoad () {} + onLoad () { + this.modulePatches = { + after: [ + "MessageActionsContextMenu", + "MessageToolbar" + ] + }; + } onStart () {} @@ -107,27 +114,24 @@ module.exports = (_ => { }) ].filter(n => n); if (entries.length) { - let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "devmode-copy-id", group: true}); - children.splice(index > -1 ? index : children.length, 0, ); - children.splice(index > -1 ? index : children.length, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuGroup, { - children: entries.length > 1 ? BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { - label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT, - id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-raw-submenu"), - children: entries.map(n => { - n.props.label = n.props.type; - delete n.props.type; - delete n.props.icon; - return n; - }) - }) : entries - })); + let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "copy-link"}); + children.splice(index > -1 ? index + 1 : children.length, 0, entries.length > 1 ? BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { + label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT, + id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-raw-submenu"), + children: entries.map(n => { + n.props.label = n.props.type; + delete n.props.type; + delete n.props.icon; + return n; + }) + }) : entries); } } } - onMessageOptionContextMenu (e) { + processMessageActionsContextMenu (e) { if (e.instance.props.message && e.instance.props.message.content) { - let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "mark-unread"}); + let [children, index] = BDFDB.ContextMenuUtils.findItem(e.returnvalue, {id: "copy-link"}); children.splice(index + 1, 0, BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, { label: BDFDB.LanguageUtils.LanguageStrings.COPY_TEXT + " (Raw)", id: BDFDB.ContextMenuUtils.createItemId(this.name, "copy-message-raw"), @@ -139,7 +143,7 @@ module.exports = (_ => { } } - onMessageOptionToolbar (e) { + processMessageToolbar (e) { if (e.instance.props.expanded && e.instance.props.message && e.instance.props.channel) { e.returnvalue.props.children.unshift(BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TooltipContainer, { key: "copy-message-raw",