[Option][GUI] Telegram sites autologin
This commit is contained in:
parent
b784101d1d
commit
030779f172
4 changed files with 8 additions and 1 deletions
|
|
@ -129,6 +129,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": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,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;
|
||||
|
|
|
|||
|
|
@ -376,6 +376,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;
|
||||
|
|
|
|||
|
|
@ -338,6 +338,8 @@ void SetupKotatoNetwork(not_null<Ui::VerticalLayout*> container) {
|
|||
}, true));
|
||||
});
|
||||
|
||||
SettingsMenuJsonSwitch(ktg_settings_telegram_sites_autologin, telegram_sites_autologin);
|
||||
|
||||
AddSkip(container);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue