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

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