mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-16 09:57:08 -04:00
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:
parent
7731a7f0e5
commit
83c3497951
17 changed files with 68 additions and 223 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue