diff options
author | V <vendicated@riseup.net> | 2023-09-26 03:54:59 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-09-26 03:54:59 +0200 |
commit | 608a67c9ae4eea61bc532398ed615a4984db2ffc (patch) | |
tree | 354a78f368c735bf845a495bf68dfac34d0481eb /src | |
parent | f32d25b641dc89b623ec0930396827bfcf4921b2 (diff) | |
download | Vencord-608a67c9ae4eea61bc532398ed615a4984db2ffc.tar.gz Vencord-608a67c9ae4eea61bc532398ed615a4984db2ffc.tar.bz2 Vencord-608a67c9ae4eea61bc532398ed615a4984db2ffc.zip |
fix quick/searchReply & MessageClickactions not working in dms
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/messageClickActions/index.ts | 2 | ||||
-rw-r--r-- | src/plugins/quickReply/index.ts | 6 | ||||
-rw-r--r-- | src/plugins/searchReply/index.tsx | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/messageClickActions/index.ts b/src/plugins/messageClickActions/index.ts index 128cb7c..08cee4c 100644 --- a/src/plugins/messageClickActions/index.ts +++ b/src/plugins/messageClickActions/index.ts @@ -71,7 +71,7 @@ export default definePlugin({ if (!isDeletePressed) { if (event.detail < 2) return; if (settings.store.requireModifier && !event.ctrlKey && !event.shiftKey) return; - if (!PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return; + if (channel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return; if (isMe) { if (!settings.store.enableDoubleClickToEdit || EditStore.isEditing(channel.id, msg.id)) return; diff --git a/src/plugins/quickReply/index.ts b/src/plugins/quickReply/index.ts index 7a39ec0..118a51b 100644 --- a/src/plugins/quickReply/index.ts +++ b/src/plugins/quickReply/index.ts @@ -172,7 +172,8 @@ function shouldMention(message) { // handle next/prev reply function nextReply(isUp: boolean) { - if (!PermissionStore.can(PermissionsBits.SEND_MESSAGES, ChannelStore.getChannel(SelectedChannelStore.getChannelId()))) return; + const currChannel = ChannelStore.getChannel(SelectedChannelStore.getChannelId()); + if (currChannel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, currChannel)) return; const message = getNextMessage(isUp, true); if (!message) @@ -196,7 +197,8 @@ function nextReply(isUp: boolean) { // handle next/prev edit function nextEdit(isUp: boolean) { - if (!PermissionStore.can(PermissionsBits.SEND_MESSAGES, ChannelStore.getChannel(SelectedChannelStore.getChannelId()))) return; + const currChannel = ChannelStore.getChannel(SelectedChannelStore.getChannelId()); + if (currChannel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, currChannel)) return; const message = getNextMessage(isUp, false); if (!message) diff --git a/src/plugins/searchReply/index.tsx b/src/plugins/searchReply/index.tsx index 98f26e0..b28ca8e 100644 --- a/src/plugins/searchReply/index.tsx +++ b/src/plugins/searchReply/index.tsx @@ -32,7 +32,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, { messag 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; + if (channel.guild_id && !PermissionStore.can(PermissionsBits.SEND_MESSAGES, channel)) return; // dms and group chats const dmGroup = findGroupChildrenByChildId("pin", children); |