From 995fddf9293e92ca541bc4a7a5d9f9bf56c8e67d Mon Sep 17 00:00:00 2001 From: Ske Date: Sun, 5 Jun 2022 23:26:11 +0200 Subject: [PATCH] fix: include guild member in reproxy permission check --- PluralKit.Bot/Proxy/ProxyService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PluralKit.Bot/Proxy/ProxyService.cs b/PluralKit.Bot/Proxy/ProxyService.cs index 857a561c..e564d64f 100644 --- a/PluralKit.Bot/Proxy/ProxyService.cs +++ b/PluralKit.Bot/Proxy/ProxyService.cs @@ -219,8 +219,8 @@ public class ProxyService var threadId = messageChannel.IsThread() ? messageChannel.Id : (ulong?)null; var guild = await _rest.GetGuildOrNull(msg.Guild!.Value); - // Grab user permissions - var senderPermissions = PermissionExtensions.PermissionsFor(guild, rootChannel, trigger.Author.Id, null); + // Grab user permissions (the MessageCreateEvent cast is gross but so is our permission handling rn) + var senderPermissions = PermissionExtensions.PermissionsFor(guild, rootChannel, trigger.Author.Id, ((MessageCreateEvent) trigger).Member); var allowEveryone = senderPermissions.HasFlag(PermissionSet.MentionEveryone); // Make sure user has permissions to send messages