diff --git a/src/abaddon.cpp b/src/abaddon.cpp index 630e584..d759426 100644 --- a/src/abaddon.cpp +++ b/src/abaddon.cpp @@ -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(); + } }); } diff --git a/src/settings.cpp b/src/settings.cpp index 34b3dc0..0019a00 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -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); diff --git a/src/settings.hpp b/src/settings.hpp index 4ab512e..9d32d2e 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -12,6 +12,7 @@ public: std::string DiscordToken; bool UseMemoryDB { false }; bool Prefetch { false }; + bool Autoconnect { false }; // [gui] std::string MainCSS { "main.css" };