Merge branch 'dev' into translation
This commit is contained in:
commit
c1d595d944
15 changed files with 219 additions and 122 deletions
|
|
@ -827,3 +827,141 @@ export const BookmarkIcon = (props?: any) => {
|
|||
</Icon>
|
||||
);
|
||||
};
|
||||
|
||||
export function RobotIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M7.89 13.46a1 1 0 0 1-1.78-.9L7 13l-.9-.45.01-.01.01-.02a2.24 2.24 0 0 1 .14-.23c.1-.14.23-.31.4-.5.37-.36.98-.79 1.84-.79.86 0 1.47.43 1.83.8a3.28 3.28 0 0 1 .55.72v.02h.01v.01L10 13l.9-.45a1 1 0 0 1-1.79.9 1.28 1.28 0 0 0-.19-.25c-.14-.13-.28-.2-.42-.2-.14 0-.28.07-.42.2a1.28 1.28 0 0 0-.19.25ZM13.55 13.9a1 1 0 0 0 1.34-.44c0-.02.02-.04.04-.06.03-.05.08-.13.15-.2.14-.13.28-.2.42-.2.14 0 .28.07.42.2a1.28 1.28 0 0 1 .19.25 1 1 0 0 0 1.78-.9L17 13l.9-.45-.01-.01-.01-.02a2.1 2.1 0 0 0-.14-.23 3.28 3.28 0 0 0-.4-.5c-.37-.36-.98-.79-1.84-.79-.86 0-1.47.43-1.83.8a3.28 3.28 0 0 0-.55.72v.02h-.01v.01L14 13l-.9-.45a1 1 0 0 0 .45 1.34Z"
|
||||
/>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
fillRule="evenodd"
|
||||
d="M12 21c5.52 0 10-1.86 10-6 0-5.59-2.8-10.07-4.26-11.67a1 1 0 1 0-1.48 1.34 14.8 14.8 0 0 1 2.35 3.86A10.23 10.23 0 0 0 12 6C9.47 6 7.15 7.02 5.4 8.53a14.8 14.8 0 0 1 2.34-3.86 1 1 0 1 0-1.48-1.34A18.65 18.65 0 0 0 2 15c0 4.14 4.48 6 10 6Zm0-12c3.87 0 7 2 7 4.2S15.87 17 12 17s-7-1.6-7-3.8C5 11 8.13 9 12 9Z"
|
||||
clipRule="evenodd"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function HeadphonesIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M12 3a9 9 0 0 0-8.95 10h1.87a5 5 0 0 1 4.1 2.13l1.37 1.97a3.1 3.1 0 0 1-.17 3.78 2.85 2.85 0 0 1-3.55.74 11 11 0 1 1 10.66 0c-1.27.71-2.73.23-3.55-.74a3.1 3.1 0 0 1-.17-3.78l1.38-1.97a5 5 0 0 1 4.1-2.13h1.86A9 9 0 0 0 12 3Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function ShieldIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M17.05 8.76a4.7 4.7 0 0 1-1.29-.88c-.36-.33-.7-.73-.88-1.13-.33-.73-.16-.77-1.08-.77h-3.64c-.91 0-.74.04-1.08.77a4.94 4.94 0 0 1-2.17 2.01c-.74.33-.85.14-.86.82 0 .88-.22 3.34 1.78 5.19a13.68 13.68 0 0 0 3.98 2.47c.09.03.08.04.17.04.09 0 .08 0 .17-.04.76-.25 2.67-1.25 3.98-2.47 2-1.85 1.78-4.3 1.78-5.19-.01-.68-.12-.49-.86-.82Z"
|
||||
/>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M19.91 5.41c-.84 0-1.52-.65-1.52-1.46v-.3c0-.9-.77-1.65-1.71-1.65H7.31c-.94 0-1.71.74-1.71 1.65v.3c0 .81-.68 1.46-1.52 1.46H3.7c-.94 0-1.7.73-1.7 1.64v3.52l.01.49c.05 3.11.94 4.69 2.92 6.63C6.72 19.46 11.58 22 11.99 22c.41 0 5.27-2.54 7.06-4.31 1.98-1.95 2.92-3.53 2.92-6.63L22 7.05c0-.9-.76-1.64-1.7-1.64h-.39Zm-2.18 10.74a21.76 21.76 0 0 1-5.58 3.38c-.1.03-.2.03-.31 0a21.76 21.76 0 0 1-5.58-3.38c-1.15-1.08-2.12-2.37-2.12-5.29v-.33l.03-2.57c0-.31.26-.57.59-.57a2.88 2.88 0 0 0 2.89-2.8v-.03c0-.3.26-.55.59-.55h7.56c.32 0 .59.25.59.55v.03c0 1.53 1.3 2.77 2.89 2.8.32 0 .59.26.59.57l.03 2.57v.34c0 2.92-.98 4.2-2.14 5.28h-.03Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function CircleQuestionIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<circle
|
||||
cx="12"
|
||||
cy="12"
|
||||
r="10"
|
||||
fill="transparent"
|
||||
/>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
fillRule="evenodd"
|
||||
d="M12 23a11 11 0 1 0 0-22 11 11 0 0 0 0 22Zm-.28-16c-.98 0-1.81.47-2.27 1.14A1 1 0 1 1 7.8 7.01 4.73 4.73 0 0 1 11.72 5c2.5 0 4.65 1.88 4.65 4.38 0 2.1-1.54 3.77-3.52 4.24l.14 1a1 1 0 0 1-1.98.27l-.28-2a1 1 0 0 1 .99-1.14c1.54 0 2.65-1.14 2.65-2.38 0-1.23-1.1-2.37-2.65-2.37ZM13 17.88a1.13 1.13 0 1 1-2.25 0 1.13 1.13 0 0 1 2.25 0Z"
|
||||
clipRule="evenodd"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function AttachmentIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M10.57 4.01a6.97 6.97 0 0 1 9.86 0l.54.55a6.99 6.99 0 0 1 0 9.88l-7.26 7.27a1 1 0 0 1-1.42-1.42l7.27-7.26a4.99 4.99 0 0 0 0-7.06L19 5.43a4.97 4.97 0 0 0-7.02 0l-8.02 8.02a3.24 3.24 0 1 0 4.58 4.58l6.24-6.24a1.12 1.12 0 0 0-1.58-1.58l-3.5 3.5a1 1 0 0 1-1.42-1.42l3.5-3.5a3.12 3.12 0 1 1 4.42 4.42l-6.24 6.24a5.24 5.24 0 0 1-7.42-7.42l8.02-8.02Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function StickerIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
fillRule="evenodd"
|
||||
d="M6 2h12a4 4 0 0 1 4 4v7.5a.5.5 0 0 1-.5.5H19a5 5 0 0 0-5 5v2.5a.5.5 0 0 1-.5.5H6a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4Zm.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM19 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Zm-9.91 2.94a1 1 0 0 0-1.66 1.12 5.5 5.5 0 0 0 9.14 0 1 1 0 0 0-1.66-1.12 3.5 3.5 0 0 1-5.82 0Z"
|
||||
clipRule="evenodd"
|
||||
/>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M21.66 16c.03 0 .05.03.04.06a3 3 0 0 1-.58.82l-4.24 4.24a3 3 0 0 1-.82.58.04.04 0 0 1-.06-.04V19a3 3 0 0 1 3-3h2.66Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function GifIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
fillRule="evenodd"
|
||||
d="M5 2a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V5a3 3 0 0 0-3-3H5Zm2.18 13.87a2.9 2.9 0 0 1-1.66-.49 3.18 3.18 0 0 1-1.12-1.35A4.88 4.88 0 0 1 4 12c0-.75.14-1.42.42-2 .29-.59.7-1.04 1.24-1.37a3.7 3.7 0 0 1 1.95-.5c.64 0 1.21.14 1.72.4.5.28.89.67 1.15 1.16l-1.22.88a1.76 1.76 0 0 0-1.64-1.02c-.66 0-1.17.22-1.52.65a2.74 2.74 0 0 0-.53 1.8c0 .78.18 1.39.53 1.81.35.42.86.64 1.52.64.3 0 .57-.06.81-.16.25-.12.45-.27.58-.47v-.93H7.3v-1.4h3.24v4.23H9.27l-.2-.71c-.43.57-1.06.86-1.89.86Zm6.34-.15h-1.57V8.28h1.57v7.44Zm1.51 0h1.57v-2.83h2.76v-1.42H16.6V9.7H20V8.28h-4.97v7.44Z"
|
||||
clipRule="evenodd"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
||||
export function VideoIcon(props: IconProps) {
|
||||
return (
|
||||
<Icon
|
||||
{...props}
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<path
|
||||
fill={props.fill || "currentColor"}
|
||||
d="M4 4a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h11a3 3 0 0 0 3-3v-2.12a1 1 0 0 0 .55.9l3 1.5a1 1 0 0 0 1.45-.9V7.62a1 1 0 0 0-1.45-.9l-3 1.5a1 1 0 0 0-.55.9V7a3 3 0 0 0-3-3H4Z"
|
||||
/>
|
||||
</Icon>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { DataStore } from "@api/index";
|
|||
import { isPluginEnabled, plugins, startPlugin, stopPlugin } from "@api/PluginManager";
|
||||
import { Settings, SettingsStore } from "@api/Settings";
|
||||
import { getUserSettingLazy } from "@api/UserSettings";
|
||||
import { HeadphonesIcon } from "@components/Icons";
|
||||
import { openPluginModal } from "@components/settings/tabs";
|
||||
import { toggleEnabled } from "@equicordplugins/equicordHelper/utils";
|
||||
import { copyWithToast } from "@utils/discord";
|
||||
|
|
@ -15,7 +16,7 @@ import { Logger } from "@utils/Logger";
|
|||
import type { Plugin } from "@utils/types";
|
||||
import { changes, checkForUpdates } from "@utils/updater";
|
||||
import { Guild } from "@vencord/discord-types";
|
||||
import { findByPropsLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
|
||||
import { findByPropsLazy, findStoreLazy } from "@webpack";
|
||||
import { Alerts, ChannelActionCreators, ChannelRouter, ChannelStore, ComponentDispatch, FluxDispatcher, GuildStore, IconUtils, MediaEngineStore, MessageStore, NavigationRouter, React, ReadStateStore, ReadStateUtils, SelectedChannelStore, SelectedGuildStore, SettingsRouter, StreamerModeStore, Toasts, useEffect, UserStore, VoiceActions } from "@webpack/common";
|
||||
import type { FC, ReactElement, ReactNode } from "react";
|
||||
|
||||
|
|
@ -800,7 +801,6 @@ const runtimeCleanupCallbacks: Array<() => void> = [];
|
|||
const NotificationSettingsActionCreators = findByPropsLazy("updateGuildNotificationSettings", "updateChannelOverrideSettings");
|
||||
const GuildSettingsActions = findByPropsLazy("open", "selectRole", "updateGuild");
|
||||
const GuildMembershipActions = findByPropsLazy("leaveGuild");
|
||||
const HeadphonesIcon = findComponentByCodeLazy("4.1-2.13h1.86A9");
|
||||
const UserGuildSettingsStore = findStoreLazy("UserGuildSettingsStore");
|
||||
const NotificationsInboxStore = findStoreLazy("NotificationsInboxStore") as NotificationsInboxStoreLike;
|
||||
const RecentMentionsStore = findStoreLazy("RecentMentionsStore") as RecentMentionsStoreLike;
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ import { HeaderBarButton } from "@api/HeaderBar";
|
|||
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
|
||||
import { isPluginEnabled } from "@api/PluginManager";
|
||||
import { definePluginSettings, migratePluginToSettings, Settings } from "@api/Settings";
|
||||
import { WarningIcon } from "@components/Icons";
|
||||
import { ShieldIcon, WarningIcon } from "@components/Icons";
|
||||
import customRPC from "@plugins/customRPC";
|
||||
import { Devs, EquicordDevs, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_SUPPORT_CHANNEL_IDS } from "@utils/constants";
|
||||
import { isAnyPluginDev } from "@utils/misc";
|
||||
import { t } from "@utils/translation";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { StandingState } from "@vencord/discord-types/enums";
|
||||
import { findByCodeLazy, findComponentByCodeLazy, findStoreLazy } from "@webpack";
|
||||
import { findByCodeLazy, findStoreLazy } from "@webpack";
|
||||
import { Alerts, ApplicationCommandIndexStore, NavigationRouter, React, SettingsRouter, UserStore, useStateFromStores } from "@webpack/common";
|
||||
import { ComponentType } from "react";
|
||||
|
||||
|
|
@ -31,7 +31,6 @@ let clicked = false;
|
|||
|
||||
const SafetyHubStore = findStoreLazy("SafetyHubStore");
|
||||
const fetchSafetyHub: () => Promise<void> = findByCodeLazy("SAFETY_HUB_FETCH_START");
|
||||
const ShieldIcon = findComponentByCodeLazy("0 0 1-1.29-.88c-.36-.33-.7-.73-.88-1.13-.33-.");
|
||||
|
||||
const StandingConfig: Record<number, { label: string; hoverColor: string; Icon: ComponentType<any>; }> = {
|
||||
[StandingState.ALL_GOOD]: { label: t("equicord.equicordHelper.standing.allGood"), hoverColor: "var(--status-positive)", Icon: ShieldIcon },
|
||||
|
|
|
|||
|
|
@ -6,16 +6,13 @@
|
|||
|
||||
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { EyeIcon } from "@components/Icons";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import { t } from "@utils/translation";
|
||||
import definePlugin, { IconComponent, OptionType } from "@utils/types";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { ChannelStore, FluxDispatcher, Menu } from "@webpack/common";
|
||||
|
||||
const EyeIconLazy = findComponentByCodeLazy("0-.78-.41l-9.53 6.35c-.42.28-.96.28-1.38");
|
||||
const EyeIcon: IconComponent = props => <EyeIconLazy {...props} />;
|
||||
|
||||
const hideMessage = (messageId: string, channelId: string) => {
|
||||
FluxDispatcher.dispatch({
|
||||
type: "MESSAGE_DELETE",
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import "./style.css";
|
|||
import { DecoratorProps } from "@api/MemberListDecorators";
|
||||
import { isPluginEnabled } from "@api/PluginManager";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { ImageIcon, Microphone } from "@components/Icons";
|
||||
import { AttachmentIcon, GifIcon, ImageIcon, Microphone, StickerIcon, VideoIcon } from "@components/Icons";
|
||||
import betterActivities from "@equicordplugins/betterActivities";
|
||||
import showMeYourName from "@plugins/showMeYourName";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
|
|
@ -46,11 +46,11 @@ type IconType = AttachmentType | "voice" | "sticker";
|
|||
|
||||
const Icons: Record<IconType, React.ComponentType<{ size: string; className: string; }>> = {
|
||||
image: ImageIcon,
|
||||
file: findComponentByCodeLazy("9.86 0l.54.55a6.99 6.99"),
|
||||
file: AttachmentIcon,
|
||||
voice: Microphone,
|
||||
sticker: findComponentByCodeLazy("1-.5.5H6a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4Zm.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM19"),
|
||||
gif: findComponentByCodeLazy("3.18 0 0 1-1.12-1.35A4.88 4.8"),
|
||||
video: findComponentByCodeLazy(" 3-3v-2.12a1"),
|
||||
sticker: StickerIcon,
|
||||
gif: GifIcon,
|
||||
video: VideoIcon,
|
||||
};
|
||||
|
||||
const ATTACHMENT_LABELS: Record<AttachmentType, string> = {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ export const settings = definePluginSettings({
|
|||
description: "Comma-separated list of User IDs to always receive reply pings from",
|
||||
default: "",
|
||||
disabled: () => settings.store.alwaysPingOnReply,
|
||||
},
|
||||
replyPingBlacklist: {
|
||||
type: OptionType.STRING,
|
||||
description: "Comma-separated list of User IDs to never receive reply pings from",
|
||||
default: "",
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -29,7 +34,7 @@ export default definePlugin({
|
|||
name: "ReplyPingControl",
|
||||
description: t("equicord.replyPingControl.description"),
|
||||
tags: ["Chat", "Notifications"],
|
||||
authors: [Devs.ant0n, EquicordDevs.MrDiamond],
|
||||
authors: [Devs.ant0n, EquicordDevs.MrDiamond, EquicordDevs.keircn],
|
||||
settings,
|
||||
|
||||
patches: [{
|
||||
|
|
@ -47,10 +52,17 @@ export default definePlugin({
|
|||
const repliedMessage = this.getRepliedMessage(message);
|
||||
if (!repliedMessage || repliedMessage.author.id !== user.id) return;
|
||||
|
||||
const whitelist = settings.store.replyPingWhitelist.split(",").map(id => id.trim());
|
||||
const isWhitelisted = settings.store.replyPingWhitelist.includes(message.author.id);
|
||||
const { replyPingBlacklist, replyPingWhitelist, alwaysPingOnReply } = settings.plain;
|
||||
const authorId = message.author.id;
|
||||
|
||||
if (isWhitelisted || settings.store.alwaysPingOnReply) {
|
||||
if (replyPingBlacklist && replyPingBlacklist.split(",").some(id => id.trim() === authorId)) {
|
||||
message.mentions = message.mentions.filter(mention => mention.id !== user.id);
|
||||
return;
|
||||
}
|
||||
|
||||
const isWhitelisted = replyPingWhitelist && replyPingWhitelist.split(",").some(id => id.trim() === authorId);
|
||||
|
||||
if (isWhitelisted || alwaysPingOnReply) {
|
||||
if (!message.mentions.some(mention => mention.id === user.id)) {
|
||||
message.mentions.push(user as any);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,14 @@ import { getCurrentChannel } from "@utils/discord";
|
|||
import { t } from "@utils/translation";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Channel, Guild, User } from "@vencord/discord-types";
|
||||
import { ChannelType } from "@vencord/discord-types/enums";
|
||||
import {
|
||||
DefaultExtractAndLoadChunksRegex,
|
||||
extractAndLoadChunksLazy,
|
||||
findByPropsLazy,
|
||||
findComponentByCodeLazy,
|
||||
findCssClassesLazy,
|
||||
findStoreLazy
|
||||
findStoreLazy,
|
||||
} from "@webpack";
|
||||
import {
|
||||
ChannelActionCreators,
|
||||
|
|
@ -39,35 +40,18 @@ import {
|
|||
RelationshipStore,
|
||||
SelectedChannelStore,
|
||||
SelectedGuildStore,
|
||||
ThemeStore,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
UserStore,
|
||||
useState,
|
||||
useStateFromStores
|
||||
useStateFromStores,
|
||||
} from "@webpack/common";
|
||||
|
||||
import {
|
||||
getOpenPopoutWindowKeys,
|
||||
getPersistedPopoutChannelIds,
|
||||
getPopoutWindowKey,
|
||||
isPopoutWindowOpen,
|
||||
settings,
|
||||
SidebarStore,
|
||||
syncPersistedPopoutWindows
|
||||
} from "./store";
|
||||
import { getOpenPopoutWindowKeys, getPersistedPopoutChannelIds, getPopoutWindowKey, isPopoutWindowOpen, settings, SidebarStore, syncPersistedPopoutWindows } from "./store";
|
||||
|
||||
const cl = classNameFactory("vc-sidebar-chat-");
|
||||
|
||||
const themeParents: Record<string, string> = { darker: "dark", midnight: "dark" };
|
||||
function getThemeClasses(theme: string) {
|
||||
const parent = themeParents[theme];
|
||||
return parent
|
||||
? `theme-${parent} theme-${theme} images-${parent}`
|
||||
: `theme-${theme} images-${theme}`;
|
||||
}
|
||||
|
||||
const HeaderBar = findComponentByCodeLazy("toolbarClassName:", "}),onDoubleClick:");
|
||||
const ForumView = findComponentByCodeLazy("sidebarState");
|
||||
|
||||
|
|
@ -89,8 +73,9 @@ const WindowLaunchIcon = findComponentByCodeLazy("1-1h6a1 1 0 1 0 0-2H5Z");
|
|||
const XSmallIcon = findComponentByCodeLazy("1.4L12 13.42l5.3 5.3Z");
|
||||
const Chat = findComponentByCodeLazy("filterAfterTimestamp:", "chatInputType");
|
||||
const Resize = findComponentByCodeLazy("sidebarType:", "RESIZE_HANDLE_WIDTH)");
|
||||
const ChannelHeader = findComponentByCodeLazy(".GUILD_ANNOUNCEMENT", "`channel-");
|
||||
const ChannelHeader = findComponentByCodeLazy("`channel-${");
|
||||
const PopoutWindow = findComponentByCodeLazy("Missing guestWindow reference");
|
||||
const FullChannelView = findComponentByCodeLazy("showFollowButton:");
|
||||
const WanderingCubesLoading = findComponentByCodeLazy('="wanderingCubes"');
|
||||
|
||||
const ChatInputTypes = findByPropsLazy("FORM", "NORMAL");
|
||||
|
|
@ -307,8 +292,8 @@ const UserContextPatch: NavContextMenuPatchCallback = (children, args: { user: U
|
|||
const ChannelContextPatch: NavContextMenuPatchCallback = (children, args: { channel: Channel; }) => {
|
||||
const checks = [
|
||||
args.channel,
|
||||
args.channel.type !== 4, // categories
|
||||
PermissionStore.can(PermissionsBits.VIEW_CHANNEL, args.channel),
|
||||
args.channel.type !== ChannelType.GUILD_CATEGORY,
|
||||
PermissionStore.can(PermissionsBits.VIEW_CHANNEL, args.channel) || args.channel.type === ChannelType.GROUP_DM,
|
||||
];
|
||||
if (checks.some(check => !check)) return;
|
||||
children.push(createSidebarChatContextMenuItem(args.channel.id, args.channel.guild_id));
|
||||
|
|
@ -331,29 +316,50 @@ export default definePlugin({
|
|||
group: true,
|
||||
replacement: [
|
||||
{
|
||||
match: /if\(null!=.{0,50}ROLE_SUBSCRIPTIONS/,
|
||||
replace: "const vc_SidebarChat=$self.renderSidebar();$&"
|
||||
match: /ChannelRenderer"\),/,
|
||||
replace: "$&vc_SidebarChat=$self.renderSidebar(),"
|
||||
},
|
||||
{
|
||||
match: /=>(\(0,\i\.jsxs?\)\(\i,{}\))/,
|
||||
replace: "=>[$1, vc_SidebarChat]"
|
||||
match: /return(\(0,\i\.jsxs?\)\(\i,{}\))}/,
|
||||
replace: "return [$1, vc_SidebarChat]}"
|
||||
},
|
||||
{
|
||||
match: /(?<=guild_products.{0,1600})(case \i\.\i.{0,50}return)(.+?\}\));(?=.+?params\.messageId)/g,
|
||||
replace: "$1[$2, vc_SidebarChat];",
|
||||
predicate: () => settings.store.patchCommunity
|
||||
predicate: () => settings.store.patchCommunity,
|
||||
},
|
||||
{
|
||||
match: /(case \i\.\i\.GAME_SERVERS:.{0,50}\.CHANNEL.{0,25}return)(.*?);/,
|
||||
replace: "$1[$2, vc_SidebarChat];",
|
||||
predicate: () => settings.store.patchCommunity
|
||||
}
|
||||
]
|
||||
predicate: () => settings.store.patchCommunity,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
settings,
|
||||
headerBarButton: {
|
||||
icon: WindowLaunchIcon,
|
||||
render: () => (
|
||||
<>
|
||||
<PopoutPersistenceSync />
|
||||
<WrappedPopoutHeaderButton />
|
||||
</>
|
||||
)
|
||||
},
|
||||
|
||||
stop() {
|
||||
clearPersistedPopoutRestoreLoop();
|
||||
syncPersistedPopoutWindows();
|
||||
for (const windowKey of getOpenPopoutWindowKeys()) {
|
||||
PopoutActions.close(windowKey);
|
||||
}
|
||||
},
|
||||
|
||||
async start() {
|
||||
restorePersistedPopouts();
|
||||
},
|
||||
|
||||
settings,
|
||||
contextMenus: {
|
||||
"user-context": UserContextPatch,
|
||||
"channel-context": ChannelContextPatch,
|
||||
|
|
@ -455,28 +461,11 @@ export default definePlugin({
|
|||
</ErrorBoundary>
|
||||
);
|
||||
},
|
||||
headerBarButton: {
|
||||
icon: WindowLaunchIcon,
|
||||
render: () => (
|
||||
<>
|
||||
<PopoutPersistenceSync />
|
||||
<WrappedPopoutHeaderButton />
|
||||
</>
|
||||
)
|
||||
},
|
||||
stop() {
|
||||
clearPersistedPopoutRestoreLoop();
|
||||
syncPersistedPopoutWindows();
|
||||
for (const windowKey of getOpenPopoutWindowKeys()) {
|
||||
PopoutActions.close(windowKey);
|
||||
}
|
||||
},
|
||||
async start() {
|
||||
restorePersistedPopouts();
|
||||
}
|
||||
});
|
||||
|
||||
const Header = ({ guild, channel }: { guild: Guild; channel: Channel; }) => {
|
||||
const recipientId = channel.isPrivate() ? channel.getRecipientId() as string : null;
|
||||
|
||||
const name = useStateFromStores([UserStore, RelationshipStore], () => getChannelTitle(channel), [channel.id, channel.name]);
|
||||
|
||||
const parentChannel = useStateFromStores(
|
||||
|
|
@ -484,7 +473,6 @@ const Header = ({ guild, channel }: { guild: Guild; channel: Channel; }) => {
|
|||
[channel?.parent_id]
|
||||
);
|
||||
|
||||
// @ts-ignore
|
||||
const closeSidebar = () => FluxDispatcher.dispatch({ type: "VC_SIDEBAR_CHAT_CLOSE", });
|
||||
|
||||
const isPopoutOpen = useStateFromStores(
|
||||
|
|
@ -543,51 +531,15 @@ const RenderPopout = ErrorBoundary.wrap(({ channel, name, windowKey }: { channel
|
|||
});
|
||||
}, [channel?.id]);
|
||||
|
||||
const theme = useStateFromStores([ThemeStore], () => ThemeStore?.theme ?? "dark");
|
||||
const guild = useStateFromStores([GuildStore], () => channel.guild_id ? GuildStore.getGuild(channel.guild_id) : null, [channel.guild_id]);
|
||||
|
||||
const [View, setViewComponent] = useState<React.ReactNode>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (!channel) return;
|
||||
|
||||
if (channel.isForumLikeChannel()) {
|
||||
requireForumView().then(() => {
|
||||
setViewComponent(
|
||||
<ForumView
|
||||
channel={channel}
|
||||
guild={guild}
|
||||
sidebarState={null}
|
||||
/>
|
||||
);
|
||||
});
|
||||
|
||||
setViewComponent(
|
||||
<div className={ChatClasses.loader}>
|
||||
<WanderingCubesLoading />
|
||||
</div>
|
||||
);
|
||||
} else {
|
||||
setViewComponent(
|
||||
<Chat
|
||||
channel={channel}
|
||||
guild={guild}
|
||||
chatInputType={ChatInputTypes.NORMAL}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}, [channel, guild]);
|
||||
|
||||
return (
|
||||
<PopoutWindow
|
||||
withTitleBar
|
||||
windowKey={windowKey}
|
||||
title={name || "Equicord"}
|
||||
channelId={channel.id}
|
||||
contentClassName={cl("popout")}
|
||||
>
|
||||
<div className={`${getThemeClasses(theme)} ${cl("window")}`}>
|
||||
{View}
|
||||
<div className={cl("window")}>
|
||||
<FullChannelView providedChannel={channel} />
|
||||
</div>
|
||||
</PopoutWindow>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -6,14 +6,12 @@
|
|||
|
||||
import { BaseText } from "@components/BaseText";
|
||||
import { Card } from "@components/Card";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { HeadphonesIcon } from "@components/Icons";
|
||||
import { Button, useEffect, useState } from "@webpack/common";
|
||||
|
||||
import pl, { Native, settings, SongLinkResult } from ".";
|
||||
import Providers from "./Providers";
|
||||
|
||||
const HeadphonesIcon = findComponentByCodeLazy("4.1-2.13h1.86A9");
|
||||
|
||||
export default function SongLinker({ url }: { url: string; }) {
|
||||
const [songData, setSongData] = useState<SongLinkResult>();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,19 +5,16 @@
|
|||
*/
|
||||
|
||||
import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||
import { RobotIcon } from "@components/Icons";
|
||||
import { EquicordDevs } from "@utils/constants";
|
||||
import { t } from "@utils/translation";
|
||||
import definePlugin, { IconComponent } from "@utils/types";
|
||||
import definePlugin from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import { ChannelStore, Menu } from "@webpack/common";
|
||||
|
||||
import { settings } from "./settings";
|
||||
import { getPayload, getResponse, handleResponse } from "./utils";
|
||||
|
||||
const RobotIconLazy = findComponentByCodeLazy("14.93-4H15a1 ");
|
||||
const RobotIcon: IconComponent = props => <RobotIconLazy {...props} />;
|
||||
|
||||
const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }: { message: Message; }) => {
|
||||
const payload = getPayload(message);
|
||||
if (!payload) return;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export default definePlugin({
|
|||
replacement: [
|
||||
{
|
||||
match: /(?<=children:\i\}\):\i,)null!=\i/,
|
||||
replace: "($&||Vencord.Api.NicknameIcons._renderIcons({userId:arguments[0].user?.id})?.length)"
|
||||
replace: "($&||!!Vencord.Api.NicknameIcons._renderIcons({userId:arguments[0].user?.id})?.length)"
|
||||
},
|
||||
{
|
||||
match: /(?<=shouldUnderlineOnHover:null.{0,300})children:(\i)(?=\}\)\])/,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { DataStore } from "@api/index";
|
||||
import { showNotification } from "@api/Notifications";
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
|
|
@ -77,6 +78,8 @@ export default definePlugin({
|
|||
],
|
||||
|
||||
handleCrash(_this: any, errorState: any) {
|
||||
DataStore.del("KeepCurrentChannel_previousData");
|
||||
|
||||
if (IS_DEV) {
|
||||
try {
|
||||
if (errorState?.info && "componentStack" in errorState.info) {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import openRolesAndUsersPermissionsModal from "./components/RolesAndUsersPermiss
|
|||
import UserPermissions from "./components/UserPermissions";
|
||||
import { getSortedRolesForMember, sortPermissionOverwrites } from "./utils";
|
||||
|
||||
const PopoutClasses = findCssClassesLazy("container", "scroller", "list");
|
||||
const PopoutClasses = findCssClassesLazy("container", "popoutRoleDot");
|
||||
|
||||
export const enum PermissionsSortOrder {
|
||||
HighestRole,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ import ReviewComponent from "./ReviewComponent";
|
|||
import ReviewsView, { ReviewsInputComponent } from "./ReviewsView";
|
||||
|
||||
const Paginator = findComponentByCodeLazy<ComponentProps<t.Paginator>>('rel:"prev",children:');
|
||||
const requirePaginator = extractAndLoadChunksLazy(['name:"SearchResults"'], new RegExp(`${DefaultExtractAndLoadChunksRegex.source}.{0,30}?name:"SearchResults"`));
|
||||
// This matches a massive module with ~230k chars so we need an anchor before to prevent REDOS
|
||||
const requirePaginator = extractAndLoadChunksLazy(['name:"SearchResults"'], new RegExp(`name:"StageChannelCall",renderLoader:.+?(?:${DefaultExtractAndLoadChunksRegex.source}).{0,30}?name:"SearchResults"`));
|
||||
|
||||
function Modal({ modalProps, modalKey, discordId, name, type }: { modalProps: any; modalKey: string, discordId: string; name: string; type: ReviewType; }) {
|
||||
const [data, setData] = useState<UserReviewsData>();
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ export default definePlugin({
|
|||
},
|
||||
{
|
||||
// Make the state of the old version of unreads box not include hidden channels
|
||||
find: "ignoreRecents:!0",
|
||||
find: "GUILD_EVENT)}),[",
|
||||
replacement: {
|
||||
match: /(?<=\.id\)\))(?=&&\(0,\i\.\i\)\((\i)\))/,
|
||||
replace: "&&!$self.isHiddenChannel($1)"
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ export default definePlugin({
|
|||
{
|
||||
find: ".EMOJI_PICKER_CONSTANTS_EMOJI_CONTAINER_PADDING_HORIZONTAL)",
|
||||
replacement: {
|
||||
match: /(openPopoutType:void 0(?=.+?isBurstReaction:(\i).+?;(\i===\i\.\i.REACTION)).+?\[\2,\i\]=\i\.useState\().+?\)/,
|
||||
match: /(openPopoutType:void 0(?=.+?isBurstReaction:(\i).+?;(\i===\i\.\i\.REACTION)&&\i\.push\().+?\[\2,\i\]=\i\.useState\()!1\)/,
|
||||
replace: (_, rest, _isBurstReactionVariable, isReactionIntention) => `${rest}$self.shouldSuperReactByDefault&&${isReactionIntention})`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue