mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 18:07:02 -04:00
Drop DoNotLeak + Extras
Co-Authored-By: thororen1234 <thororen1234@users.noreply.github.com> Co-Authored-By: thororen <78185467+thororen1234@users.noreply.github.com> Co-Authored-By: sadan4 <117494111+sadan4@users.noreply.github.com> Co-Authored-By: ynot01 <ynot000001@gmail.com> Co-Authored-By: MrDiamondDog <84212701+MrDiamondDog@users.noreply.github.com> Co-Authored-By: Crxaw <48805031+sitescript@users.noreply.github.com>
This commit is contained in:
parent
22bb603da1
commit
14bbde33cb
17 changed files with 68 additions and 223 deletions
|
@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
||||||
|
|
||||||
### Extra included plugins
|
### Extra included plugins
|
||||||
<details>
|
<details>
|
||||||
<summary>151 additional plugins</summary>
|
<summary>150 additional plugins</summary>
|
||||||
|
|
||||||
### All Platforms
|
### All Platforms
|
||||||
- AllCallTimers by MaxHerbold & D3SOX
|
- AllCallTimers by MaxHerbold & D3SOX
|
||||||
|
@ -45,7 +45,6 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
|
||||||
- DeadMembers by Kyuuhachi
|
- DeadMembers by Kyuuhachi
|
||||||
- Demonstration by Samwich
|
- Demonstration by Samwich
|
||||||
- DisableCameras by Joona
|
- DisableCameras by Joona
|
||||||
- DoNotLeak by Perny
|
|
||||||
- DontFilterMe by Samwich
|
- DontFilterMe by Samwich
|
||||||
- EmojiDumper by Cortex, Samwich, Woosh
|
- EmojiDumper by Cortex, Samwich, Woosh
|
||||||
- Encryptcord by Inbestigator
|
- Encryptcord by Inbestigator
|
||||||
|
|
|
@ -109,11 +109,11 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
colorIfServer(a: any): string | undefined {
|
colorIfServer(a: any): string | undefined {
|
||||||
const roleColor = a.author?.colorString ?? "inherit";
|
const roleColor = a.author?.colorString;
|
||||||
|
|
||||||
if (a?.channel?.guild_id && !settings.store.colorInServers) return roleColor;
|
if (a?.channel?.guild_id && !settings.store.colorInServers) return roleColor;
|
||||||
|
|
||||||
const color = getCustomColorString(a.message.author.id, true);
|
const color = getCustomColorString(a.message.author.id, true);
|
||||||
return color ?? roleColor;
|
return color ?? roleColor ?? undefined;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,85 +0,0 @@
|
||||||
/*
|
|
||||||
* Vencord, a Discord client mod
|
|
||||||
* Copyright (c) 2024 Vendicated and contributors
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { definePluginSettings } from "@api/Settings";
|
|
||||||
import { EquicordDevs } from "@utils/constants";
|
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
|
||||||
|
|
||||||
import { getStyle } from "./style";
|
|
||||||
|
|
||||||
const settings = definePluginSettings({
|
|
||||||
hoverToView: {
|
|
||||||
type: OptionType.BOOLEAN,
|
|
||||||
description: "When hovering over a message, show the contents.",
|
|
||||||
default: false,
|
|
||||||
onChange: () => {
|
|
||||||
console.log(settings.store.hoverToView);
|
|
||||||
updateClassList("hover-to-view", settings.store.hoverToView);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
keybind: {
|
|
||||||
type: OptionType.STRING,
|
|
||||||
description: "The keybind to show the contents of a message.",
|
|
||||||
default: "Insert",
|
|
||||||
restartNeeded: false,
|
|
||||||
},
|
|
||||||
enableForStream: {
|
|
||||||
type: OptionType.BOOLEAN,
|
|
||||||
description: "Blur all messages in streamer mode.",
|
|
||||||
default: false,
|
|
||||||
onChange: () => {
|
|
||||||
console.log(settings.store.enableForStream);
|
|
||||||
updateClassList(
|
|
||||||
"hide-in-streamer-mode",
|
|
||||||
settings.store.enableForStream
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
export default definePlugin({
|
|
||||||
name: "DoNotLeak",
|
|
||||||
tags: ["DontLeak"],
|
|
||||||
description: "Hide all message contents and attachments when you're streaming or sharing your screen.",
|
|
||||||
authors: [EquicordDevs.Perny],
|
|
||||||
settings,
|
|
||||||
start() {
|
|
||||||
const styles = getStyle();
|
|
||||||
|
|
||||||
const style = document.createElement("style");
|
|
||||||
style.setAttribute("id", "vc-dont-leak-style");
|
|
||||||
style.innerHTML = styles;
|
|
||||||
document.head.appendChild(style);
|
|
||||||
|
|
||||||
document.addEventListener("keyup", keyUpHandler);
|
|
||||||
document.addEventListener("keydown", keyDownHandler);
|
|
||||||
updateClassList("hover-to-view", settings.store.hoverToView);
|
|
||||||
updateClassList("hide-in-streamer-mode", settings.store.enableForStream);
|
|
||||||
},
|
|
||||||
stop() {
|
|
||||||
document.removeEventListener("keyup", keyUpHandler);
|
|
||||||
document.removeEventListener("keydown", keyDownHandler);
|
|
||||||
document.getElementById("vc-dont-leak-style")?.remove();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
function updateClassList(className, condition) {
|
|
||||||
if (condition) {
|
|
||||||
document.body.classList.add(`vc-dnl-${className}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
document.body.classList.remove(`vc-dnl-${className}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
function keyUpHandler(e: KeyboardEvent) {
|
|
||||||
if (e.key !== settings.store.keybind) return;
|
|
||||||
updateClassList("show-messages", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function keyDownHandler(e: KeyboardEvent) {
|
|
||||||
if (e.key !== settings.store.keybind) return;
|
|
||||||
updateClassList("show-messages", true);
|
|
||||||
}
|
|
|
@ -1,116 +0,0 @@
|
||||||
/*
|
|
||||||
* Vencord, a Discord client mod
|
|
||||||
* Copyright (c) 2024 Vendicated and contributors
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*/
|
|
||||||
|
|
||||||
import { findByProps } from "@webpack";
|
|
||||||
|
|
||||||
const CssFormatCode: string = `body:has(
|
|
||||||
div.{sidebar}
|
|
||||||
> section
|
|
||||||
div.{wrapper}
|
|
||||||
div.{actionButtons}
|
|
||||||
> button:nth-child(2).{buttonActive}
|
|
||||||
)
|
|
||||||
.{messageContent} {
|
|
||||||
filter: blur(12px);
|
|
||||||
}
|
|
||||||
|
|
||||||
body:has(
|
|
||||||
div.{sidebar}
|
|
||||||
> section
|
|
||||||
div.{wrapper}
|
|
||||||
div.{actionButtons}
|
|
||||||
> button:nth-child(2).{buttonActive}
|
|
||||||
)
|
|
||||||
.{visualMediaItemContainer} {
|
|
||||||
filter: blur(50px) brightness(0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
body:has(
|
|
||||||
div.{sidebar}
|
|
||||||
> section
|
|
||||||
div.{wrapper}
|
|
||||||
div.{actionButtons}
|
|
||||||
> button:nth-child(2).{buttonActive}
|
|
||||||
)
|
|
||||||
.{embedWrapper} {
|
|
||||||
filter: blur(50px);
|
|
||||||
}
|
|
||||||
|
|
||||||
body.vc-dnl-hide-in-streamer-mode:has(.{notice}.{colorStreamerMode})
|
|
||||||
.{visualMediaItemContainer} {
|
|
||||||
filter: blur(50px) brightness(0.1);
|
|
||||||
}
|
|
||||||
|
|
||||||
body.vc-dnl-hide-in-streamer-mode:has(.{notice}.{colorStreamerMode})
|
|
||||||
.{messageContent} {
|
|
||||||
filter: blur(12px);
|
|
||||||
}
|
|
||||||
|
|
||||||
body.vc-dnl-hide-in-streamer-mode:has(.{notice}.{colorStreamerMode})
|
|
||||||
.{embedWrapper} {
|
|
||||||
filter: blur(50px);
|
|
||||||
}
|
|
||||||
|
|
||||||
body.vc-dnl-show-messages .{visualMediaItemContainer} {
|
|
||||||
filter: blur(0px) brightness(1) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.vc-dnl-show-messages .{messageContent} {
|
|
||||||
filter: blur(0px) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.vc-dnl-show-messages .{embedWrapper} {
|
|
||||||
filter: blur(0px) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.vc-dnl-hover-to-view .{messageContent}:hover {
|
|
||||||
filter: blur(0px) brightness(1) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.vc-dnl-hover-to-view .{embedWrapper}:hover {
|
|
||||||
filter: blur(0px) brightness(1) !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.vc-dnl-hover-to-view .{visualMediaItemContainer}:hover {
|
|
||||||
filter: blur(0px) brightness(1) !important;
|
|
||||||
}`;
|
|
||||||
|
|
||||||
/*
|
|
||||||
[
|
|
||||||
"sidebar",
|
|
||||||
"wrapper",
|
|
||||||
"actionButtons",
|
|
||||||
"buttonActive",
|
|
||||||
"messageContent",
|
|
||||||
"visualMediaItemContainer",
|
|
||||||
"embedWrapper",
|
|
||||||
"notice",
|
|
||||||
"colorStreamerMode",
|
|
||||||
]
|
|
||||||
*/
|
|
||||||
|
|
||||||
export function getStyle(): string {
|
|
||||||
const messageContent = findByProps("messageContent", "titleCase"); // ["messageContent","wrapper"]
|
|
||||||
const embedWrapper = findByProps("embedWrapper");
|
|
||||||
const mediaContainer = findByProps("visualMediaItemContainer");
|
|
||||||
const notice = findByProps("colorStreamerMode", "notice");
|
|
||||||
const actionBar = findByProps("actionButtons", "buttonActive", "wrapper");
|
|
||||||
const sidebar = findByProps("sidebar", "panels");
|
|
||||||
const Classes = Object.assign(
|
|
||||||
{},
|
|
||||||
actionBar,
|
|
||||||
notice,
|
|
||||||
mediaContainer,
|
|
||||||
embedWrapper,
|
|
||||||
messageContent,
|
|
||||||
sidebar
|
|
||||||
);
|
|
||||||
let CssCode = CssFormatCode;
|
|
||||||
for (const className in Classes) {
|
|
||||||
CssCode = CssCode.replaceAll(`{${className}}`, Classes[className]);
|
|
||||||
}
|
|
||||||
return CssCode;
|
|
||||||
}
|
|
|
@ -32,7 +32,7 @@ const patchMessageContextMenu: NavContextMenuPatchCallback = (children, { messag
|
||||||
const { deleted, id, channel_id } = message;
|
const { deleted, id, channel_id } = message;
|
||||||
if (deleted || message.state !== "SENT") return;
|
if (deleted || message.state !== "SENT") return;
|
||||||
|
|
||||||
const isHidden = hiddenMessages?.has(id) ?? false;
|
const isHidden = hiddenMessages?.has(id) || false;
|
||||||
if (isHidden) {
|
if (isHidden) {
|
||||||
return children.push(
|
return children.push(
|
||||||
<Menu.MenuItem
|
<Menu.MenuItem
|
||||||
|
@ -98,7 +98,7 @@ const buildCss = () => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const revealMessage = (id: string) => {
|
export const revealMessage = (id: string) => {
|
||||||
const isHidden = hiddenMessages?.has(id) ?? false;
|
const isHidden = hiddenMessages?.has(id) || false;
|
||||||
if (isHidden) {
|
if (isHidden) {
|
||||||
hiddenMessages.delete(id);
|
hiddenMessages.delete(id);
|
||||||
buildCss();
|
buildCss();
|
||||||
|
@ -149,7 +149,7 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
|
|
||||||
addMessageAccessory("vc-hide-message", ({ message }) => {
|
addMessageAccessory("vc-hide-message", ({ message }) => {
|
||||||
const isHidden = hiddenMessages?.has(message.id) ?? false;
|
const isHidden = hiddenMessages?.has(message.id) || false;
|
||||||
if (isHidden && settings.store.showNotice) return <HideMessageAccessory id={message.id} />;
|
if (isHidden && settings.store.showNotice) return <HideMessageAccessory id={message.id} />;
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
|
@ -225,6 +225,11 @@ const settings = definePluginSettings({
|
||||||
description: "Show the Stats.fm next to the albums cover",
|
description: "Show the Stats.fm next to the albums cover",
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
default: true,
|
default: true,
|
||||||
|
},
|
||||||
|
alwaysHideArt: {
|
||||||
|
description: "Disable downloading album art",
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
default: false,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -295,7 +300,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
getLargeImage(track: TrackData): string | undefined {
|
getLargeImage(track: TrackData): string | undefined {
|
||||||
if (track.imageUrl && !track.imageUrl.includes(placeholderId))
|
if (!settings.store.alwaysHideArt && track.imageUrl && !track.imageUrl.includes(placeholderId))
|
||||||
return track.imageUrl;
|
return track.imageUrl;
|
||||||
|
|
||||||
if (settings.store.missingArt === "placeholder")
|
if (settings.store.missingArt === "placeholder")
|
||||||
|
|
|
@ -105,6 +105,10 @@ export default definePlugin({
|
||||||
if (unreadCount >= 100) { paddingValue = 4; } else
|
if (unreadCount >= 100) { paddingValue = 4; } else
|
||||||
if (unreadCount >= 10) { paddingValue = 2; } else
|
if (unreadCount >= 10) { paddingValue = 2; } else
|
||||||
paddingValue = 0;
|
paddingValue = 0;
|
||||||
|
let widthValue = 16;
|
||||||
|
if (unreadCount >= 100) { widthValue = 30; } else
|
||||||
|
if (unreadCount >= 10) { widthValue = 22; } else
|
||||||
|
widthValue = 16;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NumberBadge
|
<NumberBadge
|
||||||
|
@ -114,9 +118,7 @@ export default definePlugin({
|
||||||
? "+99"
|
? "+99"
|
||||||
: unreadCount
|
: unreadCount
|
||||||
}
|
}
|
||||||
width={
|
width={widthValue}
|
||||||
unreadCount >= 10 ? 22 : 16
|
|
||||||
}
|
|
||||||
padding={paddingValue}
|
padding={paddingValue}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
@ -211,7 +211,7 @@ const settings = definePluginSettings({
|
||||||
muteMessage: {
|
muteMessage: {
|
||||||
type: OptionType.STRING,
|
type: OptionType.STRING,
|
||||||
description: "Mute Message (only self for now)",
|
description: "Mute Message (only self for now)",
|
||||||
default: "{{DISPLAY_NAME}} Muted",
|
default: "{{DISPLAY_NAME}} muted",
|
||||||
},
|
},
|
||||||
unmuteMessage: {
|
unmuteMessage: {
|
||||||
type: OptionType.STRING,
|
type: OptionType.STRING,
|
||||||
|
|
|
@ -86,7 +86,11 @@ async function generateDebugInfoMessage() {
|
||||||
`v${VERSION} • [${gitHash}](<https://github.com/Equicord/Equicord/commit/${gitHash}>)` +
|
`v${VERSION} • [${gitHash}](<https://github.com/Equicord/Equicord/commit/${gitHash}>)` +
|
||||||
`${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat("en-GB", { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`,
|
`${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat("en-GB", { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`,
|
||||||
Client: `${RELEASE_CHANNEL} ~ ${client}`,
|
Client: `${RELEASE_CHANNEL} ~ ${client}`,
|
||||||
Platform: window.navigator.platform
|
Platform: typeof DiscordNative !== "undefined" ?
|
||||||
|
`${DiscordNative.process.platform === "darwin" ?
|
||||||
|
(DiscordNative.process.arch === "arm64" ? "MacSilicon" : "MacIntel") :
|
||||||
|
(DiscordNative.process.platform === "win32" && DiscordNative.process.arch === "x64" ? "Windows" : DiscordNative.process.platform)}` :
|
||||||
|
window.navigator.platform
|
||||||
};
|
};
|
||||||
|
|
||||||
if (IS_DISCORD_DESKTOP) {
|
if (IS_DISCORD_DESKTOP) {
|
||||||
|
|
|
@ -95,7 +95,7 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}",
|
find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /this\.renderNameZone\(\).+?children:\[/,
|
match: /className:\i\.buttons,.{0,50}children:\[/,
|
||||||
replace: "$&$self.GameActivityToggleButton(),"
|
replace: "$&$self.GameActivityToggleButton(),"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ export default definePlugin({
|
||||||
|
|
||||||
if (!msg.attachments.length && !msg.embeds.length && !msg.stickerItems.length && !hasAttachmentsInShapshots) return null;
|
if (!msg.attachments.length && !msg.embeds.length && !msg.stickerItems.length && !hasAttachmentsInShapshots) return null;
|
||||||
|
|
||||||
const isHidden = hiddenMessages?.has(msg.id) ?? false;
|
const isHidden = hiddenMessages?.has(msg.id) || false;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
label: isHidden ? "Show Media" : "Hide Media",
|
label: isHidden ? "Show Media" : "Hide Media",
|
||||||
|
@ -93,7 +93,8 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
shouldHide(messageId: string) {
|
shouldHide(messageId: string) {
|
||||||
return hiddenMessages?.has(messageId) ?? false;
|
return hiddenMessages?.has(messageId) || false;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async toggleHide(channelId: string, messageId: string) {
|
async toggleHide(channelId: string, messageId: string) {
|
||||||
|
|
|
@ -197,6 +197,11 @@ const settings = definePluginSettings({
|
||||||
description: "show the Last.fm logo by the album cover",
|
description: "show the Last.fm logo by the album cover",
|
||||||
type: OptionType.BOOLEAN,
|
type: OptionType.BOOLEAN,
|
||||||
default: true,
|
default: true,
|
||||||
|
},
|
||||||
|
alwaysHideArt: {
|
||||||
|
description: "Disable downloading album art",
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
default: false,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -279,7 +284,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
getLargeImage(track: TrackData): string | undefined {
|
getLargeImage(track: TrackData): string | undefined {
|
||||||
if (track.imageUrl && !track.imageUrl.includes(placeholderId))
|
if (!settings.store.alwaysHideArt && track.imageUrl && !track.imageUrl.includes(placeholderId))
|
||||||
return track.imageUrl;
|
return track.imageUrl;
|
||||||
|
|
||||||
if (settings.store.missingArt === "placeholder")
|
if (settings.store.missingArt === "placeholder")
|
||||||
|
|
|
@ -57,7 +57,7 @@ export function TranslationAccessory({ message }: { message: Message; }) {
|
||||||
<span className={cl("accessory")}>
|
<span className={cl("accessory")}>
|
||||||
<TranslateIcon width={16} height={16} className={cl("accessory-icon")} />
|
<TranslateIcon width={16} height={16} className={cl("accessory-icon")} />
|
||||||
{Parser.parse(translation.text)}
|
{Parser.parse(translation.text)}
|
||||||
{" "}
|
<br />
|
||||||
(translated from {translation.sourceLanguage} - <Dismiss onDismiss={() => setTranslation(undefined)} />)
|
(translated from {translation.sourceLanguage} - <Dismiss onDismiss={() => setTranslation(undefined)} />)
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
|
@ -22,12 +22,21 @@ import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/Co
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { ChannelStore, Menu } from "@webpack/common";
|
import { ChannelStore, Menu } from "@webpack/common";
|
||||||
|
import { Message } from "discord-types/general";
|
||||||
|
|
||||||
import { settings } from "./settings";
|
import { settings } from "./settings";
|
||||||
import { setShouldShowTranslateEnabledTooltip, TranslateChatBarIcon, TranslateIcon } from "./TranslateIcon";
|
import { setShouldShowTranslateEnabledTooltip, TranslateChatBarIcon, TranslateIcon } from "./TranslateIcon";
|
||||||
import { handleTranslate, TranslationAccessory } from "./TranslationAccessory";
|
import { handleTranslate, TranslationAccessory } from "./TranslationAccessory";
|
||||||
import { translate } from "./utils";
|
import { translate } from "./utils";
|
||||||
|
|
||||||
|
interface IMessageCreate {
|
||||||
|
type: "MESSAGE_CREATE";
|
||||||
|
optimistic: boolean;
|
||||||
|
isPushNotification: boolean;
|
||||||
|
channelId: string;
|
||||||
|
message: Message;
|
||||||
|
}
|
||||||
|
|
||||||
const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }) => {
|
const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }) => {
|
||||||
if (!message.content) return;
|
if (!message.content) return;
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,11 @@ export const settings = definePluginSettings({
|
||||||
description: "Show a tooltip on the ChatBar button whenever a message is automatically translated",
|
description: "Show a tooltip on the ChatBar button whenever a message is automatically translated",
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
|
disableOnSameLanguage: {
|
||||||
|
type: OptionType.BOOLEAN,
|
||||||
|
description: "Disable auto translate if the current language doesnt change",
|
||||||
|
default: true
|
||||||
|
}
|
||||||
}).withPrivateSettings<{
|
}).withPrivateSettings<{
|
||||||
showAutoTranslateAlert: boolean;
|
showAutoTranslateAlert: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin from "@utils/types";
|
||||||
import { ChannelStore, SelectedChannelStore } from "@webpack/common";
|
import { ChannelRouter, ChannelStore, SelectedChannelStore } from "@webpack/common";
|
||||||
|
|
||||||
const timers = {} as Record<string, {
|
const timers = {} as Record<string, {
|
||||||
timeout?: NodeJS.Timeout;
|
timeout?: NodeJS.Timeout;
|
||||||
|
@ -28,7 +28,7 @@ const timers = {} as Record<string, {
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "VoiceChatDoubleClick",
|
name: "VoiceChatDoubleClick",
|
||||||
description: "Join voice chats via double click instead of single click",
|
description: "Join voice chats via double click instead of single click",
|
||||||
authors: [Devs.Ven, Devs.D3SOX],
|
authors: [Devs.Ven, Devs.D3SOX, Devs.sadan],
|
||||||
patches: [
|
patches: [
|
||||||
...[
|
...[
|
||||||
".handleVoiceStatusClick", // voice channels
|
".handleVoiceStatusClick", // voice channels
|
||||||
|
@ -54,9 +54,25 @@ export default definePlugin({
|
||||||
replace: (_, onClick, props) => ""
|
replace: (_, onClick, props) => ""
|
||||||
+ `onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${props})&&${onClick}()`,
|
+ `onClick:(vcDoubleClickEvt)=>$self.shouldRunOnClick(vcDoubleClickEvt,${props})&&${onClick}()`,
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
// Voice channels in the active now section
|
||||||
|
{
|
||||||
|
find: ',["embedded_background"]',
|
||||||
|
replacement: {
|
||||||
|
// There are two onClick events for this section, one for the server icon, and another for the channel name
|
||||||
|
// The server icon takes you to the voice channel, but doesnt join it. The channel name joins the voice channel
|
||||||
|
match: /(?=children)(?<=selectVoiceChannel\((\i)\.id\).{0,100})/,
|
||||||
|
replace: "onClick:$self.goToChannel.bind(null,$1),"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
goToChannel(props: { id?: string; } | undefined) {
|
||||||
|
const { id } = props ?? {};
|
||||||
|
if (!id) return console.error("No channel id found");
|
||||||
|
ChannelRouter.transitionToChannel(id);
|
||||||
|
},
|
||||||
|
|
||||||
shouldRunOnClick(e: MouseEvent, { channelId }) {
|
shouldRunOnClick(e: MouseEvent, { channelId }) {
|
||||||
const channel = ChannelStore.getChannel(channelId);
|
const channel = ChannelStore.getChannel(channelId);
|
||||||
if (!channel || ![2, 13].includes(channel.type)) return true;
|
if (!channel || ![2, 13].includes(channel.type)) return true;
|
||||||
|
|
|
@ -273,7 +273,7 @@ export default definePlugin({
|
||||||
muteMessage: {
|
muteMessage: {
|
||||||
type: OptionType.STRING,
|
type: OptionType.STRING,
|
||||||
description: "Mute Message (only self for now)",
|
description: "Mute Message (only self for now)",
|
||||||
default: "{{USER}} Muted"
|
default: "{{USER}} muted"
|
||||||
},
|
},
|
||||||
unmuteMessage: {
|
unmuteMessage: {
|
||||||
type: OptionType.STRING,
|
type: OptionType.STRING,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue