Merge branch 'master' into attachments

This commit is contained in:
ouwou
2022-08-06 02:27:37 -04:00
3 changed files with 14 additions and 5 deletions

View File

@@ -544,7 +544,7 @@ void Abaddon::LoadState() {
#ifdef WITH_LIBHANDY
m_main_window->GetChatWindow()->UseTabsState(state.Tabs);
#endif
ActionChannelOpened(state.ActiveChannel);
ActionChannelOpened(state.ActiveChannel, false);
} catch (const std::exception &e) {
printf("failed to load application state: %s\n", e.what());
}
@@ -913,11 +913,15 @@ int main(int argc, char **argv) {
char *systemLocale = std::setlocale(LC_ALL, "");
try {
std::locale::global(std::locale(systemLocale));
if (systemLocale != nullptr) {
std::locale::global(std::locale(systemLocale));
}
} catch (...) {
try {
std::locale::global(std::locale::classic());
std::setlocale(LC_ALL, systemLocale);
if (systemLocale != nullptr) {
std::setlocale(LC_ALL, systemLocale);
}
} catch (...) {}
}

View File

@@ -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() {

View File

@@ -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 {