add option to autoconnect (closes #114)

This commit is contained in:
ouwou 2022-10-23 18:23:11 -04:00
parent 772598996c
commit 64245bf745
3 changed files with 8 additions and 0 deletions

View File

@ -495,6 +495,11 @@ void Abaddon::RunFirstTimeDiscordStartup() {
confirm.SetAcceptOnly(true);
confirm.run();
}
// autoconnect
if (cookie.has_value() && build_number.has_value() && GetSettings().Autoconnect && !GetDiscordToken().empty()) {
ActionConnect();
}
});
}

View File

@ -39,6 +39,7 @@ void SettingsManager::ReadSettings() {
SMSTR("discord", "token", DiscordToken);
SMBOOL("discord", "memory_db", UseMemoryDB);
SMBOOL("discord", "prefetch", Prefetch);
SMBOOL("discord", "autoconnect", Autoconnect);
SMSTR("gui", "css", MainCSS);
SMBOOL("gui", "animated_guild_hover_only", AnimatedGuildHoverOnly);
SMBOOL("gui", "animations", ShowAnimations);
@ -94,6 +95,7 @@ void SettingsManager::Close() {
SMSTR("discord", "token", DiscordToken);
SMBOOL("discord", "memory_db", UseMemoryDB);
SMBOOL("discord", "prefetch", Prefetch);
SMBOOL("discord", "autoconnect", Autoconnect);
SMSTR("gui", "css", MainCSS);
SMBOOL("gui", "animated_guild_hover_only", AnimatedGuildHoverOnly);
SMBOOL("gui", "animations", ShowAnimations);

View File

@ -12,6 +12,7 @@ public:
std::string DiscordToken;
bool UseMemoryDB { false };
bool Prefetch { false };
bool Autoconnect { false };
// [gui]
std::string MainCSS { "main.css" };