split things around

This commit is contained in:
nin0 2025-04-22 04:50:25 -04:00
parent 60cd50efaf
commit a6eca3f768
Signed by: nin0
SSH key fingerprint: SHA256:NOoDnFVvZNFvqfXCIhzr6oCTDImZAbTTuyAysZ8Ufk8
2 changed files with 22 additions and 15 deletions

View file

@ -6,23 +6,11 @@
import "./style.css";
import { classNameFactory } from "@api/Styles";
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { findComponentByCodeLazy } from "@webpack";
import { ChannelStore, DateUtils, GuildStore, IconUtils, NavigationRouter, Popout, SnowflakeUtils, Text, UserStore, useStateFromStores } from "@webpack/common";
import { Guild } from "discord-types/general";
const ServerProfileComponent = findComponentByCodeLazy("{guildProfile:v,fetchGuildProfile:O,fetchStatus:I}");
const cl = classNameFactory("vc-serverprofileforward-");
const ArrowSvg = () => <svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewBox="0 0 24 24"><path fill="var(--text-low-contrast)" d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z" className=""></path></svg>;
const checkForIconExistence = (guild: Guild) => {
if (!guild) return false;
if (!guild.icon) return false;
return true;
};
import { ArrowSvg, checkForIconExistence, cl, ServerProfileComponent } from "./utils";
export default definePlugin({
name: "MoreForwardMeta",
@ -64,11 +52,10 @@ export default definePlugin({
- Voice channel
- Announcement channel
- Stage channel
- Directory channel
- Forum channel
- Media channel
*/
if ([0, 2, 5, 13, 14, 15, 16].includes(channel.type)) return `#${channel.name}`;
if ([0, 2, 5, 13, 15, 16].includes(channel.type)) return `#${channel.name}`;
// DMs
if (channel.type === 1) return `@${(() => {
const user = UserStore.getUser(channel.recipients[0]);

20
utils.tsx Normal file
View file

@ -0,0 +1,20 @@
/*
* Vencord, a Discord client mod
* Copyright (c) 2025 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { classNameFactory } from "@api/Styles";
import { findComponentByCodeLazy } from "@webpack";
import { Guild } from "discord-types/general";
export const ServerProfileComponent = findComponentByCodeLazy("{guildProfile:v,fetchGuildProfile:O,fetchStatus:I}");
export const cl = classNameFactory("vc-serverprofileforward-");
export const ArrowSvg = () => <svg aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="var(--text-low-contrast)" d="M9.3 5.3a1 1 0 0 0 0 1.4l5.29 5.3-5.3 5.3a1 1 0 1 0 1.42 1.4l6-6a1 1 0 0 0 0-1.4l-6-6a1 1 0 0 0-1.42 0Z" className=""></path></svg>;
export const checkForIconExistence = (guild: Guild) => {
if (!guild) return false;
if (!guild.icon) return false;
return true;
};