Merge branch 'main' of https://www.coastalcommits.com/CoastalCommitsArchival/github.com-Vendicated-Vencord
This commit is contained in:
commit
101e25329e
5 changed files with 13 additions and 21 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "vencord",
|
||||
"private": "true",
|
||||
"version": "1.7.8",
|
||||
"version": "1.7.9",
|
||||
"description": "The cutest Discord client mod",
|
||||
"homepage": "https://github.com/Vendicated/Vencord#readme",
|
||||
"bugs": {
|
||||
|
|
|
@ -7,22 +7,12 @@
|
|||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { getCurrentChannel } from "@utils/discord";
|
||||
import { makeLazy } from "@utils/lazy";
|
||||
import definePlugin from "@utils/types";
|
||||
import { filters, find, findByPropsLazy, handleModuleNotFound } from "@webpack";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { React, RelationshipStore } from "@webpack/common";
|
||||
|
||||
const { Heading, Text } = findByPropsLazy("Heading", "Text");
|
||||
// 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 container = findByPropsLazy("memberSinceWrapper");
|
||||
const { getCreatedAtDate } = findByPropsLazy("getCreatedAtDate");
|
||||
const clydeMoreInfo = findByPropsLazy("clydeMoreInfo");
|
||||
const locale = findByPropsLazy("getLocale");
|
||||
|
@ -59,7 +49,7 @@ export default definePlugin({
|
|||
Friends Since
|
||||
</Heading>
|
||||
|
||||
<div className={getMemberSinceContainer()}>
|
||||
<div className={container.memberSinceWrapper}>
|
||||
{!!getCurrentChannel()?.guild_id && (
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
|
|
|
@ -198,7 +198,8 @@ export default definePlugin({
|
|||
replacement: [
|
||||
// make the tag show the right text
|
||||
{
|
||||
match: /(switch\((\i)\){.+?)case (\i(?:\.\i)?)\.BOT:default:(\i)=.{0,40}(\i\.\i\.Messages)\.BOT_TAG_BOT/,
|
||||
// FIXME: Remove the BOT_TAG_BOT variant when the change arrives in stable
|
||||
match: /(switch\((\i)\){.+?)case (\i(?:\.\i)?)\.BOT:default:(\i)=.{0,40}(\i\.\i\.Messages)\.(?:APP_TAG|BOT_TAG_BOT)/,
|
||||
replace: (_, origSwitch, variant, tags, displayedText, strings) =>
|
||||
`${origSwitch}default:{${displayedText} = $self.getTagText(${tags}[${variant}], ${strings})}`
|
||||
},
|
||||
|
@ -321,19 +322,20 @@ export default definePlugin({
|
|||
|
||||
isOPTag: (tag: number) => tag === Tag.Types.ORIGINAL_POSTER || tags.some(t => tag === Tag.Types[`${t.name}-OP`]),
|
||||
|
||||
// FIXME: Remove the BOT_TAG_BOT variants from strings when the change arrives in stable
|
||||
getTagText(passedTagName: string, strings: Record<string, string>) {
|
||||
if (!passedTagName) return strings.BOT_TAG_BOT;
|
||||
if (!passedTagName) return strings.APP_TAG ?? strings.BOT_TAG_BOT;
|
||||
const [tagName, variant] = passedTagName.split("-");
|
||||
const tag = tags.find(({ name }) => tagName === name);
|
||||
if (!tag) return strings.BOT_TAG_BOT;
|
||||
if (variant === "BOT" && tagName !== "WEBHOOK" && this.settings.store.dontShowForBots) return strings.BOT_TAG_BOT;
|
||||
if (!tag) return strings.APP_TAG ?? strings.BOT_TAG_BOT;
|
||||
if (variant === "BOT" && tagName !== "WEBHOOK" && this.settings.store.dontShowForBots) return strings.APP_TAG ?? strings.BOT_TAG_BOT;
|
||||
|
||||
const tagText = settings.store.tagSettings?.[tag.name]?.text || tag.displayName;
|
||||
switch (variant) {
|
||||
case "OP":
|
||||
return `${strings.BOT_TAG_FORUM_ORIGINAL_POSTER} • ${tagText}`;
|
||||
case "BOT":
|
||||
return `${strings.BOT_TAG_BOT} • ${tagText}`;
|
||||
return `${strings.APP_TAG ?? strings.BOT_TAG_BOT} • ${tagText}`;
|
||||
default:
|
||||
return tagText;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ export default definePlugin({
|
|||
find: ".pronouns,children",
|
||||
replacement: [
|
||||
{
|
||||
match: /{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i;/,
|
||||
match: /{user:(\i),[^}]*,pronouns:(\i),[^}]*}=\i.*?;(?=return)/,
|
||||
replace: "$&let vcPronounSource;[$2,vcPronounSource]=$self.useProfilePronouns($1.id);"
|
||||
},
|
||||
PRONOUN_TOOLTIP_PATCH
|
||||
|
|
|
@ -94,7 +94,7 @@ export default definePlugin({
|
|||
find: "renderPrioritySpeaker",
|
||||
replacement: [
|
||||
{
|
||||
match: /renderName\(\).{0,100}speaking:.{50,200}"div",{/,
|
||||
match: /renderName\(\).{0,100}speaking:.+?\.clanTag.+?"div",{/,
|
||||
replace: "$&...$self.getVoiceProps(this.props),"
|
||||
}
|
||||
],
|
||||
|
|
Loading…
Reference in a new issue