mirror of
https://github.com/uowuo/abaddon.git
synced 2024-11-12 23:21:31 +00:00
switch to correct guild on channel open in classic channels
This commit is contained in:
parent
615f2c80f1
commit
09bf732a12
@ -292,7 +292,7 @@ For example, memory_db would be set by adding `memory_db = true` under the line
|
||||
#### gui
|
||||
|
||||
| Setting | Type | Default | Description |
|
||||
|-----------------------------|---------|---------|----------------------------------------------------------------------------------------------------------------------------|
|
||||
|--------------------------------|---------|---------|----------------------------------------------------------------------------------------------------------------------------|
|
||||
| `member_list_discriminator` | boolean | true | show user discriminators in the member list |
|
||||
| `stock_emojis` | boolean | true | allow abaddon to substitute unicode emojis with images from emojis.bin, must be false to allow GTK to render emojis itself |
|
||||
| `custom_emojis` | boolean | true | download and use custom Discord emojis |
|
||||
@ -306,6 +306,7 @@ For example, memory_db would be set by adding `memory_db = true` under the line
|
||||
| `hide_to_tray` | boolean | false | hide abaddon to the system tray on window close |
|
||||
| `show_deleted_indicator` | boolean | true | show \[deleted\] indicator next to deleted messages instead of actually deleting the message |
|
||||
| `font_scale` | double | | scale font rendering. 1 is unchanged |
|
||||
| `classic_change_guild_on_open` | boolean | true | change displayed guild when selecting a channel (classic channel list) |
|
||||
|
||||
#### style
|
||||
|
||||
|
@ -28,6 +28,14 @@ void ChannelList::UpdateListing() {
|
||||
}
|
||||
|
||||
void ChannelList::SetActiveChannel(Snowflake id, bool expand_to) {
|
||||
if (Abaddon::Get().GetSettings().ClassicChangeGuildOnOpen) {
|
||||
if (const auto channel = Abaddon::Get().GetDiscordClient().GetChannel(id); channel.has_value() && channel->GuildID.has_value()) {
|
||||
m_tree.SetSelectedGuild(*channel->GuildID);
|
||||
} else {
|
||||
m_tree.SetSelectedDMs();
|
||||
}
|
||||
}
|
||||
|
||||
m_tree.SetActiveChannel(id, expand_to);
|
||||
}
|
||||
|
||||
|
@ -97,6 +97,7 @@ void SettingsManager::DefineSettings() {
|
||||
AddSetting("gui", "show_deleted_indicator", true, &Settings::ShowDeletedIndicator);
|
||||
AddSetting("gui", "font_scale", -1.0, &Settings::FontScale);
|
||||
AddSetting("gui", "folder_icon_only", false, &Settings::FolderIconOnly);
|
||||
AddSetting("gui", "classic_change_guild_on_open", true, &Settings::ClassicChangeGuildOnOpen);
|
||||
|
||||
AddSetting("http", "concurrent", 20, &Settings::CacheHTTPConcurrency);
|
||||
AddSetting("http", "user_agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36"s, &Settings::UserAgent);
|
||||
|
@ -29,6 +29,7 @@ public:
|
||||
bool ShowDeletedIndicator;
|
||||
double FontScale;
|
||||
bool FolderIconOnly;
|
||||
bool ClassicChangeGuildOnOpen;
|
||||
|
||||
// [http]
|
||||
int CacheHTTPConcurrency;
|
||||
|
Loading…
Reference in New Issue
Block a user