mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-19 11:27:02 -04:00
Permission Check For InstantScreenshare
Permission Check For InstantScreenshare
This commit is contained in:
parent
10d4036a34
commit
3b3c508b0d
1 changed files with 3 additions and 1 deletions
|
@ -8,7 +8,7 @@ import { definePluginSettings } from "@api/Settings";
|
||||||
import { Devs, EquicordDevs } from "@utils/constants";
|
import { Devs, EquicordDevs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByCode, findByProps } from "@webpack";
|
import { findByCode, findByProps } from "@webpack";
|
||||||
import { ChannelStore, SelectedChannelStore, UserStore } from "@webpack/common";
|
import { ChannelStore, PermissionsBits, PermissionStore, SelectedChannelStore, UserStore } from "@webpack/common";
|
||||||
import { VoiceState } from "@webpack/types";
|
import { VoiceState } from "@webpack/types";
|
||||||
|
|
||||||
const settings = definePluginSettings({
|
const settings = definePluginSettings({
|
||||||
|
@ -41,6 +41,8 @@ async function startStream() {
|
||||||
if (!selected) return;
|
if (!selected) return;
|
||||||
const channel = ChannelStore.getChannel(selected);
|
const channel = ChannelStore.getChannel(selected);
|
||||||
|
|
||||||
|
if (!PermissionStore.can(PermissionsBits.STREAM, channel)) return;
|
||||||
|
|
||||||
if (settings.store.streamType === "screen") {
|
if (settings.store.streamType === "screen") {
|
||||||
sources = await getDesktopSources(mediaEngine, ["screen"], null);
|
sources = await getDesktopSources(mediaEngine, ["screen"], null);
|
||||||
source = sources[0];
|
source = sources[0];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue