From 53ac8533671d08e96896b80cd513ba05aabd930f Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Mon, 8 Aug 2022 00:29:18 -0400 Subject: fix some permission checks --- src/components/chatwindow.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/components/chatwindow.cpp') diff --git a/src/components/chatwindow.cpp b/src/components/chatwindow.cpp index 58e36d0..c5b4d14 100644 --- a/src/components/chatwindow.cpp +++ b/src/components/chatwindow.cpp @@ -223,6 +223,7 @@ Snowflake ChatWindow::GetActiveChannel() const { bool ChatWindow::OnInputSubmit(ChatSubmitParams data) { auto &discord = Abaddon::Get().GetDiscordClient(); if (!discord.HasSelfChannelPermission(m_active_channel, Permission::SEND_MESSAGES)) return false; + if (!data.Attachments.empty() && !discord.HasSelfChannelPermission(m_active_channel, Permission::ATTACH_FILES)) return false; int nitro_restriction = BaseAttachmentSizeLimit; const auto nitro = discord.GetUserData().PremiumType; -- cgit v1.2.3