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:
panbread 2025-02-26 21:50:23 +04:00 committed by thororen1234
parent 7731a7f0e5
commit 83c3497951
No known key found for this signature in database
17 changed files with 68 additions and 223 deletions

View file

@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
### Extra included plugins
<details>
<summary>151 additional plugins</summary>
<summary>150 additional plugins</summary>
### All Platforms
- AllCallTimers by MaxHerbold & D3SOX
@ -45,7 +45,6 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
- DeadMembers by Kyuuhachi
- Demonstration by Samwich
- DisableCameras by Joona
- DoNotLeak by Perny
- DontFilterMe by Samwich
- EmojiDumper by Cortex, Samwich, Woosh
- Encryptcord by Inbestigator
@ -190,7 +189,7 @@ Linux
- [AUR](https://aur.archlinux.org/packages?O=0&K=equicord)
```shell
sh -c "$(curl -sS https://raw.githubusercontent.com/Equicord/Equicord/refs/heads/main/misc/install.sh)"
```
```
## Installing Equicord Devbuild
### Dependencies

View file

@ -109,11 +109,11 @@ export default definePlugin({
},
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;
const color = getCustomColorString(a.message.author.id, true);
return color ?? roleColor;
return color ?? roleColor ?? undefined;
}
});

View file

@ -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);
}

View file

@ -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;
}

View file

@ -32,7 +32,7 @@ const patchMessageContextMenu: NavContextMenuPatchCallback = (children, { messag
const { deleted, id, channel_id } = message;
if (deleted || message.state !== "SENT") return;
const isHidden = hiddenMessages?.has(id) ?? false;
const isHidden = hiddenMessages?.has(id) || false;
if (isHidden) {
return children.push(
<Menu.MenuItem
@ -98,7 +98,7 @@ const buildCss = () => {
};
export const revealMessage = (id: string) => {
const isHidden = hiddenMessages?.has(id) ?? false;
const isHidden = hiddenMessages?.has(id) || false;
if (isHidden) {
hiddenMessages.delete(id);
buildCss();
@ -149,7 +149,7 @@ export default definePlugin({
}
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} />;
return null;
});

View file

@ -225,6 +225,11 @@ const settings = definePluginSettings({
description: "Show the Stats.fm next to the albums cover",
type: OptionType.BOOLEAN,
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 {
if (track.imageUrl && !track.imageUrl.includes(placeholderId))
if (!settings.store.alwaysHideArt && track.imageUrl && !track.imageUrl.includes(placeholderId))
return track.imageUrl;
if (settings.store.missingArt === "placeholder")

View file

@ -105,6 +105,10 @@ export default definePlugin({
if (unreadCount >= 100) { paddingValue = 4; } else
if (unreadCount >= 10) { paddingValue = 2; } else
paddingValue = 0;
let widthValue = 16;
if (unreadCount >= 100) { widthValue = 30; } else
if (unreadCount >= 10) { widthValue = 22; } else
widthValue = 16;
return (
<NumberBadge
@ -114,9 +118,7 @@ export default definePlugin({
? "+99"
: unreadCount
}
width={
unreadCount >= 10 ? 22 : 16
}
width={widthValue}
padding={paddingValue}
/>
);

View file

@ -211,7 +211,7 @@ const settings = definePluginSettings({
muteMessage: {
type: OptionType.STRING,
description: "Mute Message (only self for now)",
default: "{{DISPLAY_NAME}} Muted",
default: "{{DISPLAY_NAME}} muted",
},
unmuteMessage: {
type: OptionType.STRING,

View file

@ -86,7 +86,11 @@ async function generateDebugInfoMessage() {
`v${VERSION} • [${gitHash}](<https://github.com/Equicord/Equicord/commit/${gitHash}>)` +
`${SettingsPlugin.additionalInfo} - ${Intl.DateTimeFormat("en-GB", { dateStyle: "medium" }).format(BUILD_TIMESTAMP)}`,
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) {

View file

@ -95,7 +95,7 @@ export default definePlugin({
{
find: "#{intl::ACCOUNT_SPEAKING_WHILE_MUTED}",
replacement: {
match: /this\.renderNameZone\(\).+?children:\[/,
match: /className:\i\.buttons,.{0,50}children:\[/,
replace: "$&$self.GameActivityToggleButton(),"
}
}

View file

@ -63,7 +63,7 @@ export default definePlugin({
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 {
label: isHidden ? "Show Media" : "Hide Media",
@ -93,7 +93,8 @@ export default definePlugin({
},
shouldHide(messageId: string) {
return hiddenMessages?.has(messageId) ?? false;
return hiddenMessages?.has(messageId) || false;
},
async toggleHide(channelId: string, messageId: string) {

View file

@ -197,6 +197,11 @@ const settings = definePluginSettings({
description: "show the Last.fm logo by the album cover",
type: OptionType.BOOLEAN,
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 {
if (track.imageUrl && !track.imageUrl.includes(placeholderId))
if (!settings.store.alwaysHideArt && track.imageUrl && !track.imageUrl.includes(placeholderId))
return track.imageUrl;
if (settings.store.missingArt === "placeholder")

View file

@ -57,7 +57,7 @@ export function TranslationAccessory({ message }: { message: Message; }) {
<span className={cl("accessory")}>
<TranslateIcon width={16} height={16} className={cl("accessory-icon")} />
{Parser.parse(translation.text)}
{" "}
<br />
(translated from {translation.sourceLanguage} - <Dismiss onDismiss={() => setTranslation(undefined)} />)
</span>
);

View file

@ -22,12 +22,21 @@ import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/Co
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { ChannelStore, Menu } from "@webpack/common";
import { Message } from "discord-types/general";
import { settings } from "./settings";
import { setShouldShowTranslateEnabledTooltip, TranslateChatBarIcon, TranslateIcon } from "./TranslateIcon";
import { handleTranslate, TranslationAccessory } from "./TranslationAccessory";
import { translate } from "./utils";
interface IMessageCreate {
type: "MESSAGE_CREATE";
optimistic: boolean;
isPushNotification: boolean;
channelId: string;
message: Message;
}
const messageCtxPatch: NavContextMenuPatchCallback = (children, { message }) => {
if (!message.content) return;

View file

@ -78,6 +78,11 @@ export const settings = definePluginSettings({
description: "Show a tooltip on the ChatBar button whenever a message is automatically translated",
default: true
},
disableOnSameLanguage: {
type: OptionType.BOOLEAN,
description: "Disable auto translate if the current language doesnt change",
default: true
}
}).withPrivateSettings<{
showAutoTranslateAlert: boolean;
}>();

View file

@ -18,7 +18,7 @@
import { Devs } from "@utils/constants";
import definePlugin from "@utils/types";
import { ChannelStore, SelectedChannelStore } from "@webpack/common";
import { ChannelRouter, ChannelStore, SelectedChannelStore } from "@webpack/common";
const timers = {} as Record<string, {
timeout?: NodeJS.Timeout;
@ -28,7 +28,7 @@ const timers = {} as Record<string, {
export default definePlugin({
name: "VoiceChatDoubleClick",
description: "Join voice chats via double click instead of single click",
authors: [Devs.Ven, Devs.D3SOX],
authors: [Devs.Ven, Devs.D3SOX, Devs.sadan],
patches: [
...[
".handleVoiceStatusClick", // voice channels
@ -54,9 +54,25 @@ export default definePlugin({
replace: (_, onClick, props) => ""
+ `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 }) {
const channel = ChannelStore.getChannel(channelId);
if (!channel || ![2, 13].includes(channel.type)) return true;

View file

@ -273,7 +273,7 @@ export default definePlugin({
muteMessage: {
type: OptionType.STRING,
description: "Mute Message (only self for now)",
default: "{{USER}} Muted"
default: "{{USER}} muted"
},
unmuteMessage: {
type: OptionType.STRING,