Merge branch 'kmmiio99o:main' into main
This commit is contained in:
commit
d7255b2d39
4 changed files with 16 additions and 60 deletions
|
|
@ -75,7 +75,7 @@ const config = {
|
|||
constModules: {
|
||||
globals: {
|
||||
"bunny-build-info": {
|
||||
version: `"1.4.1.3"`,
|
||||
version: `"1.4.1.4"`,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ export const getCorePlugins = (): CorePluginRecord => ({
|
|||
"bunny.quickinstall": makeLazyPlugin(() => require("./quickinstall"), true),
|
||||
"bunny.badges": makeLazyPlugin(() => require("./badges")),
|
||||
"bunny.notrack": makeLazyPlugin(() => require("./notrack")),
|
||||
"bunny.messagefix": makeLazyPlugin(() => require("./messagefix")),
|
||||
"bunny.fixembed": makeLazyPlugin(() => require("./fixembed")),
|
||||
"bunny.favouriteanything": makeLazyPlugin(() => require("./favouriteanything")),
|
||||
"bunny.nodelete": makeLazyPlugin(() => require("./nodelete")),
|
||||
|
|
|
|||
|
|
@ -1,58 +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: "Win8.1VMUser (plugin by ShiggyCord Team)" }],
|
||||
},
|
||||
},
|
||||
|
||||
start() {
|
||||
// Save original function
|
||||
originalSendMessage = MessageActions.sendMessage;
|
||||
|
||||
// Replace with our implementation
|
||||
MessageActions.sendMessage = function (
|
||||
channelId: unknown,
|
||||
message: unknown,
|
||||
replyRef: unknown,
|
||||
options: Record<string, unknown>,
|
||||
) {
|
||||
// Ensure options exists and has a nonce
|
||||
options = options || {};
|
||||
if (!options.nonce) {
|
||||
options.nonce = (BigInt(Date.now() - 1420070400000) << 22n).toString();
|
||||
}
|
||||
|
||||
// Call original with fixed parameters
|
||||
return (originalSendMessage as Function).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");
|
||||
},
|
||||
});
|
||||
|
|
@ -29,6 +29,9 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
|||
IconComponent: () => <TableRow.Icon source={row.icon} />,
|
||||
usePredicate: row.usePredicate,
|
||||
useTrailing: row.useTrailing,
|
||||
useTitle: row.title,
|
||||
useBadge: () => undefined,
|
||||
useIcon: () => row.icon,
|
||||
onPress: wrapOnPress(row.onPress, null, row.render, row.title()),
|
||||
withArrow: true,
|
||||
...row.rawTabsConfig,
|
||||
|
|
@ -48,6 +51,10 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
|||
VendettaCustomPage: {
|
||||
type: "route",
|
||||
title: () => "ShiggyCord",
|
||||
useTitle: () => "ShiggyCord",
|
||||
useIcon: () => undefined,
|
||||
useBadge: () => undefined,
|
||||
IconComponent: () => undefined,
|
||||
screen: {
|
||||
route: "VendettaCustomPage",
|
||||
getComponent: () => CustomPageRenderer,
|
||||
|
|
@ -56,6 +63,10 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
|||
SHIGGYCORD_CUSTOM_PAGE: {
|
||||
type: "route",
|
||||
title: () => "ShiggyCord",
|
||||
useTitle: () => "ShiggyCord",
|
||||
useIcon: () => undefined,
|
||||
useBadge: () => undefined,
|
||||
IconComponent: () => undefined,
|
||||
screen: {
|
||||
route: "SHIGGYCORD_CUSTOM_PAGE",
|
||||
getComponent: () => CustomPageRenderer,
|
||||
|
|
@ -64,6 +75,10 @@ export function patchTabsUI(unpatches: (() => void | boolean)[]) {
|
|||
BUNNY_CUSTOM_PAGE: {
|
||||
type: "route",
|
||||
title: () => "ShiggyCord",
|
||||
useTitle: () => "ShiggyCord",
|
||||
useIcon: () => undefined,
|
||||
useBadge: () => undefined,
|
||||
IconComponent: () => undefined,
|
||||
screen: {
|
||||
route: "BUNNY_CUSTOM_PAGE",
|
||||
getComponent: () => CustomPageRenderer,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue