mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-10 18:06:22 +00:00
Merge branch 'main' into main
This commit is contained in:
commit
d8b71cb938
18 changed files with 116 additions and 250 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "vencord",
|
"name": "vencord",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"version": "1.8.8",
|
"version": "1.8.9",
|
||||||
"description": "The cutest Discord client mod",
|
"description": "The cutest Discord client mod",
|
||||||
"homepage": "https://github.com/Vendicated/Vencord#readme",
|
"homepage": "https://github.com/Vendicated/Vencord#readme",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -75,9 +75,11 @@ const IGNORED_DISCORD_ERRORS = [
|
||||||
"Attempting to set fast connect zstd when unsupported"
|
"Attempting to set fast connect zstd when unsupported"
|
||||||
] as Array<string | RegExp>;
|
] as Array<string | RegExp>;
|
||||||
|
|
||||||
function toCodeBlock(s: string) {
|
function toCodeBlock(s: string, indentation = 0, isDiscord = false) {
|
||||||
s = s.replace(/```/g, "`\u200B`\u200B`");
|
s = s.replace(/```/g, "`\u200B`\u200B`");
|
||||||
return "```" + s + " ```";
|
|
||||||
|
const indentationStr = Array(indentation).fill(" ").join("");
|
||||||
|
return `\`\`\`\n${s.split("\n").map(s => indentationStr + s).join("\n")}\n${!isDiscord ? indentationStr : ""}\`\`\``;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function printReport() {
|
async function printReport() {
|
||||||
|
@ -91,35 +93,35 @@ async function printReport() {
|
||||||
report.badPatches.forEach(p => {
|
report.badPatches.forEach(p => {
|
||||||
console.log(`- ${p.plugin} (${p.type})`);
|
console.log(`- ${p.plugin} (${p.type})`);
|
||||||
console.log(` - ID: \`${p.id}\``);
|
console.log(` - ID: \`${p.id}\``);
|
||||||
console.log(` - Match: ${toCodeBlock(p.match)}`);
|
console.log(` - Match: ${toCodeBlock(p.match, " - Match: ".length)}`);
|
||||||
if (p.error) console.log(` - Error: ${toCodeBlock(p.error)}`);
|
if (p.error) console.log(` - Error: ${toCodeBlock(p.error, " - Error: ".length)}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
|
|
||||||
console.log("## Bad Webpack Finds");
|
console.log("## Bad Webpack Finds");
|
||||||
report.badWebpackFinds.forEach(p => console.log("- " + p));
|
report.badWebpackFinds.forEach(p => console.log("- " + toCodeBlock(p, "- ".length)));
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
|
|
||||||
console.log("## Bad Starts");
|
console.log("## Bad Starts");
|
||||||
report.badStarts.forEach(p => {
|
report.badStarts.forEach(p => {
|
||||||
console.log(`- ${p.plugin}`);
|
console.log(`- ${p.plugin}`);
|
||||||
console.log(` - Error: ${toCodeBlock(p.error)}`);
|
console.log(` - Error: ${toCodeBlock(p.error, " - Error: ".length)}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
|
|
||||||
console.log("## Discord Errors");
|
console.log("## Discord Errors");
|
||||||
report.otherErrors.forEach(e => {
|
report.otherErrors.forEach(e => {
|
||||||
console.log(`- ${toCodeBlock(e)}`);
|
console.log(`- ${toCodeBlock(e, "- ".length)}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
|
|
||||||
console.log("## Ignored Discord Errors");
|
console.log("## Ignored Discord Errors");
|
||||||
report.ignoredErrors.forEach(e => {
|
report.ignoredErrors.forEach(e => {
|
||||||
console.log(`- ${toCodeBlock(e)}`);
|
console.log(`- ${toCodeBlock(e, "- ".length)}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log();
|
console.log();
|
||||||
|
@ -141,16 +143,16 @@ async function printReport() {
|
||||||
const lines = [
|
const lines = [
|
||||||
`**__${p.plugin} (${p.type}):__**`,
|
`**__${p.plugin} (${p.type}):__**`,
|
||||||
`ID: \`${p.id}\``,
|
`ID: \`${p.id}\``,
|
||||||
`Match: ${toCodeBlock(p.match)}`
|
`Match: ${toCodeBlock(p.match, "Match: ".length, true)}`
|
||||||
];
|
];
|
||||||
if (p.error) lines.push(`Error: ${toCodeBlock(p.error)}`);
|
if (p.error) lines.push(`Error: ${toCodeBlock(p.error, "Error: ".length, true)}`);
|
||||||
return lines.join("\n");
|
return lines.join("\n");
|
||||||
}).join("\n\n") || "None",
|
}).join("\n\n") || "None",
|
||||||
color: report.badPatches.length ? 0xff0000 : 0x00ff00
|
color: report.badPatches.length ? 0xff0000 : 0x00ff00
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Bad Webpack Finds",
|
title: "Bad Webpack Finds",
|
||||||
description: report.badWebpackFinds.map(toCodeBlock).join("\n") || "None",
|
description: report.badWebpackFinds.map(f => toCodeBlock(f, 0, true)).join("\n") || "None",
|
||||||
color: report.badWebpackFinds.length ? 0xff0000 : 0x00ff00
|
color: report.badWebpackFinds.length ? 0xff0000 : 0x00ff00
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -158,7 +160,7 @@ async function printReport() {
|
||||||
description: report.badStarts.map(p => {
|
description: report.badStarts.map(p => {
|
||||||
const lines = [
|
const lines = [
|
||||||
`**__${p.plugin}:__**`,
|
`**__${p.plugin}:__**`,
|
||||||
toCodeBlock(p.error)
|
toCodeBlock(p.error, 0, true)
|
||||||
];
|
];
|
||||||
return lines.join("\n");
|
return lines.join("\n");
|
||||||
}
|
}
|
||||||
|
@ -167,7 +169,7 @@ async function printReport() {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Discord Errors",
|
title: "Discord Errors",
|
||||||
description: report.otherErrors.length ? toCodeBlock(report.otherErrors.join("\n")) : "None",
|
description: report.otherErrors.length ? toCodeBlock(report.otherErrors.join("\n"), 0, true) : "None",
|
||||||
color: report.otherErrors.length ? 0xff0000 : 0x00ff00
|
color: report.otherErrors.length ? 0xff0000 : 0x00ff00
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
@ -93,17 +93,13 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: ".PANEL]:14",
|
find: ".PANEL]:14",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=\i=\(0,\i\.default\)\(\i\);)return 0===\i.length/,
|
match: /(?<=(\i)=\(0,\i\.default\)\(\i\);)return 0===\i.length\?/,
|
||||||
replace: "$& && $self.getBadges(arguments[0]?.displayProfile).length===0"
|
replace: "$1.unshift(...$self.getBadges(arguments[0].displayProfile));$&"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: ".description,delay:",
|
find: ".description,delay:",
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
|
||||||
match: /...(\i)\}=\(0,\i\.useUserProfileAnalyticsContext\)\(\);/,
|
|
||||||
replace: "$&arguments[0].badges?.unshift(...$self.getBadges($1));"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
// alt: "", aria-hidden: false, src: originalSrc
|
// alt: "", aria-hidden: false, src: originalSrc
|
||||||
match: /alt:" ","aria-hidden":!0,src:(?=.{0,20}(\i)\.icon)/,
|
match: /alt:" ","aria-hidden":!0,src:(?=.{0,20}(\i)\.icon)/,
|
||||||
|
|
|
@ -60,6 +60,7 @@ export default definePlugin({
|
||||||
// FIXME: remove once change merged to stable
|
// FIXME: remove once change merged to stable
|
||||||
{
|
{
|
||||||
find: "Messages.ACTIVITY_SETTINGS",
|
find: "Messages.ACTIVITY_SETTINGS",
|
||||||
|
noWarn: true,
|
||||||
replacement: {
|
replacement: {
|
||||||
get match() {
|
get match() {
|
||||||
switch (Settings.plugins.Settings.settingsLocation) {
|
switch (Settings.plugins.Settings.settingsLocation) {
|
||||||
|
|
|
@ -16,12 +16,13 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { disableStyle, enableStyle } from "@api/Styles";
|
import { disableStyle, enableStyle } from "@api/Styles";
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { ErrorCard } from "@components/ErrorCard";
|
import { ErrorCard } from "@components/ErrorCard";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import { Margins } from "@utils/margins";
|
import { Margins } from "@utils/margins";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { findByPropsLazy } from "@webpack";
|
||||||
import { Forms, React } from "@webpack/common";
|
import { Forms, React } from "@webpack/common";
|
||||||
|
|
||||||
|
@ -29,6 +30,15 @@ import hideBugReport from "./hideBugReport.css?managed";
|
||||||
|
|
||||||
const KbdStyles = findByPropsLazy("key", "removeBuildOverride");
|
const KbdStyles = findByPropsLazy("key", "removeBuildOverride");
|
||||||
|
|
||||||
|
const settings = definePluginSettings({
|
||||||
|
toolbarDevMenu: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
description: "Change the Help (?) toolbar button (top right in chat) to Discord's developer menu",
|
||||||
|
default: false,
|
||||||
|
restartNeeded: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "Experiments",
|
name: "Experiments",
|
||||||
description: "Enable Access to Experiments & other dev-only features in Discord!",
|
description: "Enable Access to Experiments & other dev-only features in Discord!",
|
||||||
|
@ -40,6 +50,8 @@ export default definePlugin({
|
||||||
Devs.Nuckyz
|
Devs.Nuckyz
|
||||||
],
|
],
|
||||||
|
|
||||||
|
settings,
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "Object.defineProperties(this,{isDeveloper",
|
find: "Object.defineProperties(this,{isDeveloper",
|
||||||
|
@ -68,6 +80,16 @@ export default definePlugin({
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\i\.isStaff\(\)/,
|
match: /\i\.isStaff\(\)/,
|
||||||
replace: "true"
|
replace: "true"
|
||||||
|
},
|
||||||
|
predicate: () => settings.store.toolbarDevMenu
|
||||||
|
},
|
||||||
|
|
||||||
|
// makes the Favourites Server experiment allow favouriting DMs and threads
|
||||||
|
{
|
||||||
|
find: "useCanFavoriteChannel",
|
||||||
|
replacement: {
|
||||||
|
match: /!\(\i\.isDM\(\)\|\|\i\.isThread\(\)\)/,
|
||||||
|
replace: "true",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
@ -338,7 +338,7 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
// Call our function to decide whether the embed should be ignored or not
|
// Call our function to decide whether the embed should be ignored or not
|
||||||
predicate: () => settings.store.transformEmojis || settings.store.transformStickers,
|
predicate: () => settings.store.transformEmojis || settings.store.transformStickers,
|
||||||
match: /(renderEmbeds\((\i)\){)(.+?embeds\.map\((\i)=>{)/,
|
match: /(renderEmbeds\((\i)\){)(.+?embeds\.map\(\((\i),\i\)?=>{)/,
|
||||||
replace: (_, rest1, message, rest2, embed) => `${rest1}const fakeNitroMessage=${message};${rest2}if($self.shouldIgnoreEmbed(${embed},fakeNitroMessage))return null;`
|
replace: (_, rest1, message, rest2, embed) => `${rest1}const fakeNitroMessage=${message};${rest2}if($self.shouldIgnoreEmbed(${embed},fakeNitroMessage))return null;`
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -281,6 +281,8 @@ function getChannelLabelAndIconUrl(channel: Channel) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ChannelMessageEmbedAccessory({ message, channel }: MessageEmbedProps): JSX.Element | null {
|
function ChannelMessageEmbedAccessory({ message, channel }: MessageEmbedProps): JSX.Element | null {
|
||||||
|
const compact = TextAndImagesSettingsStores.MessageDisplayCompact.useSetting();
|
||||||
|
|
||||||
const dmReceiver = UserStore.getUser(ChannelStore.getChannel(channel.id).recipients?.[0]);
|
const dmReceiver = UserStore.getUser(ChannelStore.getChannel(channel.id).recipients?.[0]);
|
||||||
|
|
||||||
const [channelLabel, iconUrl] = getChannelLabelAndIconUrl(channel);
|
const [channelLabel, iconUrl] = getChannelLabelAndIconUrl(channel);
|
||||||
|
@ -305,6 +307,7 @@ function ChannelMessageEmbedAccessory({ message, channel }: MessageEmbedProps):
|
||||||
message={message}
|
message={message}
|
||||||
channel={channel}
|
channel={channel}
|
||||||
subscribeToComponentDispatch={false}
|
subscribeToComponentDispatch={false}
|
||||||
|
compact={compact}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -302,7 +302,7 @@ export default definePlugin({
|
||||||
replace: "$1" +
|
replace: "$1" +
|
||||||
".update($3,m =>" +
|
".update($3,m =>" +
|
||||||
" (($2.message.flags & 64) === 64 || $self.shouldIgnore($2.message, true)) ? m :" +
|
" (($2.message.flags & 64) === 64 || $self.shouldIgnore($2.message, true)) ? m :" +
|
||||||
" $2.message.content !== m.editHistory?.[0]?.content && $2.message.content !== m.content ?" +
|
" $2.message.edited_timestamp && $2.message.content !== m.content ?" +
|
||||||
" m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) :" +
|
" m.set('editHistory',[...(m.editHistory || []), $self.makeEdit($2.message, m)]) :" +
|
||||||
" m" +
|
" m" +
|
||||||
")" +
|
")" +
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
import { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, openModalLazy } from "@utils/modal";
|
import { ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, openModalLazy } from "@utils/modal";
|
||||||
import { extractAndLoadChunksLazy, findComponentByCodeLazy } from "@webpack";
|
import { extractAndLoadChunksLazy, findComponentByCodeLazy, findExportedComponentLazy } from "@webpack";
|
||||||
import { Button, Forms, Text, TextInput, Toasts, useEffect, useState } from "@webpack/common";
|
import { Button, Forms, Text, TextInput, Toasts, useEffect, useState } from "@webpack/common";
|
||||||
|
|
||||||
import { DEFAULT_COLOR, SWATCHES } from "../constants";
|
import { DEFAULT_COLOR, SWATCHES } from "../constants";
|
||||||
|
@ -31,7 +31,7 @@ interface ColorPickerWithSwatchesProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const ColorPicker = findComponentByCodeLazy<ColorPickerProps>(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)");
|
const ColorPicker = findComponentByCodeLazy<ColorPickerProps>(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR", ".BACKGROUND_PRIMARY)");
|
||||||
const ColorPickerWithSwatches = findComponentByCodeLazy<ColorPickerWithSwatchesProps>("presets,", "customColor:");
|
const ColorPickerWithSwatches = findExportedComponentLazy<ColorPickerWithSwatchesProps>("ColorPicker", "CustomColorPicker");
|
||||||
|
|
||||||
export const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}Promise\.all\((\[\i\.\i\(".+?"\).+?\])\).then\(\i\.bind\(\i,"(.+?)"\)\).{0,50}"UserSettings"/);
|
export const requireSettingsMenu = extractAndLoadChunksLazy(['name:"UserSettings"'], /createPromise:.{0,20}Promise\.all\((\[\i\.\i\(".+?"\).+?\])\).then\(\i\.bind\(\i,"(.+?)"\)\).{0,50}"UserSettings"/);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# ResurrectHome
|
|
||||||
|
|
||||||
Brings back the phased out [Server Home](https://support.discord.com/hc/en-us/articles/6156116949911-Server-Home-Beta) feature!
|
|
||||||
|
|
||||||
![](https://github.com/Vendicated/Vencord/assets/61953774/98d5d667-bbb9-48b8-872d-c9b3980f6506)
|
|
|
@ -1,195 +0,0 @@
|
||||||
/*
|
|
||||||
* Vencord, a modification for Discord's desktop app
|
|
||||||
* Copyright (c) 2023 Vendicated and contributors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { findGroupChildrenByChildId } from "@api/ContextMenu";
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
|
||||||
import { Devs } from "@utils/constants";
|
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
|
||||||
import { findByPropsLazy } from "@webpack";
|
|
||||||
import { Button, Menu, Tooltip, useEffect, useState } from "@webpack/common";
|
|
||||||
|
|
||||||
const ChannelRowClasses = findByPropsLazy("modeConnected", "modeLocked", "icon");
|
|
||||||
|
|
||||||
let currentShouldViewServerHome = false;
|
|
||||||
const shouldViewServerHomeStates = new Set<React.Dispatch<React.SetStateAction<boolean>>>();
|
|
||||||
|
|
||||||
function ViewServerHomeButton() {
|
|
||||||
return (
|
|
||||||
<Tooltip text="View Server Home">
|
|
||||||
{tooltipProps => (
|
|
||||||
<Button
|
|
||||||
{...tooltipProps}
|
|
||||||
look={Button.Looks.BLANK}
|
|
||||||
size={Button.Sizes.NONE}
|
|
||||||
innerClassName={ChannelRowClasses.icon}
|
|
||||||
onClick={e => {
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
currentShouldViewServerHome = true;
|
|
||||||
for (const setState of shouldViewServerHomeStates) {
|
|
||||||
setState(true);
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
|
|
||||||
>
|
|
||||||
<svg width="20" height="20" viewBox="0 0 24 24">
|
|
||||||
<path fill="currentColor" d="m2.4 8.4 8.38-6.46a2 2 0 0 1 2.44 0l8.39 6.45a2 2 0 0 1-.79 3.54l-.32.07-.82 8.2a2 2 0 0 1-1.99 1.8H16a1 1 0 0 1-1-1v-5a3 3 0 0 0-6 0v5a1 1 0 0 1-1 1H6.31a2 2 0 0 1-1.99-1.8L3.5 12l-.32-.07a2 2 0 0 1-.79-3.54Z" />
|
|
||||||
</svg>
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function useForceServerHome() {
|
|
||||||
const { forceServerHome } = settings.use(["forceServerHome"]);
|
|
||||||
const [shouldViewServerHome, setShouldViewServerHome] = useState(currentShouldViewServerHome);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
shouldViewServerHomeStates.add(setShouldViewServerHome);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
shouldViewServerHomeStates.delete(setShouldViewServerHome);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return shouldViewServerHome || forceServerHome;
|
|
||||||
}
|
|
||||||
|
|
||||||
function useDisableViewServerHome() {
|
|
||||||
useEffect(() => () => {
|
|
||||||
currentShouldViewServerHome = false;
|
|
||||||
for (const setState of shouldViewServerHomeStates) {
|
|
||||||
setState(false);
|
|
||||||
}
|
|
||||||
}, []);
|
|
||||||
}
|
|
||||||
|
|
||||||
const settings = definePluginSettings({
|
|
||||||
forceServerHome: {
|
|
||||||
type: OptionType.BOOLEAN,
|
|
||||||
description: "Force the Server Guide to be the Server Home tab when it is enabled.",
|
|
||||||
default: false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export default definePlugin({
|
|
||||||
name: "ResurrectHome",
|
|
||||||
description: "Re-enables the Server Home tab when there isn't a Server Guide. Also has an option to force the Server Home over the Server Guide, which is accessible through right-clicking a server.",
|
|
||||||
authors: [Devs.Dolfies, Devs.Nuckyz],
|
|
||||||
settings,
|
|
||||||
|
|
||||||
patches: [
|
|
||||||
// Force home deprecation override
|
|
||||||
{
|
|
||||||
find: "GuildFeatures.GUILD_HOME_DEPRECATION_OVERRIDE",
|
|
||||||
all: true,
|
|
||||||
replacement: [
|
|
||||||
{
|
|
||||||
match: /\i\.hasFeature\(\i\.GuildFeatures\.GUILD_HOME_DEPRECATION_OVERRIDE\)/g,
|
|
||||||
replace: "true"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
},
|
|
||||||
// Disable feedback prompts
|
|
||||||
{
|
|
||||||
find: "GuildHomeFeedbackExperiment.definition.id",
|
|
||||||
replacement: [
|
|
||||||
{
|
|
||||||
match: /return{showFeedback:.+?,setOnDismissedFeedback:(\i)}/,
|
|
||||||
replace: "return{showFeedback:false,setOnDismissedFeedback:$1}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// This feature was never finished, so the patch is disabled
|
|
||||||
|
|
||||||
// Enable guild feed render mode selector
|
|
||||||
// {
|
|
||||||
// find: "2022-01_home_feed_toggle",
|
|
||||||
// replacement: [
|
|
||||||
// {
|
|
||||||
// match: /showSelector:!1/,
|
|
||||||
// replace: "showSelector:true"
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
|
|
||||||
// Fix focusMessage clearing previously cached messages and causing a loop when fetching messages around home messages
|
|
||||||
{
|
|
||||||
find: '"MessageActionCreators"',
|
|
||||||
replacement: {
|
|
||||||
match: /focusMessage\(\i\){.+?(?=focus:{messageId:(\i)})/,
|
|
||||||
replace: "$&after:$1,"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Force Server Home instead of Server Guide
|
|
||||||
{
|
|
||||||
find: "61eef9_2",
|
|
||||||
replacement: {
|
|
||||||
match: /getMutableGuildChannelsForGuild\(\i\);return\(0,\i\.useStateFromStores\).+?\]\)(?=}function)/,
|
|
||||||
replace: m => `${m}&&!$self.useForceServerHome()`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Add View Server Home Button to Server Guide
|
|
||||||
{
|
|
||||||
find: "487e85_1",
|
|
||||||
replacement: {
|
|
||||||
match: /(?<=text:(\i)\?\i\.\i\.Messages\.SERVER_GUIDE:\i\.\i\.Messages\.GUILD_HOME,)/,
|
|
||||||
replace: "trailing:$self.ViewServerHomeButton({serverGuide:$1}),"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// Disable view Server Home override when the Server Home is unmouted
|
|
||||||
{
|
|
||||||
find: "69386d_5",
|
|
||||||
replacement: {
|
|
||||||
match: /location:"69386d_5".+?;/,
|
|
||||||
replace: "$&$self.useDisableViewServerHome();"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
ViewServerHomeButton: ErrorBoundary.wrap(({ serverGuide }: { serverGuide?: boolean; }) => {
|
|
||||||
if (serverGuide !== true) return null;
|
|
||||||
|
|
||||||
return <ViewServerHomeButton />;
|
|
||||||
}),
|
|
||||||
|
|
||||||
useForceServerHome,
|
|
||||||
useDisableViewServerHome,
|
|
||||||
|
|
||||||
contextMenus: {
|
|
||||||
"guild-context"(children, props) {
|
|
||||||
const { forceServerHome } = settings.use(["forceServerHome"]);
|
|
||||||
|
|
||||||
if (!props?.guild) return;
|
|
||||||
|
|
||||||
const group = findGroupChildrenByChildId("hide-muted-channels", children);
|
|
||||||
|
|
||||||
group?.unshift(
|
|
||||||
<Menu.MenuCheckboxItem
|
|
||||||
key="force-server-home"
|
|
||||||
id="force-server-home"
|
|
||||||
label="Force Server Home"
|
|
||||||
checked={forceServerHome}
|
|
||||||
action={() => settings.store.forceServerHome = !forceServerHome}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
|
@ -40,9 +40,16 @@ const settings = definePluginSettings({
|
||||||
default: true,
|
default: true,
|
||||||
description: "Show role colors in the voice chat user list",
|
description: "Show role colors in the voice chat user list",
|
||||||
restartNeeded: true
|
restartNeeded: true
|
||||||
|
},
|
||||||
|
reactorsList: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
default: true,
|
||||||
|
description: "Show role colors in the reactors list",
|
||||||
|
restartNeeded: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "RoleColorEverywhere",
|
name: "RoleColorEverywhere",
|
||||||
authors: [Devs.KingFish, Devs.lewisakura, Devs.AutumnVN],
|
authors: [Devs.KingFish, Devs.lewisakura, Devs.AutumnVN],
|
||||||
|
@ -99,6 +106,14 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
predicate: () => settings.store.voiceUsers,
|
predicate: () => settings.store.voiceUsers,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: ".reactorDefault",
|
||||||
|
replacement: {
|
||||||
|
match: /\.openUserContextMenu\)\((\i),(\i),\i\).{0,250}tag:"strong"/,
|
||||||
|
replace: "$&,style:{color:$self.getColor($2?.id,$1)}"
|
||||||
|
},
|
||||||
|
predicate: () => settings.store.reactorsList,
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settings,
|
settings,
|
||||||
|
|
|
@ -74,15 +74,28 @@ interface ConnectionPlatform {
|
||||||
icon: { lightSVG: string, darkSVG: string; };
|
icon: { lightSVG: string, darkSVG: string; };
|
||||||
}
|
}
|
||||||
|
|
||||||
const profilePopoutComponent = ErrorBoundary.wrap((props: { user: User, displayProfile; }) =>
|
const profilePopoutComponent = ErrorBoundary.wrap(
|
||||||
<ConnectionsComponent id={props.user.id} theme={getProfileThemeProps(props).theme} />
|
(props: { user: User; displayProfile?: any; simplified?: boolean; }) => (
|
||||||
|
<ConnectionsComponent
|
||||||
|
{...props}
|
||||||
|
id={props.user.id}
|
||||||
|
theme={getProfileThemeProps(props).theme}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
{ noop: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
const profilePanelComponent = ErrorBoundary.wrap(({ id }: { id: string; }) =>
|
const profilePanelComponent = ErrorBoundary.wrap(
|
||||||
<ConnectionsComponent id={id} theme={ThemeStore.theme} />
|
(props: { id: string; simplified?: boolean; }) => (
|
||||||
|
<ConnectionsComponent
|
||||||
|
{...props}
|
||||||
|
theme={ThemeStore.theme}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
{ noop: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
function ConnectionsComponent({ id, theme }: { id: string, theme: string; }) {
|
function ConnectionsComponent({ id, theme, simplified }: { id: string, theme: string, simplified?: boolean; }) {
|
||||||
const profile = UserProfileStore.getUserProfile(id);
|
const profile = UserProfileStore.getUserProfile(id);
|
||||||
if (!profile)
|
if (!profile)
|
||||||
return null;
|
return null;
|
||||||
|
@ -91,6 +104,19 @@ function ConnectionsComponent({ id, theme }: { id: string, theme: string; }) {
|
||||||
if (!connections?.length)
|
if (!connections?.length)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
const connectionsContainer = (
|
||||||
|
<Flex style={{
|
||||||
|
marginTop: !simplified ? "8px" : undefined,
|
||||||
|
gap: getSpacingPx(settings.store.iconSpacing),
|
||||||
|
flexWrap: "wrap"
|
||||||
|
}}>
|
||||||
|
{connections.map(connection => <CompactConnectionComponent connection={connection} theme={theme} />)}
|
||||||
|
</Flex>
|
||||||
|
);
|
||||||
|
|
||||||
|
if (simplified)
|
||||||
|
return connectionsContainer;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Section>
|
<Section>
|
||||||
<Text
|
<Text
|
||||||
|
@ -100,13 +126,7 @@ function ConnectionsComponent({ id, theme }: { id: string, theme: string; }) {
|
||||||
>
|
>
|
||||||
Connections
|
Connections
|
||||||
</Text>
|
</Text>
|
||||||
<Flex style={{
|
{connectionsContainer}
|
||||||
marginTop: "8px",
|
|
||||||
gap: getSpacingPx(settings.store.iconSpacing),
|
|
||||||
flexWrap: "wrap"
|
|
||||||
}}>
|
|
||||||
{connections.map(connection => <CompactConnectionComponent connection={connection} theme={theme} />)}
|
|
||||||
</Flex>
|
|
||||||
</Section>
|
</Section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +152,7 @@ function CompactConnectionComponent({ connection, theme }: { connection: Connect
|
||||||
<Tooltip
|
<Tooltip
|
||||||
text={
|
text={
|
||||||
<span className="vc-sc-tooltip">
|
<span className="vc-sc-tooltip">
|
||||||
{connection.name}
|
<span className="vc-sc-connection-name">{connection.name}</span>
|
||||||
{connection.verified && <VerifiedIcon />}
|
{connection.verified && <VerifiedIcon />}
|
||||||
<TooltipIcon height={16} width={16} />
|
<TooltipIcon height={16} width={16} />
|
||||||
</span>
|
</span>
|
||||||
|
@ -188,6 +208,13 @@ export default definePlugin({
|
||||||
match: /\(0,\i\.jsx\)\(\i\.\i,\{\}\).{0,100}setNote:(?=.+?channelId:(\i).id)/,
|
match: /\(0,\i\.jsx\)\(\i\.\i,\{\}\).{0,100}setNote:(?=.+?channelId:(\i).id)/,
|
||||||
replace: "$self.profilePanelComponent({ id: $1.recipients[0] }),$&"
|
replace: "$self.profilePanelComponent({ id: $1.recipients[0] }),$&"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: ".UserProfileTypes.BITE_SIZE,onOpenProfile",
|
||||||
|
replacement: {
|
||||||
|
match: /currentUser:\i,guild:\i,onOpenProfile:.+?}\)(?=])(?<=user:(\i),bio:null==(\i)\?.+?)/,
|
||||||
|
replace: "$&,$self.profilePopoutComponent({ user: $1, displayProfile: $2, simplified: true })"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
settings,
|
settings,
|
||||||
|
|
|
@ -9,3 +9,11 @@
|
||||||
gap: 0.25em;
|
gap: 0.25em;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.vc-sc-connection-name {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-sc-tooltip svg {
|
||||||
|
min-width: 16px;
|
||||||
|
}
|
||||||
|
|
|
@ -73,9 +73,8 @@ export default definePlugin({
|
||||||
find: '"placeholder-channel-id"',
|
find: '"placeholder-channel-id"',
|
||||||
replacement: [
|
replacement: [
|
||||||
// Remove the special logic for channels we don't have access to
|
// Remove the special logic for channels we don't have access to
|
||||||
// FIXME Remove variable matcher from threadsIds when it hits stable
|
|
||||||
{
|
{
|
||||||
match: /if\(!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL.+?{if\(this\.id===\i\).+?threadIds:(?:\[\]|\i)}}/,
|
match: /if\(!\i\.\i\.can\(\i\.\i\.VIEW_CHANNEL.+?{if\(this\.id===\i\).+?threadIds:\[\]}}/,
|
||||||
replace: ""
|
replace: ""
|
||||||
},
|
},
|
||||||
// Do not check for unreads when selecting the render level if the channel is hidden
|
// Do not check for unreads when selecting the render level if the channel is hidden
|
||||||
|
|
|
@ -69,13 +69,6 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
find: "=!1,canUsePremiumCustomization:",
|
|
||||||
replacement: {
|
|
||||||
match: /(\i)\.premiumType/,
|
|
||||||
replace: "$self.patchPremiumType($1)||$&"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
find: "BannerLoadingStatus:function",
|
find: "BannerLoadingStatus:function",
|
||||||
replacement: {
|
replacement: {
|
||||||
|
|
|
@ -184,7 +184,7 @@ export default definePlugin({
|
||||||
|
|
||||||
patches: [
|
patches: [
|
||||||
// Profiles Modal pfp
|
// Profiles Modal pfp
|
||||||
...["User Profile Modal - Context Menu", ".UserProfileTypes.FULL_SIZE,hasProfileEffect:"].map(find => ({
|
...[".UserProfileTypes.MODAL,hasProfileEffect", ".UserProfileTypes.FULL_SIZE,hasProfileEffect:"].map(find => ({
|
||||||
find,
|
find,
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\{src:(\i)(?=,avatarDecoration)/,
|
match: /\{src:(\i)(?=,avatarDecoration)/,
|
||||||
|
|
|
@ -38,7 +38,7 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
||||||
id: 0n,
|
id: 0n,
|
||||||
},
|
},
|
||||||
Ven: {
|
Ven: {
|
||||||
name: "Vendicated",
|
name: "Vee",
|
||||||
id: 343383572805058560n
|
id: 343383572805058560n
|
||||||
},
|
},
|
||||||
Arjix: {
|
Arjix: {
|
||||||
|
@ -327,7 +327,7 @@ export const Devs = /* #__PURE__*/ Object.freeze({
|
||||||
id: 305288513941667851n
|
id: 305288513941667851n
|
||||||
},
|
},
|
||||||
ImLvna: {
|
ImLvna: {
|
||||||
name: "Luna <3",
|
name: "lillith <3",
|
||||||
id: 799319081723232267n
|
id: 799319081723232267n
|
||||||
},
|
},
|
||||||
rad: {
|
rad: {
|
||||||
|
|
Loading…
Reference in a new issue