aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/searchReply
diff options
context:
space:
mode:
authorHugo C <lumap@duck.com>2023-09-24 16:42:53 +0200
committerGitHub <noreply@github.com>2023-09-24 16:42:53 +0200
commit044f64e446b67613282fa96192abe6d1ed504923 (patch)
treef4e076f06fbf20b56b41907d008ae97b49322808 /src/plugins/searchReply
parent0b7fca864af6b99800e5a005e45ec8a527c54fb9 (diff)
downloadVencord-044f64e446b67613282fa96192abe6d1ed504923.tar.gz
Vencord-044f64e446b67613282fa96192abe6d1ed504923.tar.bz2
Vencord-044f64e446b67613282fa96192abe6d1ed504923.zip
Improve permission checks on several plugins (#1746)
Co-authored-by: V <vendicated@riseup.net>
Diffstat (limited to 'src/plugins/searchReply')
-rw-r--r--src/plugins/searchReply/index.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/searchReply/index.tsx b/src/plugins/searchReply/index.tsx
index 9e53436..3f5c643 100644
--- a/src/plugins/searchReply/index.tsx
+++ b/src/plugins/searchReply/index.tsx
@@ -21,7 +21,7 @@ import { Devs } from "@utils/constants";
import { LazyComponent } from "@utils/react";
import definePlugin from "@utils/types";
import { findByCode, findByCodeLazy } from "@webpack";
-import { ChannelStore, i18n, Menu, SelectedChannelStore } from "@webpack/common";
+import { ChannelStore, i18n, Menu, PermissionsBits, PermissionStore, SelectedChannelStore } from "@webpack/common";
import { Message } from "discord-types/general";
const ReplyIcon = LazyComponent(() => findByCode("M10 8.26667V4L3 11.4667L10 18.9333V14.56C15 14.56 18.5 16.2667 21 20C20 14.6667 17 9.33333 10 8.26667Z"));
@@ -31,9 +31,9 @@ const replyFn = findByCodeLazy("showMentionToggle", "TEXTAREA_FOCUS", "shiftKey"
const messageContextMenuPatch: NavContextMenuPatchCallback = (children, { message }: { message: Message; }) => () => {
// make sure the message is in the selected channel
if (SelectedChannelStore.getChannelId() !== message.channel_id) return;
-
const channel = ChannelStore.getChannel(message?.channel_id);
if (!channel) return;
+ if (!PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return;
// dms and group chats
const dmGroup = findGroupChildrenByChildId("pin", children);