mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-06 20:15:19 +03:00
fix some permission checks
This commit is contained in:
@@ -549,7 +549,7 @@ bool ChatInput::AddFileAsImageAttachment(const Glib::RefPtr<Gio::File> &file) {
|
||||
}
|
||||
|
||||
bool ChatInput::CanAttachFiles() {
|
||||
return Abaddon::Get().GetDiscordClient().HasSelfChannelPermission(m_active_channel, Permission::ATTACH_FILES);
|
||||
return Abaddon::Get().GetDiscordClient().HasSelfChannelPermission(m_active_channel, Permission::ATTACH_FILES | Permission::SEND_MESSAGES);
|
||||
}
|
||||
|
||||
ChatInput::type_signal_submit ChatInput::signal_submit() {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user