From 866bd61882fb6dfca28bee99eff93dc88e1748f2 Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Sat, 30 Nov 2024 18:19:46 -0500
Subject: [PATCH 1/5] Update NoBlockedMessages Reply
---
src/plugins/noBlockedMessages/index.ts | 74 ++++++++++++++------------
1 file changed, 41 insertions(+), 33 deletions(-)
diff --git a/src/plugins/noBlockedMessages/index.ts b/src/plugins/noBlockedMessages/index.ts
index f173d5c0..02b3b9ae 100644
--- a/src/plugins/noBlockedMessages/index.ts
+++ b/src/plugins/noBlockedMessages/index.ts
@@ -16,7 +16,7 @@
* along with this program. If not, see .
*/
-import { Settings } from "@api/Settings";
+import { definePluginSettings } from "@api/Settings";
import { Devs } from "@utils/constants";
import { runtimeHashMessageKey } from "@utils/intlHash";
import { Logger } from "@utils/Logger";
@@ -27,6 +27,21 @@ import { Message } from "discord-types/general";
const RelationshipStore = findByPropsLazy("getRelationships", "isBlocked");
+const settings = definePluginSettings({
+ ignoreBlockedMessages: {
+ description: "Completely ignores (recent) incoming messages from blocked users (locally).",
+ type: OptionType.BOOLEAN,
+ default: false,
+ restartNeeded: true,
+ },
+ hideRepliesToBlockedMessages: {
+ description: "Hides replies to blocked messages.",
+ type: OptionType.BOOLEAN,
+ default: false,
+ restartNeeded: false,
+ },
+});
+
interface MessageDeleteProps {
// Internal intl message for BLOCKED_MESSAGE_COUNT
collapsedReason: () => any;
@@ -35,7 +50,9 @@ interface MessageDeleteProps {
export default definePlugin({
name: "NoBlockedMessages",
description: "Hides all blocked messages from chat completely.",
- authors: [Devs.rushii, Devs.Samu],
+ authors: [Devs.rushii, Devs.Samu, Devs.Elvyra],
+ settings,
+
patches: [
{
find: "#{intl::BLOCKED_MESSAGES_HIDE}",
@@ -51,49 +68,40 @@ export default definePlugin({
'"ReadStateStore"'
].map(find => ({
find,
- predicate: () => Settings.plugins.NoBlockedMessages.ignoreBlockedMessages === true,
+ predicate: () => settings.store.ignoreBlockedMessages === true,
replacement: [
{
match: /(?<=MESSAGE_CREATE:function\((\i)\){)/,
- replace: (_, props) => `if($self.isBlocked(${props}.message))return;`
+ replace: (_, props) => `if($self.isBlocked(${props}.message)||$self.isReplyToBlocked(${props}.message))return;`
}
]
})),
{
- find: ".messageListItem",
- replacement: {
- match: /(?<=\i=)(?=\(0,(\i)\.jsx)/,
- replace: "!$self.isReplyToBlocked(arguments[0].message)&&"
- }
- }
- ],
- options: {
- ignoreBlockedMessages: {
- description: "Completely ignores (recent) incoming messages from blocked users (locally).",
- type: OptionType.BOOLEAN,
- default: false,
- restartNeeded: true,
+ find: "referencedUsernameProfile,referencedAvatarProfile",
+ replacement: [
+ {
+ match: /CUSTOM_GIFT.*?=(?=\(0,\i.jsx\)\(\i.FocusRing)/,
+ replace: "$&!$self.isReplyToBlocked(arguments[0].message)&&",
+ }
+ ],
},
- hideRepliesToBlockedMessages: {
- description: "Hide replies to messages made by users you've blocked",
- type: OptionType.BOOLEAN,
- default: false,
- restartNeeded: false,
- }
- },
+ ],
isReplyToBlocked(message: Message) {
- if (!Settings.plugins.NoBlockedMessages.hideRepliesToBlockedMessages)
- return false;
+ if (!settings.store.hideRepliesToBlockedMessages) return false;
+ try {
+ const { messageReference } = message;
+ if (!messageReference) return false;
- const { messageReference } = message;
- if (!messageReference) return false;
- const replyMessage = MessageStore.getMessage(messageReference.channel_id, messageReference.message_id);
- return this.isBlocked(replyMessage);
+ const replyMessage = MessageStore.getMessage(messageReference.channel_id, messageReference.message_id);
+
+ return replyMessage ? this.isBlocked(replyMessage) : false;
+ } catch (e) {
+ new Logger("NoBlockedMessages").error("Failed to check if referenced message is blocked:", e);
+ }
},
- isBlocked(message: Message | undefined) {
- if (!message) return false;
+ isBlocked(message: Message) {
try {
return RelationshipStore.isBlocked(message.author.id);
} catch (e) {
@@ -105,7 +113,7 @@ export default definePlugin({
try {
return props.collapsedReason() === i18n.t[runtimeHashMessageKey("BLOCKED_MESSAGE_COUNT")]();
} catch (e) {
- console.error(e);
+ new Logger("NoBlockedMessages").error("Failed to hide blocked message:", e);
}
return false;
}
From 0ac80ce9d180bbdaf4d3863f4a249f3b165072df Mon Sep 17 00:00:00 2001
From: Nuckyz <61953774+Nuckyz@users.noreply.github.com>
Date: Sun, 1 Dec 2024 00:10:08 -0300
Subject: [PATCH 2/5] MessagePopoverAPI: Add buttons after quick reactions
---
src/plugins/_api/messagePopover.ts | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/src/plugins/_api/messagePopover.ts b/src/plugins/_api/messagePopover.ts
index 21e5accd..0133d0c6 100644
--- a/src/plugins/_api/messagePopover.ts
+++ b/src/plugins/_api/messagePopover.ts
@@ -23,11 +23,14 @@ export default definePlugin({
name: "MessagePopoverAPI",
description: "API to add buttons to message popovers.",
authors: [Devs.KingFish, Devs.Ven, Devs.Nuckyz],
- patches: [{
- find: "#{intl::MESSAGE_UTILITIES_A11Y_LABEL}",
- replacement: {
- match: /\.jsx\)\((\i\.\i),\{label:\i\.\i\.string\(\i\.\i#{intl::MESSAGE_ACTION_REPLY}.{0,200}?"reply-self".{0,50}?\}\):null(?=,.+?message:(\i))/,
- replace: "$&,Vencord.Api.MessagePopover._buildPopoverElements($1,$2)"
+ patches: [
+ {
+ find: "#{intl::MESSAGE_UTILITIES_A11Y_LABEL}",
+ replacement: {
+ match: /(?<=:null),(.{0,40}togglePopout:.+?}\))\]}\):null,(?<=\((\i\.\i),{label:.+?:null,(\i&&!\i)\?\(0,\i\.jsxs?\)\(\i\.Fragment.+?message:(\i).+?)/,
+ replace: (_, ReactButton, ButtonComponent, showReactButton, message) => "" +
+ `]}):null,Vencord.Api.MessagePopover._buildPopoverElements(${ButtonComponent},${message}),${showReactButton}?${ReactButton}:null,`
+ }
}
- }],
+ ]
});
From 193c65b182324d0714662e9f3d92d2ca54f7a10d Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Sun, 1 Dec 2024 05:51:37 -0500
Subject: [PATCH 3/5] QuestCompleter Stuff
Remove Quest Completer CSS
Fix Lint
---
README.md | 2 +-
.../questCompleter.discordDesktop/style.css | 12 --
.../index.tsx | 111 +++++++++++-------
3 files changed, 72 insertions(+), 53 deletions(-)
delete mode 100644 src/equicordplugins/questCompleter.discordDesktop/style.css
rename src/equicordplugins/{questCompleter.discordDesktop => questCompleter}/index.tsx (70%)
diff --git a/README.md b/README.md
index 54711cbf..d7a7ee61 100644
--- a/README.md
+++ b/README.md
@@ -110,6 +110,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
- PolishWording (Grammar) by Samwich
- PlatformSpoofer by Drag
- PurgeMessages by bhop & nyx
+- QuestCompleter by HappyEnderman, SerStars, maintained by thororen
- QuestionMarkReplacement by nyx
- Quoter by Samwich
- RemixMe by kvba
@@ -163,7 +164,6 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch
### Discord Desktop Only
- MediaDownloader by Colorman
-- QuestCompleter by HappyEnderman, SerStars, maintained by thororen
- StatusWhilePlaying by thororen
### Equicord Devbuilds Only
diff --git a/src/equicordplugins/questCompleter.discordDesktop/style.css b/src/equicordplugins/questCompleter.discordDesktop/style.css
deleted file mode 100644
index d6e527e2..00000000
--- a/src/equicordplugins/questCompleter.discordDesktop/style.css
+++ /dev/null
@@ -1,12 +0,0 @@
-.quest-warning {
- font-size: 16px !important;
- background-color: rgb(240 71 71 / 10%) !important;
- color: rgb(240 71 71) !important;
- border: 1px solid rgb(240 71 71 / 60%) !important;
- border-radius: 5px !important;
- font-weight: 500;
- padding: 6px 10px;
- text-align: center;
- margin-top: 10px;
- font-style: bold;
-}
diff --git a/src/equicordplugins/questCompleter.discordDesktop/index.tsx b/src/equicordplugins/questCompleter/index.tsx
similarity index 70%
rename from src/equicordplugins/questCompleter.discordDesktop/index.tsx
rename to src/equicordplugins/questCompleter/index.tsx
index 5112fe1a..abc41d3e 100644
--- a/src/equicordplugins/questCompleter.discordDesktop/index.tsx
+++ b/src/equicordplugins/questCompleter/index.tsx
@@ -16,8 +16,6 @@
* along with this program. If not, see .
*/
-import "./style.css";
-
import { showNotification } from "@api/Notifications";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs, EquicordDevs } from "@utils/constants";
@@ -25,7 +23,7 @@ import { getTheme, Theme } from "@utils/discord";
import { classes } from "@utils/misc";
import definePlugin from "@utils/types";
import { findByProps, findExportedComponentLazy } from "@webpack";
-import { Button, FluxDispatcher, Forms, RestAPI, Tooltip, UserStore } from "@webpack/common";
+import { Button, FluxDispatcher, RestAPI, Tooltip, UserStore } from "@webpack/common";
const HeaderBarIcon = findExportedComponentLazy("Icon", "Divider");
const isApp = navigator.userAgent.includes("Electron/");
@@ -64,13 +62,12 @@ function ToolBarHeader() {
async function openCompleteQuestUI() {
const ApplicationStreamingStore = findByProps("getStreamerActiveStreamMetadata");
const RunningGameStore = findByProps("getRunningGames");
- const ExperimentStore = findByProps("getGuildExperiments");
const QuestsStore = findByProps("getQuest");
const quest = [...QuestsStore.quests.values()].find(x => x.id !== "1248385850622869556" && x.userStatus?.enrolledAt && !x.userStatus?.completedAt && new Date(x.config.expiresAt).getTime() > Date.now());
if (!quest) {
showNotification({
- title: "Quests Completer",
+ title: "Quest Completer",
body: "No Quests To Complete",
});
} else {
@@ -79,27 +76,52 @@ async function openCompleteQuestUI() {
? "light"
: "dark";
- let applicationId, applicationName, secondsNeeded, secondsDone, canPlay, icon, questId;
- if (quest.config.configVersion === 1) {
- questId = quest.id;
- applicationId = quest.config.applicationId;
- applicationName = quest.config.applicationName;
- secondsNeeded = quest.config.streamDurationRequirementMinutes * 60;
- secondsDone = quest.userStatus?.streamProgressSeconds ?? 0;
- icon = `https://cdn.discordapp.com/assets/quests/${questId}/${theme}/${quest.config.assets.gameTile}`;
- canPlay = quest.config.variants.includes(2);
- } else if (quest.config.configVersion === 2) {
- questId = quest.id;
- applicationId = quest.config.application.id;
- applicationName = quest.config.application.name;
- icon = `https://cdn.discordapp.com/assets/quests/${questId}/${theme}/${quest.config.assets.gameTile}`;
- canPlay = ExperimentStore.getUserExperimentBucket("2024-04_quest_playtime_task") > 0 && quest.config.taskConfig.tasks.PLAY_ON_DESKTOP;
- const taskName = canPlay ? "PLAY_ON_DESKTOP" : "STREAM_ON_DESKTOP";
- secondsNeeded = quest.config.taskConfig.tasks[taskName]?.target;
- secondsDone = quest.userStatus?.progress?.[taskName]?.value ?? 0;
- }
- if (canPlay) {
- await RestAPI.get({ url: `/applications/public?application_ids=${applicationId}` }).then(res => {
+ const applicationId = quest.config.application.id;
+ const applicationName = quest.config.application.name;
+ const taskName = ["WATCH_VIDEO", "PLAY_ON_DESKTOP", "STREAM_ON_DESKTOP"].find(x => quest.config.taskConfig.tasks[x] != null);
+ // @ts-ignore
+ const secondsNeeded = quest.config.taskConfig.tasks[taskName].target;
+ // @ts-ignore
+ const secondsDone = quest.userStatus?.progress?.[taskName]?.value ?? 0;
+ const icon = `https://cdn.discordapp.com/assets/quests/${quest.id}/${theme}/${quest.config.assets.gameTile}`;
+ if (taskName === "WATCH_VIDEO") {
+ const tolerance = 2, speed = 10;
+ const diff = Math.floor((Date.now() - new Date(quest.userStatus.enrolledAt).getTime()) / 1000);
+ const startingPoint = Math.min(Math.max(Math.ceil(secondsDone), diff), secondsNeeded);
+ const fn = async () => {
+ for (let i = startingPoint; i <= secondsNeeded; i += speed) {
+ try {
+ await RestAPI.post({ url: `/quests/${quest.id}/video-progress`, body: { timestamp: Math.min(secondsNeeded, i + Math.random()) } });
+ } catch (ex) {
+ console.log("Failed to send increment of", i, ex);
+ }
+ await new Promise(resolve => setTimeout(resolve, tolerance * 1000));
+ }
+ if ((secondsNeeded - secondsDone) % speed !== 0) {
+ await RestAPI.post({ url: `/quests/${quest.id}/video-progress`, body: { timestamp: secondsNeeded } });
+ showNotification({
+ title: `${applicationName} - Quest Completer`,
+ body: "Quest Completed.",
+ icon: icon,
+ });
+ }
+ };
+ fn();
+ showNotification({
+ title: `${applicationName} - Quest Completer`,
+ body: `Wait for ${Math.ceil((secondsNeeded - startingPoint) / speed * tolerance)} more seconds.`,
+ icon: icon,
+ });
+ console.log(`Spoofing video for ${applicationName}.`);
+ } else if (taskName === "PLAY_ON_DESKTOP") {
+ if (!isApp) {
+ showNotification({
+ title: `${applicationName} - Quest Completer`,
+ body: `${applicationName}'s quest requires the desktop app.`,
+ icon: icon,
+ });
+ }
+ RestAPI.get({ url: `/applications/public?application_ids=${applicationId}` }).then(res => {
const appData = res.body[0];
const exeName = appData.executables.find(x => x.os === "win32").name.replace(">", "");
@@ -123,14 +145,14 @@ async function openCompleteQuestUI() {
const fn = data => {
const progress = quest.config.configVersion === 1 ? data.userStatus.streamProgressSeconds : Math.floor(data.userStatus.progress.PLAY_ON_DESKTOP.value);
showNotification({
- title: `${applicationName} - Quests Completer`,
+ title: `${applicationName} - Quest Completer`,
body: `Current progress: ${progress}/${secondsNeeded} seconds.`,
icon: icon,
});
if (progress >= secondsNeeded) {
showNotification({
- title: `${applicationName} - Quests Completer`,
+ title: `${applicationName} - Quest Completer`,
body: "Quest Completed.",
icon: icon,
});
@@ -144,16 +166,29 @@ async function openCompleteQuestUI() {
}
};
FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn);
+ console.log(`Spoofed your game to ${applicationName}.`);
});
- } else {
- const stream = ApplicationStreamingStore.getAnyStreamForUser(UserStore.getCurrentUser()?.id);
- if (!stream) {
+ } else if (taskName === "STREAM_ON_DESKTOP") {
+ if (!isApp) {
showNotification({
- title: "You're not streaming - Quests Completer",
- body: `${applicationName} requires you to be streaming.`,
+ title: `${applicationName} - Quest Completer`,
+ body: `${applicationName}'s quest requires the desktop app.`,
icon: icon,
});
}
+ const stream = ApplicationStreamingStore.getAnyStreamForUser(UserStore.getCurrentUser()?.id);
+ if (!stream) {
+ showNotification({
+ title: "You're not streaming - Quest Completer",
+ body: `${applicationName} requires you to be streaming.\nPlease stream any window in vc.`,
+ icon: icon,
+ });
+ }
+ showNotification({
+ title: `${applicationName} - Quest Completer`,
+ body: "Remember that you need at least 1 other person to be in the vc!",
+ icon: icon,
+ });
const realFunc = ApplicationStreamingStore.getStreamerActiveStreamMetadata;
ApplicationStreamingStore.getStreamerActiveStreamMetadata = () => ({
id: applicationId,
@@ -164,14 +199,14 @@ async function openCompleteQuestUI() {
const fn = data => {
const progress = quest.config.configVersion === 1 ? data.userStatus.streamProgressSeconds : Math.floor(data.userStatus.progress.STREAM_ON_DESKTOP.value);
showNotification({
- title: `${applicationName} - Quests Completer`,
+ title: `${applicationName} - Quest Completer`,
body: `Current progress: ${progress}/${secondsNeeded} seconds.`,
icon: icon,
});
if (progress >= secondsNeeded) {
showNotification({
- title: `${applicationName} - Quests Completer`,
+ title: `${applicationName} - Quest Completer`,
body: "Quest Completed.",
icon: icon,
});
@@ -181,6 +216,7 @@ async function openCompleteQuestUI() {
}
};
FluxDispatcher.subscribe("QUESTS_SEND_HEARTBEAT_SUCCESS", fn);
+ console.log(`Spoofed your stream to ${applicationName}.`);
}
return;
}
@@ -190,11 +226,6 @@ export default definePlugin({
name: "QuestCompleter",
description: "A plugin to complete quests without having the game installed.",
authors: [Devs.HappyEnderman, EquicordDevs.SerStars, EquicordDevs.thororen],
- settingsAboutComponent: () => <>
-
- We can't guarantee this plugin won't get you warned or banned.
-
- >,
patches: [
{
find: "\"invite-button\"",
From 847a32765fb244087955de42a9fba33261524374 Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Sun, 1 Dec 2024 05:57:28 -0500
Subject: [PATCH 4/5] feat(shc): Add feature parity, more styles & show modes
Co-authored-by: JustOptimize
---
src/plugins/showHiddenChannels/index.tsx | 92 ++++++++++++++++++------
src/utils/constants.ts | 6 +-
2 files changed, 74 insertions(+), 24 deletions(-)
diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx
index 6b67aee8..a23276ff 100644
--- a/src/plugins/showHiddenChannels/index.tsx
+++ b/src/plugins/showHiddenChannels/index.tsx
@@ -20,7 +20,7 @@ import "./style.css";
import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
-import { Devs } from "@utils/constants";
+import { Devs, EquicordDevs } from "@utils/constants";
import { canonicalizeMatch } from "@utils/patches";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
@@ -33,24 +33,38 @@ const ChannelListClasses = findByPropsLazy("modeMuted", "modeSelected", "unread"
const enum ShowMode {
LockIcon,
- HiddenIconWithMutedStyle
+ LockIconRight,
+ EyeIconRight,
+}
+
+const enum ChannelStyle {
+ Classic,
+ Muted,
+ Unread,
+ MutedUnread,
}
const CONNECT = 1n << 20n;
export const settings = definePluginSettings({
- hideUnreads: {
- description: "Hide Unreads",
- type: OptionType.BOOLEAN,
- default: true,
+ channelStyle: {
+ description: "The style used to display hidden channels.",
+ type: OptionType.SELECT,
+ options: [
+ { label: "Classic", value: ChannelStyle.Classic, default: true },
+ { label: "Muted", value: ChannelStyle.Muted },
+ { label: "Show Unreads", value: ChannelStyle.Unread },
+ { label: "Muted and Show Unreads", value: ChannelStyle.MutedUnread }
+ ],
restartNeeded: true
},
showMode: {
description: "The mode used to display hidden channels.",
type: OptionType.SELECT,
options: [
- { label: "Plain style with Lock Icon instead", value: ShowMode.LockIcon, default: true },
- { label: "Muted style with hidden eye icon on the right", value: ShowMode.HiddenIconWithMutedStyle },
+ { label: "Lock Icon replacing channel icon", value: ShowMode.LockIcon, default: true },
+ { label: "Eye icon on the right", value: ShowMode.EyeIconRight },
+ { label: "Lock icon on the right", value: ShowMode.LockIconRight }
],
restartNeeded: true
},
@@ -68,7 +82,7 @@ function isUncategorized(objChannel: { channel: Channel; comparator: number; })
export default definePlugin({
name: "ShowHiddenChannels",
description: "Show channels that you do not have access to view.",
- authors: [Devs.BigDuck, Devs.AverageReactEnjoyer, Devs.D3SOX, Devs.Ven, Devs.Nuckyz, Devs.Nickyux, Devs.dzshn],
+ authors: [Devs.BigDuck, Devs.AverageReactEnjoyer, Devs.D3SOX, Devs.Ven, Devs.Nuckyz, Devs.Nickyux, Devs.dzshn, EquicordDevs.Oggetto],
settings,
patches: [
@@ -159,37 +173,50 @@ export default definePlugin({
},
{
find: "UNREAD_IMPORTANT:",
- predicate: () => settings.store.showMode === ShowMode.HiddenIconWithMutedStyle,
+ predicate: () => settings.store.showMode !== ShowMode.LockIcon,
+ replacement: [
+ // Add the hidden eye icon if the channel is hidden
+ {
+ predicate: () => settings.store.showMode === ShowMode.EyeIconRight,
+ match: /\.name\),.{0,120}\.children.+?:null(?<=,channel:(\i).+?)/,
+ replace: (m, channel) => `${m},$self.isHiddenChannel(${channel})?$self.EyeRightIcon():null`
+ },
+ // Add the hidden lock icon if the channel is hidden
+ {
+ predicate: () => settings.store.showMode === ShowMode.LockIconRight,
+ match: /\.name\),.{0,120}\.children.+?:null(?<=,channel:(\i).+?)/,
+ replace: (m, channel) => `${m},$self.isHiddenChannel(${channel})?$self.LockRightIcon():null`
+ },
+ ]
+ },
+ {
+ find: "UNREAD_IMPORTANT:",
+ predicate: () => settings.store.channelStyle === ChannelStyle.Muted || settings.store.channelStyle === ChannelStyle.MutedUnread,
replacement: [
// Make the channel appear as muted if it's hidden
{
match: /{channel:(\i),name:\i,muted:(\i).+?;/,
replace: (m, channel, muted) => `${m}${muted}=$self.isHiddenChannel(${channel})?true:${muted};`
},
- // Add the hidden eye icon if the channel is hidden
- {
- match: /\.name\),.{0,120}\.children.+?:null(?<=,channel:(\i).+?)/,
- replace: (m, channel) => `${m},$self.isHiddenChannel(${channel})?$self.HiddenChannelIcon():null`
- },
// Make voice channels also appear as muted if they are muted
{
match: /(?<=\.wrapper:\i\.notInteractive,)(.+?)if\((\i)\)return (\i\.MUTED);/,
replace: (_, otherClasses, isMuted, mutedClassExpression) => `${isMuted}?${mutedClassExpression}:"",${otherClasses}if(${isMuted})return "";`
+ },
+ {
+ // Make muted channels also appear as unread if hide unreads is false and the channel is hidden
+ predicate: () => settings.store.channelStyle === ChannelStyle.MutedUnread || settings.store.channelStyle === ChannelStyle.Unread,
+ match: /\.LOCKED;if\((?<={channel:(\i).+?)/,
+ replace: (m, channel) => `${m}!$self.isHiddenChannel(${channel})&&`
}
]
},
{
find: "UNREAD_IMPORTANT:",
+ predicate: () => settings.store.channelStyle !== ChannelStyle.Unread && settings.store.channelStyle !== ChannelStyle.MutedUnread,
replacement: [
- {
- // Make muted channels also appear as unread if hide unreads is false, using the HiddenIconWithMutedStyle and the channel is hidden
- predicate: () => settings.store.hideUnreads === false && settings.store.showMode === ShowMode.HiddenIconWithMutedStyle,
- match: /\.LOCKED;if\((?<={channel:(\i).+?)/,
- replace: (m, channel) => `${m}!$self.isHiddenChannel(${channel})&&`
- },
{
// Hide unreads
- predicate: () => settings.store.hideUnreads === true,
match: /{channel:(\i),name:\i,.+?unread:(\i).+?;/,
replace: (m, channel, unread) => `${m}${unread}=$self.isHiddenChannel(${channel})?false:${unread};`
}
@@ -543,7 +570,7 @@ export default definePlugin({
), { noop: true }),
- HiddenChannelIcon: ErrorBoundary.wrap(() => (
+ EyeRightIcon: ErrorBoundary.wrap(() => (
{({ onMouseLeave, onMouseEnter }) => (
+ ), { noop: true }),
+
+ LockRightIcon: ErrorBoundary.wrap(() => (
+
+ {({ onMouseLeave, onMouseEnter }) => (
+
+ )}
+
), { noop: true })
});
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index 83a41713..e58401d0 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -943,7 +943,11 @@ export const EquicordDevs = Object.freeze({
Z1xus: {
name: "Z1xus",
id: 377450600797044746n,
- }
+ },
+ Oggetto: {
+ name: "Oggetto",
+ id: 619203349954166804n,
+ },
} satisfies Record);
// iife so #__PURE__ works correctly
From 4c9908c64794038d49f797acf9e2893829ab4530 Mon Sep 17 00:00:00 2001
From: thororen1234 <78185467+thororen1234@users.noreply.github.com>
Date: Sun, 1 Dec 2024 20:49:54 -0500
Subject: [PATCH 5/5] feat(plugins): Remove ChatBar Button Properly
---
src/equicordplugins/encryptcord/index.tsx | 5 ++---
src/equicordplugins/meow/index.tsx | 7 +++----
src/equicordplugins/woof/index.tsx | 7 +++----
3 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/equicordplugins/encryptcord/index.tsx b/src/equicordplugins/encryptcord/index.tsx
index b59032c3..49d37500 100644
--- a/src/equicordplugins/encryptcord/index.tsx
+++ b/src/equicordplugins/encryptcord/index.tsx
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-import { addChatBarButton, ChatBarButton } from "@api/ChatButtons";
+import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import {
ApplicationCommandInputType,
ApplicationCommandOptionType,
@@ -12,7 +12,6 @@ import {
} from "@api/Commands";
import * as DataStore from "@api/DataStore";
import { addPreSendListener, removePreSendListener, SendListener } from "@api/MessageEvents";
-import { removeButton } from "@api/MessagePopover";
import { Devs } from "@utils/constants";
import { sleep } from "@utils/misc";
import definePlugin from "@utils/types";
@@ -273,7 +272,7 @@ export default definePlugin({
await DataStore.set("encryptcordGroupMembers", {});
},
async stop() {
- removeButton("Encryptcord");
+ removeChatBarButton("Encryptcord");
if (await DataStore.get("encryptcordGroup") === true) {
await leave("", { channel: { id: await DataStore.get("encryptcordChannelId") } });
}
diff --git a/src/equicordplugins/meow/index.tsx b/src/equicordplugins/meow/index.tsx
index 8a770ad7..adf7831d 100644
--- a/src/equicordplugins/meow/index.tsx
+++ b/src/equicordplugins/meow/index.tsx
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-import { addChatBarButton, ChatBarButton } from "@api/ChatButtons";
+import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { Devs } from "@utils/constants";
import { getCurrentChannel, sendMessage } from "@utils/discord";
import definePlugin from "@utils/types";
@@ -27,7 +27,6 @@ export default definePlugin({
description: "Adds a chatbar button to meow in chat",
authors:
[Devs.Samwich],
- start() {
- addChatBarButton("vc-meow", ChatBarIcon);
- }
+ start: () => addChatBarButton("Meow", ChatBarIcon),
+ stop: () => removeChatBarButton("Meow")
});
diff --git a/src/equicordplugins/woof/index.tsx b/src/equicordplugins/woof/index.tsx
index 29cb6afe..f55f840b 100644
--- a/src/equicordplugins/woof/index.tsx
+++ b/src/equicordplugins/woof/index.tsx
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
-import { addChatBarButton, ChatBarButton } from "@api/ChatButtons";
+import { addChatBarButton, ChatBarButton, removeChatBarButton } from "@api/ChatButtons";
import { Devs } from "@utils/constants";
import { getCurrentChannel, sendMessage } from "@utils/discord";
import definePlugin from "@utils/types";
@@ -26,7 +26,6 @@ export default definePlugin({
name: "Woof",
description: "Adds a chatbar button to woof in chat",
authors: [Devs.Samwich],
- start() {
- addChatBarButton("vc-woof", ChatBarIcon);
- }
+ start: () => addChatBarButton("Woof", ChatBarIcon),
+ stop: () => removeChatBarButton("Woof")
});