[Option][GUI] Telegram sites autologin
This commit is contained in:
parent
1e50876ee6
commit
761d0513b5
4 changed files with 9 additions and 1 deletions
|
|
@ -115,6 +115,7 @@
|
|||
"ktg_filters_hide_button": "Hide button",
|
||||
"ktg_filters_hide_all_chats_toast": "\"All Chats\" folder is hidden.\nYou can enable it back in Kotatogram Settings.",
|
||||
"ktg_filters_hide_edit_toast": "Edit button is hidden.\nYou can enable it back in Kotatogram Settings.",
|
||||
"ktg_settings_telegram_sites_autologin": "Auto-login on Telegram sites",
|
||||
"ktg_in_app_update_disabled": "In-app updater is disabled.",
|
||||
"dummy_last_string": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "core/ui_integration.h"
|
||||
|
||||
#include "kotato/kotato_settings.h"
|
||||
#include "api/api_text_entities.h"
|
||||
#include "core/local_url_handlers.h"
|
||||
#include "core/file_utilities.h"
|
||||
|
|
@ -62,7 +63,8 @@ const auto kBadPrefix = u"http://"_q;
|
|||
const auto domains = active.appConfig().get<std::vector<QString>>(
|
||||
"autologin_domains",
|
||||
{});
|
||||
if (token.isEmpty()
|
||||
if (!::Kotato::JsonSettings::GetBool("telegram_sites_autologin")
|
||||
|| token.isEmpty()
|
||||
|| domain.isEmpty()
|
||||
|| !ranges::contains(domains, domain)) {
|
||||
return url;
|
||||
|
|
|
|||
|
|
@ -329,6 +329,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
|
|||
{ "folders/local", {
|
||||
.scope = SettingScope::Account,
|
||||
.type = SettingType::QJsonArraySetting, }},
|
||||
{ "telegram_sites_autologin", {
|
||||
.type = SettingType::BoolSetting,
|
||||
.defaultValue = true, }},
|
||||
};
|
||||
|
||||
using OldOptionKey = QString;
|
||||
|
|
|
|||
|
|
@ -287,6 +287,8 @@ void SetupKotatoNetwork(not_null<Ui::VerticalLayout*> container) {
|
|||
Ui::AddSubsectionTitle(container, rktr("ktg_settings_network"));
|
||||
|
||||
|
||||
SettingsMenuJsonSwitch(ktg_settings_telegram_sites_autologin, telegram_sites_autologin);
|
||||
|
||||
Ui::AddSkip(container);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue