From b1cdf7a35d17158c05ae22382ef8874bb35d4a54 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Mon, 29 Sep 2025 03:47:28 +0200 Subject: [PATCH 1/3] add vesktop protocol to csp whitelist --- src/main/csp/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/csp/index.ts b/src/main/csp/index.ts index c4192f4b7..887010b6d 100644 --- a/src/main/csp/index.ts +++ b/src/main/csp/index.ts @@ -110,7 +110,7 @@ const patchCsp = (headers: PolicyMap) => { pushDirective("script-src", "'unsafe-inline'", "'unsafe-eval'"); for (const directive of ["style-src", "connect-src", "img-src", "font-src", "media-src", "worker-src"]) { - pushDirective(directive, "blob:", "data:", "vencord:"); + pushDirective(directive, "blob:", "data:", "vencord:", "vesktop:"); } for (const [host, directives] of Object.entries(NativeSettings.store.customCspRules)) { From c26fb038498ef76ecc2d8aaaf6d49839f31ba285 Mon Sep 17 00:00:00 2001 From: thororen <78185467+thororen1234@users.noreply.github.com> Date: Mon, 29 Sep 2025 12:16:00 -0400 Subject: [PATCH 2/3] QuickReply: Ignore messages by blocked/ignored users (#3659) Co-authored-by: V --- src/plugins/quickReply/index.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/plugins/quickReply/index.ts b/src/plugins/quickReply/index.ts index 06cd7688c..f620be411 100644 --- a/src/plugins/quickReply/index.ts +++ b/src/plugins/quickReply/index.ts @@ -21,7 +21,7 @@ import { Devs, IS_MAC } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; import { Message } from "@vencord/discord-types"; import { MessageFlags } from "@vencord/discord-types/enums"; -import { ChannelStore, ComponentDispatch, FluxDispatcher as Dispatcher, MessageActions, MessageStore, MessageTypeSets, PermissionsBits, PermissionStore, SelectedChannelStore, UserStore } from "@webpack/common"; +import { ChannelStore, ComponentDispatch, FluxDispatcher as Dispatcher, MessageActions, MessageStore, MessageTypeSets, PermissionsBits, PermissionStore, RelationshipStore, SelectedChannelStore, UserStore } from "@webpack/common"; import NoBlockedMessagesPlugin from "plugins/noBlockedMessages"; import NoReplyMentionPlugin from "plugins/noReplyMention"; @@ -40,13 +40,18 @@ const settings = definePluginSettings({ description: "Ping reply by default", options: [ { - label: "Follow NoReplyMention", + label: "Follow NoReplyMention plugin (if enabled)", value: MentionOptions.NO_REPLY_MENTION_PLUGIN, default: true }, { label: "Enabled", value: MentionOptions.ENABLED }, { label: "Disabled", value: MentionOptions.DISABLED }, ] + }, + ignoreBlockedAndIgnored: { + type: OptionType.BOOLEAN, + description: "Ignore messages by blocked/ignored users when navigating", + default: true } }); @@ -126,7 +131,7 @@ function jumpIfOffScreen(channelId: string, messageId: string) { } function getNextMessage(isUp: boolean, isReply: boolean) { - let messages: Array = MessageStore.getMessages(SelectedChannelStore.getChannelId())._array; + let messages: Message[] = MessageStore.getMessages(SelectedChannelStore.getChannelId())._array; const meId = UserStore.getCurrentUser().id; const hasNoBlockedMessages = Vencord.Plugins.isPluginEnabled(NoBlockedMessagesPlugin.name); @@ -134,8 +139,9 @@ function getNextMessage(isUp: boolean, isReply: boolean) { messages = messages.filter(m => { if (m.deleted) return false; if (!isReply && m.author.id !== meId) return false; // editing only own messages - if (hasNoBlockedMessages && NoBlockedMessagesPlugin.shouldIgnoreMessage(m)) return false; if (!MessageTypeSets.REPLYABLE.has(m.type) || m.hasFlag(MessageFlags.EPHEMERAL)) return false; + if (settings.store.ignoreBlockedAndIgnored && RelationshipStore.isBlockedOrIgnored(m.author.id)) return false; + if (hasNoBlockedMessages && NoBlockedMessagesPlugin.shouldIgnoreMessage(m)) return false; return true; }); From fd461045b9254d7b11c34d7e9b85f787cc692ba3 Mon Sep 17 00:00:00 2001 From: thororen <78185467+thororen1234@users.noreply.github.com> Date: Mon, 29 Sep 2025 20:51:37 -0400 Subject: [PATCH 3/3] new plugin AutoDNDWhilePlaying (#3652) Co-authored-by: Vendicated --- .../README.md | 5 ++ .../index.ts | 61 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 src/plugins/autoDndWhilePlaying.discordDesktop/README.md create mode 100644 src/plugins/autoDndWhilePlaying.discordDesktop/index.ts diff --git a/src/plugins/autoDndWhilePlaying.discordDesktop/README.md b/src/plugins/autoDndWhilePlaying.discordDesktop/README.md new file mode 100644 index 000000000..52a611801 --- /dev/null +++ b/src/plugins/autoDndWhilePlaying.discordDesktop/README.md @@ -0,0 +1,5 @@ +# AutoDNDWhilePlaying + +This plugin automatically updates your online status (online, idle, dnd) when launching games. + +It will change your status back to the prior status when the game is closed. diff --git a/src/plugins/autoDndWhilePlaying.discordDesktop/index.ts b/src/plugins/autoDndWhilePlaying.discordDesktop/index.ts new file mode 100644 index 000000000..faf238cd8 --- /dev/null +++ b/src/plugins/autoDndWhilePlaying.discordDesktop/index.ts @@ -0,0 +1,61 @@ +/* + * 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 { getUserSettingLazy } from "@api/UserSettings"; +import { Devs } from "@utils/constants"; +import definePlugin, { OptionType } from "@utils/types"; + +let savedStatus: string | null; + +const StatusSettings = getUserSettingLazy("status", "status")!; + +const settings = definePluginSettings({ + statusToSet: { + type: OptionType.SELECT, + description: "Status to set while playing a game", + options: [ + { + label: "Online", + value: "online", + }, + { + label: "Idle", + value: "idle", + }, + { + label: "Do Not Disturb", + value: "dnd", + default: true + }, + { + label: "Invisible", + value: "invisible", + } + ] + } +}); + +export default definePlugin({ + name: "AutoDNDWhilePlaying", + description: "Automatically updates your online status (online, idle, dnd) when launching games", + authors: [Devs.thororen], + settings, + flux: { + RUNNING_GAMES_CHANGE({ games }) { + const status = StatusSettings.getSetting(); + + if (games.length > 0) { + if (status !== settings.store.statusToSet) { + savedStatus = status; + StatusSettings.updateSetting(settings.store.statusToSet); + } + } else if (savedStatus && savedStatus !== settings.store.statusToSet) { + StatusSettings.updateSetting(savedStatus); + } + } + } +});