From 2eaa0bfbc401a0eb2e9a40ad1608f82bffc8b81e Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 13 Sep 2025 20:32:47 -0400 Subject: [PATCH 1/3] IgnoreCalls: Redo Setting --- src/equicordplugins/ignoreCalls/index.tsx | 38 ++++++++++++---------- src/equicordplugins/ignoreCalls/styles.css | 4 +++ 2 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 src/equicordplugins/ignoreCalls/styles.css diff --git a/src/equicordplugins/ignoreCalls/index.tsx b/src/equicordplugins/ignoreCalls/index.tsx index adfda0bde..cf0bbe966 100644 --- a/src/equicordplugins/ignoreCalls/index.tsx +++ b/src/equicordplugins/ignoreCalls/index.tsx @@ -6,18 +6,20 @@ import { NavContextMenuPatchCallback } from "@api/ContextMenu"; import { definePluginSettings } from "@api/Settings"; +import { classNameFactory } from "@api/Styles"; import { ErrorBoundary } from "@components/index"; import { EquicordDevs } from "@utils/constants"; -import definePlugin, { OptionType } from "@utils/types"; +import definePlugin, { makeRange, OptionType } from "@utils/types"; import { Channel } from "@vencord/discord-types"; import { FluxDispatcher, Menu, React, UserStore } from "@webpack/common"; -const ignoredChannelIds = new Set(); +const ignoredChannelIds: string[] = []; +const cl = classNameFactory("vc-ignore-calls-"); const ContextMenuPatch: NavContextMenuPatchCallback = (children, { channel }: { channel: Channel; }) => { if (!channel || (!channel.isDM() && !channel.isGroupDM())) return; - const [checked, setChecked] = React.useState(ignoredChannelIds.has(channel.id)); + const [checked, setChecked] = React.useState(ignoredChannelIds.includes(channel.id)); children.push( , @@ -27,9 +29,9 @@ const ContextMenuPatch: NavContextMenuPatchCallback = (children, { channel }: { checked={checked} action={() => { if (checked) - ignoredChannelIds.delete(channel.id); + ignoredChannelIds.includes(channel.id); else - ignoredChannelIds.add(channel.id); + ignoredChannelIds.push(channel.id); setChecked(!checked); @@ -42,8 +44,8 @@ const settings = definePluginSettings({ ignoreTimeout: { type: OptionType.SLIDER, description: "Timeout to click ignore", - markers: [0, 1000, 2500, 5000, 10000], - default: 2500, + markers: makeRange(0, 10000, 1000), + default: 5000, stickToMarkers: true, } }); @@ -53,6 +55,7 @@ export default definePlugin({ name: "IgnoreCalls", description: "Allows you to ignore calls from specific users or dm groups.", authors: [EquicordDevs.TheArmagan], + settings, patches: [ { find: "#{intl::INCOMING_CALL_ELLIPSIS}", @@ -62,11 +65,14 @@ export default definePlugin({ } } ], - settings, + contextMenus: { + "user-context": ContextMenuPatch, + "gdm-context": ContextMenuPatch, + }, flux: { async CALL_UPDATE({ channelId, ringing, messageId, region }: { channelId: string; ringing: string[]; messageId: string; region: string; }) { setTimeout(() => { - if (!ignoredChannelIds.has(channelId)) return; + if (!ignoredChannelIds.includes(channelId)) return; const currentUserId = UserStore.getCurrentUser().id; if (ringing.includes(currentUserId)) { return FluxDispatcher.dispatch({ @@ -81,17 +87,15 @@ export default definePlugin({ } }, renderIgnore(channel) { - const handeClick = () => { - ignoredChannelIds.add(channel.id); - }; return ( - Ignore + ignoredChannelIds.push(channel.id)} + > + Ignore + ); - }, - contextMenus: { - "user-context": ContextMenuPatch, - "gdm-context": ContextMenuPatch, } }); diff --git a/src/equicordplugins/ignoreCalls/styles.css b/src/equicordplugins/ignoreCalls/styles.css new file mode 100644 index 000000000..84d3fd842 --- /dev/null +++ b/src/equicordplugins/ignoreCalls/styles.css @@ -0,0 +1,4 @@ +.vc-ignore-calls-render { + text-align: center; + color: var(--text-danger); +} \ No newline at end of file From 3de59c51626c01c3272e50c338d52b3b2209d095 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 13 Sep 2025 21:07:19 -0400 Subject: [PATCH 2/3] SupportHelper: Use Username --- src/plugins/_core/supportHelper.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index 47601741a..a40ec11e8 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -164,7 +164,9 @@ function generatePluginList() { content += `**Enabled UserPlugins (${enabledUserPlugins.length}):**\n${makeCodeblock(enabledUserPlugins.join(", "))}`; } - if (enabledPlugins.length > 100 && !(isPluginDev(UserStore.getCurrentUser()?.id) || isEquicordPluginDev(UserStore.getCurrentUser()?.id))) { + const user = UserStore.getCurrentUser(); + + if (enabledPlugins.length > 100 && !(isPluginDev(user.id) || isEquicordPluginDev(user.id))) { Alerts.show({ title: "You are attempting to get support!", body:
@@ -181,7 +183,7 @@ function generatePluginList() {
}); - return "You have more than 100 plugins enabled, please reduce the number of enabled plugins to get support."; + return `${user.username} have more than 100 plugins enabled, please reduce the number of enabled plugins to get support.`; } return content; From d9b014e3eb54256bf9cd858b7a6e2ccf4c855dd0 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sat, 13 Sep 2025 21:39:23 -0400 Subject: [PATCH 3/3] IgnoreCalls: Permanent Ignores --- src/equicordplugins/ignoreCalls/index.tsx | 78 ++++++++++++++-------- src/equicordplugins/ignoreCalls/styles.css | 1 + src/plugins/noBlockedMessages/index.ts | 5 +- src/plugins/quickReply/index.ts | 2 +- 4 files changed, 53 insertions(+), 33 deletions(-) diff --git a/src/equicordplugins/ignoreCalls/index.tsx b/src/equicordplugins/ignoreCalls/index.tsx index cf0bbe966..39fc8a958 100644 --- a/src/equicordplugins/ignoreCalls/index.tsx +++ b/src/equicordplugins/ignoreCalls/index.tsx @@ -4,52 +4,73 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import "./styles.css"; + import { NavContextMenuPatchCallback } from "@api/ContextMenu"; import { definePluginSettings } from "@api/Settings"; import { classNameFactory } from "@api/Styles"; import { ErrorBoundary } from "@components/index"; import { EquicordDevs } from "@utils/constants"; -import definePlugin, { makeRange, OptionType } from "@utils/types"; +import definePlugin, { OptionType } from "@utils/types"; import { Channel } from "@vencord/discord-types"; import { FluxDispatcher, Menu, React, UserStore } from "@webpack/common"; -const ignoredChannelIds: string[] = []; +const ignoredChannelIds = new Set(); const cl = classNameFactory("vc-ignore-calls-"); const ContextMenuPatch: NavContextMenuPatchCallback = (children, { channel }: { channel: Channel; }) => { if (!channel || (!channel.isDM() && !channel.isGroupDM())) return; - const [checked, setChecked] = React.useState(ignoredChannelIds.includes(channel.id)); + const permanentlyIgnoredUsers = settings.store.permanentlyIgnoredUsers.split(",").map(s => s.trim()).filter(Boolean); + + const [tempChecked, setTempChecked] = React.useState(ignoredChannelIds.has(channel.id)); + const [permChecked, setPermChecked] = React.useState(permanentlyIgnoredUsers.includes(channel.id)); children.push( - , - { - if (checked) - ignoredChannelIds.includes(channel.id); - else - ignoredChannelIds.push(channel.id); + <> + + { + if (tempChecked) + ignoredChannelIds.delete(channel.id); + else + ignoredChannelIds.add(channel.id); + setTempChecked(!tempChecked); + }} + /> + { + let updated = permanentlyIgnoredUsers.slice(); + if (permChecked) { + updated = updated.filter(id => id !== channel.id); + } else { + updated.push(channel.id); + } + settings.store.permanentlyIgnoredUsers = updated.join(", "); - setChecked(!checked); - }} - > + setPermChecked(!permChecked); + }} + /> + ); }; -const settings = definePluginSettings({ - ignoreTimeout: { - type: OptionType.SLIDER, - description: "Timeout to click ignore", - markers: makeRange(0, 10000, 1000), - default: 5000, - stickToMarkers: true, - } -}); +const settings = definePluginSettings({ + permanentlyIgnoredUsers: { + type: OptionType.STRING, + description: "User IDs (comma + space) who should be permanetly ignored", + restartNeeded: true, + default: "", + }, +}); export default definePlugin({ name: "IgnoreCalls", @@ -71,8 +92,9 @@ export default definePlugin({ }, flux: { async CALL_UPDATE({ channelId, ringing, messageId, region }: { channelId: string; ringing: string[]; messageId: string; region: string; }) { + const permanentlyIgnoredUsers = settings.store.permanentlyIgnoredUsers.split(",").map(s => s.trim()).filter(Boolean); setTimeout(() => { - if (!ignoredChannelIds.includes(channelId)) return; + if (!ignoredChannelIds.has(channelId) && !permanentlyIgnoredUsers.includes(channelId)) return; const currentUserId = UserStore.getCurrentUser().id; if (ringing.includes(currentUserId)) { return FluxDispatcher.dispatch({ @@ -83,7 +105,7 @@ export default definePlugin({ region }); } - }, settings.store.ignoreTimeout); + }, 30000); } }, renderIgnore(channel) { @@ -91,7 +113,7 @@ export default definePlugin({ ignoredChannelIds.push(channel.id)} + onClick={() => ignoredChannelIds.add(channel.id)} > Ignore diff --git a/src/equicordplugins/ignoreCalls/styles.css b/src/equicordplugins/ignoreCalls/styles.css index 84d3fd842..1428a3178 100644 --- a/src/equicordplugins/ignoreCalls/styles.css +++ b/src/equicordplugins/ignoreCalls/styles.css @@ -1,4 +1,5 @@ .vc-ignore-calls-render { text-align: center; color: var(--text-danger); + margin-bottom: 15px; } \ No newline at end of file diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts index 62512e75f..951ba2a6e 100644 --- a/src/plugins/noBlockedMessages/index.ts +++ b/src/plugins/noBlockedMessages/index.ts @@ -188,10 +188,7 @@ export default definePlugin({ isBlocked(message: Message) { try { - if (RelationshipStore.isBlocked(message.author.id)) { - return true; - } - + if (RelationshipStore.isBlocked(message.author.id)) return true; return settings.store.alsoHideIgnoredUsers && RelationshipStore.isIgnored(message.author.id); } catch (e) { new Logger("NoBlockedMessages").error("Failed to check if message is blocked or ignored:", e); diff --git a/src/plugins/quickReply/index.ts b/src/plugins/quickReply/index.ts index 215268c6e..ffad86184 100644 --- a/src/plugins/quickReply/index.ts +++ b/src/plugins/quickReply/index.ts @@ -133,7 +133,7 @@ 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 (hasNoBlockedMessages && NoBlockedMessagesPlugin.isBlocked(m)) return false; return true; });