forked from OpenGamers/abaddon
fix some permission checks
This commit is contained in:
parent
1c38671356
commit
53ac853367
@ -549,7 +549,7 @@ bool ChatInput::AddFileAsImageAttachment(const Glib::RefPtr<Gio::File> &file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ChatInput::CanAttachFiles() {
|
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() {
|
ChatInput::type_signal_submit ChatInput::signal_submit() {
|
||||||
|
@ -223,6 +223,7 @@ Snowflake ChatWindow::GetActiveChannel() const {
|
|||||||
bool ChatWindow::OnInputSubmit(ChatSubmitParams data) {
|
bool ChatWindow::OnInputSubmit(ChatSubmitParams data) {
|
||||||
auto &discord = Abaddon::Get().GetDiscordClient();
|
auto &discord = Abaddon::Get().GetDiscordClient();
|
||||||
if (!discord.HasSelfChannelPermission(m_active_channel, Permission::SEND_MESSAGES)) return false;
|
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;
|
int nitro_restriction = BaseAttachmentSizeLimit;
|
||||||
const auto nitro = discord.GetUserData().PremiumType;
|
const auto nitro = discord.GetUserData().PremiumType;
|
||||||
|
Loading…
Reference in New Issue
Block a user