Merge branch 'main' of https://www.coastalcommits.com/CoastalCommitsArchival/github.com-Vendicated-Vencord
This commit is contained in:
commit
74bdc96840
8 changed files with 46 additions and 24 deletions
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "vencord",
|
"name": "vencord",
|
||||||
"private": "true",
|
"private": "true",
|
||||||
"version": "1.7.7",
|
"version": "1.7.8",
|
||||||
"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": {
|
||||||
|
|
|
@ -45,14 +45,14 @@ export default definePlugin({
|
||||||
replacement: {
|
replacement: {
|
||||||
get match() {
|
get match() {
|
||||||
switch (Settings.plugins.Settings.settingsLocation) {
|
switch (Settings.plugins.Settings.settingsLocation) {
|
||||||
case "top": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.USER_SETTINGS\}/;
|
case "top": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.USER_SETTINGS/;
|
||||||
case "aboveNitro": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.BILLING_SETTINGS\}/;
|
case "aboveNitro": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.BILLING_SETTINGS/;
|
||||||
case "belowNitro": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.APP_SETTINGS\}/;
|
case "belowNitro": return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.APP_SETTINGS/;
|
||||||
case "belowActivity": return /(?<=\{section:(\i\.\i)\.DIVIDER},)\{section:"changelog"/;
|
case "belowActivity": return /(?<=\{section:(\i\.\i)\.DIVIDER},)\{section:"changelog"/;
|
||||||
case "bottom": return /\{section:(\i\.\i)\.CUSTOM,\s*element:.+?}/;
|
case "bottom": return /\{section:(\i\.\i)\.CUSTOM,\s*element:.+?}/;
|
||||||
case "aboveActivity":
|
case "aboveActivity":
|
||||||
default:
|
default:
|
||||||
return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.ACTIVITY_SETTINGS\}/;
|
return /\{section:(\i\.\i)\.HEADER,\s*label:(\i)\.\i\.Messages\.ACTIVITY_SETTINGS/;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
replace: "...$self.makeSettingsCategories($1),$&"
|
replace: "...$self.makeSettingsCategories($1),$&"
|
||||||
|
|
|
@ -22,9 +22,10 @@ import { Devs } from "@utils/constants";
|
||||||
import { isTruthy } from "@utils/guards";
|
import { isTruthy } from "@utils/guards";
|
||||||
import { useAwaiter } from "@utils/react";
|
import { useAwaiter } from "@utils/react";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
import { findByCodeLazy, findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
||||||
import { ApplicationAssetUtils, FluxDispatcher, Forms, GuildStore, React, SelectedChannelStore, SelectedGuildStore, UserStore } from "@webpack/common";
|
import { ApplicationAssetUtils, FluxDispatcher, Forms, GuildStore, React, SelectedChannelStore, SelectedGuildStore, UserStore } from "@webpack/common";
|
||||||
|
|
||||||
|
const useProfileThemeStyle = findByCodeLazy("profileThemeStyle:", "--profile-gradient-primary-color");
|
||||||
const ActivityComponent = findComponentByCodeLazy("onOpenGameProfile");
|
const ActivityComponent = findComponentByCodeLazy("onOpenGameProfile");
|
||||||
const ActivityClassName = findByPropsLazy("activity", "buttonColor");
|
const ActivityClassName = findByPropsLazy("activity", "buttonColor");
|
||||||
|
|
||||||
|
@ -392,6 +393,8 @@ export default definePlugin({
|
||||||
|
|
||||||
settingsAboutComponent: () => {
|
settingsAboutComponent: () => {
|
||||||
const activity = useAwaiter(createActivity);
|
const activity = useAwaiter(createActivity);
|
||||||
|
const { profileThemeStyle } = useProfileThemeStyle({});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Forms.FormText>
|
<Forms.FormText>
|
||||||
|
@ -405,7 +408,7 @@ export default definePlugin({
|
||||||
If you want to use image link, download your image and reupload the image to <Link href="https://imgur.com">Imgur</Link> and get the image link by right-clicking the image and select "Copy image address".
|
If you want to use image link, download your image and reupload the image to <Link href="https://imgur.com">Imgur</Link> and get the image link by right-clicking the image and select "Copy image address".
|
||||||
</Forms.FormText>
|
</Forms.FormText>
|
||||||
<Forms.FormDivider />
|
<Forms.FormDivider />
|
||||||
<div style={{ width: "284px" }}>
|
<div style={{ width: "284px", ...profileThemeStyle }}>
|
||||||
{activity[0] && <ActivityComponent activity={activity[0]} className={ActivityClassName.activity} channelId={SelectedChannelStore.getChannelId()}
|
{activity[0] && <ActivityComponent activity={activity[0]} className={ActivityClassName.activity} channelId={SelectedChannelStore.getChannelId()}
|
||||||
guild={GuildStore.getGuild(SelectedGuildStore.getLastSelectedGuildId())}
|
guild={GuildStore.getGuild(SelectedGuildStore.getLastSelectedGuildId())}
|
||||||
application={{ id: settings.store.appID }}
|
application={{ id: settings.store.appID }}
|
||||||
|
|
|
@ -7,12 +7,22 @@
|
||||||
import ErrorBoundary from "@components/ErrorBoundary";
|
import ErrorBoundary from "@components/ErrorBoundary";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import { getCurrentChannel } from "@utils/discord";
|
import { getCurrentChannel } from "@utils/discord";
|
||||||
|
import { makeLazy } from "@utils/lazy";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { findByPropsLazy } from "@webpack";
|
import { filters, find, findByPropsLazy, handleModuleNotFound } from "@webpack";
|
||||||
import { React, RelationshipStore } from "@webpack/common";
|
import { React, RelationshipStore } from "@webpack/common";
|
||||||
|
|
||||||
const { Heading, Text } = findByPropsLazy("Heading", "Text");
|
const { Heading, Text } = findByPropsLazy("Heading", "Text");
|
||||||
const container = findByPropsLazy("memberSinceContainer");
|
// Workaround for module differing on stable & canary
|
||||||
|
// FIXME: remove once merged into stable
|
||||||
|
const getMemberSinceContainer = makeLazy(() => {
|
||||||
|
for (const name of ["memberSinceWrapper", "memberSinceContainer"]) {
|
||||||
|
const mod = find(filters.byProps(name), { isIndirect: true });
|
||||||
|
if (mod) return mod[name];
|
||||||
|
}
|
||||||
|
handleModuleNotFound("findByProps", "memberSinceWrapper/memberSinceContainer");
|
||||||
|
return "";
|
||||||
|
});
|
||||||
const { getCreatedAtDate } = findByPropsLazy("getCreatedAtDate");
|
const { getCreatedAtDate } = findByPropsLazy("getCreatedAtDate");
|
||||||
const clydeMoreInfo = findByPropsLazy("clydeMoreInfo");
|
const clydeMoreInfo = findByPropsLazy("clydeMoreInfo");
|
||||||
const locale = findByPropsLazy("getLocale");
|
const locale = findByPropsLazy("getLocale");
|
||||||
|
@ -49,7 +59,7 @@ export default definePlugin({
|
||||||
Friends Since
|
Friends Since
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
<div className={container.memberSinceContainer}>
|
<div className={getMemberSinceContainer()}>
|
||||||
{!!getCurrentChannel()?.guild_id && (
|
{!!getCurrentChannel()?.guild_id && (
|
||||||
<svg
|
<svg
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
|
|
|
@ -50,7 +50,7 @@ export default definePlugin({
|
||||||
patches: [
|
patches: [
|
||||||
// Chat Mentions
|
// Chat Mentions
|
||||||
{
|
{
|
||||||
find: "CLYDE_AI_MENTION_COLOR:null,",
|
find: 'location:"UserMention',
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /user:(\i),channel:(\i).{0,400}?"@"\.concat\(.+?\)/,
|
match: /user:(\i),channel:(\i).{0,400}?"@"\.concat\(.+?\)/,
|
||||||
|
|
|
@ -35,7 +35,7 @@ const Section = findComponentByCodeLazy(".lastSection", "children:");
|
||||||
const ThemeStore = findStoreLazy("ThemeStore");
|
const ThemeStore = findStoreLazy("ThemeStore");
|
||||||
const platformHooks: { useLegacyPlatformType(platform: string): string; } = findByPropsLazy("useLegacyPlatformType");
|
const platformHooks: { useLegacyPlatformType(platform: string): string; } = findByPropsLazy("useLegacyPlatformType");
|
||||||
const platforms: { get(type: string): ConnectionPlatform; } = findByPropsLazy("isSupported", "getByUrl");
|
const platforms: { get(type: string): ConnectionPlatform; } = findByPropsLazy("isSupported", "getByUrl");
|
||||||
const getTheme: (user: User, displayProfile: any) => any = findByCodeLazy('--profile-gradient-primary-color":');
|
const getProfileThemeProps = findByCodeLazy(".getPreviewThemeColors", "primaryColor:");
|
||||||
|
|
||||||
const enum Spacing {
|
const enum Spacing {
|
||||||
COMPACT,
|
COMPACT,
|
||||||
|
@ -74,8 +74,8 @@ interface ConnectionPlatform {
|
||||||
icon: { lightSVG: string, darkSVG: string; };
|
icon: { lightSVG: string, darkSVG: string; };
|
||||||
}
|
}
|
||||||
|
|
||||||
const profilePopoutComponent = ErrorBoundary.wrap(({ user, displayProfile }: { user: User, displayProfile; }) =>
|
const profilePopoutComponent = ErrorBoundary.wrap((props: { user: User, displayProfile; }) =>
|
||||||
<ConnectionsComponent id={user.id} theme={getTheme(user, displayProfile).profileTheme} />
|
<ConnectionsComponent id={props.user.id} theme={getProfileThemeProps(props).theme} />
|
||||||
);
|
);
|
||||||
|
|
||||||
const profilePanelComponent = ErrorBoundary.wrap(({ id }: { id: string; }) =>
|
const profilePanelComponent = ErrorBoundary.wrap(({ id }: { id: string; }) =>
|
||||||
|
|
|
@ -111,19 +111,28 @@ function MentionWrapper({ data, UserMention, RoleMention, parse, props }: Mentio
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "ValidUser",
|
name: "ValidUser",
|
||||||
description: "Fix mentions for unknown users showing up as '<@343383572805058560>' (hover over a mention to fix it)",
|
description: "Fix mentions for unknown users showing up as '@unknown-user' (hover over a mention to fix it)",
|
||||||
authors: [Devs.Ven],
|
authors: [Devs.Ven],
|
||||||
tags: ["MentionCacheFix"],
|
tags: ["MentionCacheFix"],
|
||||||
|
|
||||||
patches: [{
|
patches: [
|
||||||
find: 'className:"mention"',
|
{
|
||||||
replacement: {
|
find: 'className:"mention"',
|
||||||
// mention = { react: function (data, parse, props) { if (data.userId == null) return RoleMention() else return UserMention()
|
replacement: {
|
||||||
match: /react(?=\(\i,\i,\i\).{0,50}return null==\i\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/,
|
// mention = { react: function (data, parse, props) { if (data.userId == null) return RoleMention() else return UserMention()
|
||||||
// react: (...args) => OurWrapper(RoleMention, UserMention, ...args), originalReact: theirFunc
|
match: /react(?=\(\i,\i,\i\).{0,50}return null==.{0,70}\?\(0,\i\.jsx\)\((\i\.\i),.+?jsx\)\((\i\.\i),\{className:"mention")/,
|
||||||
replace: "react:(...args)=>$self.renderMention($1,$2,...args),originalReact"
|
// react: (...args) => OurWrapper(RoleMention, UserMention, ...args), originalReact: theirFunc
|
||||||
|
replace: "react:(...args)=>$self.renderMention($1,$2,...args),originalReact"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: "unknownUserMentionPlaceholder:",
|
||||||
|
replacement: {
|
||||||
|
match: /unknownUserMentionPlaceholder:/,
|
||||||
|
replace: "$&false&&"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}],
|
],
|
||||||
|
|
||||||
renderMention(RoleMention, UserMention, data, parse, props) {
|
renderMention(RoleMention, UserMention, data, parse, props) {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -92,7 +92,7 @@ if (IS_DEV && IS_DISCORD_DESKTOP) {
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleModuleNotFound(method: string, ...filter: unknown[]) {
|
export function handleModuleNotFound(method: string, ...filter: unknown[]) {
|
||||||
const err = new Error(`webpack.${method} found no module`);
|
const err = new Error(`webpack.${method} found no module`);
|
||||||
logger.error(err, "Filter:", filter);
|
logger.error(err, "Filter:", filter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue