summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/channels.cpp7
-rw-r--r--src/components/chatinput.cpp2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/components/channels.cpp b/src/components/channels.cpp
index 0a49701..497c021 100644
--- a/src/components/channels.cpp
+++ b/src/components/channels.cpp
@@ -911,10 +911,15 @@ void ChannelList::OnGuildSubmenuPopup() {
const auto iter = m_model->get_iter(m_path_for_menu);
if (!iter) return;
const auto id = static_cast<Snowflake>((*iter)[m_columns.m_id]);
- if (Abaddon::Get().GetDiscordClient().IsGuildMuted(id))
+ auto &discord = Abaddon::Get().GetDiscordClient();
+ if (discord.IsGuildMuted(id))
m_menu_guild_toggle_mute.set_label("Unmute");
else
m_menu_guild_toggle_mute.set_label("Mute");
+
+ const auto guild = discord.GetGuild(id);
+ const auto self_id = discord.GetUserData().ID;
+ m_menu_guild_leave.set_sensitive(!(guild.has_value() && guild->OwnerID == self_id));
}
void ChannelList::OnCategorySubmenuPopup() {
diff --git a/src/components/chatinput.cpp b/src/components/chatinput.cpp
index 77757cf..13e2550 100644
--- a/src/components/chatinput.cpp
+++ b/src/components/chatinput.cpp
@@ -8,7 +8,7 @@ ChatInputText::ChatInputText() {
set_propagate_natural_height(true);
set_min_content_height(20);
set_max_content_height(250);
- set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
+ set_policy(Gtk::POLICY_EXTERNAL, Gtk::POLICY_AUTOMATIC);
// hack
auto cb = [this](GdkEventKey *e) -> bool {