diff --git a/src/core/plugins/index.ts b/src/core/plugins/index.ts index 5bc2f76..7b423f7 100644 --- a/src/core/plugins/index.ts +++ b/src/core/plugins/index.ts @@ -1,25 +1,22 @@ import { PluginInstanceInternal } from "@lib/addons/plugins/types"; interface CorePlugin { - default: PluginInstanceInternal; - preenabled: boolean; + default: PluginInstanceInternal; + preenabled: boolean; } // Called from @lib/plugins export const getCorePlugins = (): Record => ({ - "bunny.quickinstall": require("./quickinstall"), - "bunny.badges": require("./badges"), - "bunny.notrack": { ...require("./notrack"), preenabled: true }, - "bunny.messagefix": { default: require("./messagefix"), preenabled: true }, + "bunny.quickinstall": require("./quickinstall"), + "bunny.badges": require("./badges"), + "vendetta.notrack": require("./notrack") }); /** * @internal */ -export function defineCorePlugin( - instance: PluginInstanceInternal, -): PluginInstanceInternal { - // @ts-expect-error - instance[Symbol.for("bunny.core.plugin")] = true; - return instance; +export function defineCorePlugin(instance: PluginInstanceInternal): PluginInstanceInternal { + // @ts-expect-error + instance[Symbol.for("bunny.core.plugin")] = true; + return instance; } diff --git a/src/core/plugins/messagefix/index.ts b/src/core/plugins/messagefix/index.ts deleted file mode 100644 index 146bf2b..0000000 --- a/src/core/plugins/messagefix/index.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { defineCorePlugin } from ".."; -import { findByProps } from "@metro"; -import { logger } from "@lib/utils/logger"; - -// Find the MessageActions module -const MessageActions = findByProps("sendMessage"); -let originalSendMessage: Function; - -export default defineCorePlugin({ - manifest: { - id: "bunny.messagefix", - version: "1.0.0", - type: "plugin", - spec: 3, - main: "", - display: { - name: "MessageFix", - description: "Ensures messages include the required nonce parameter", - authors: [{ name: "ShiggyCord Team" }], - }, - }, - - start() { - // Save original function - originalSendMessage = MessageActions.sendMessage; - - // Replace with our implementation - MessageActions.sendMessage = function ( - channelId, - message, - replyRef, - options, - ) { - // Ensure options exists and has a nonce - options = options || {}; - options.nonce = options.nonce || Date.now().toString(); - - // Call original with fixed parameters - return originalSendMessage.call( - this, - channelId, - message, - replyRef, - options, - ); - }; - - logger.log("MessageFix: Enabled - adding nonce to all messages"); - }, - - stop() { - // Restore original function - if (originalSendMessage) MessageActions.sendMessage = originalSendMessage; - logger.log("MessageFix: Disabled"); - }, -});