mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 07:05:13 +00:00
[Option][GUI] Telegram sites autologin
This commit is contained in:
committed by
Eric Kotato
parent
6c4617f04b
commit
fc8feea983
@@ -126,6 +126,7 @@
|
|||||||
"ktg_filters_hide_button": "Hide button",
|
"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_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_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.",
|
"ktg_in_app_update_disabled": "In-app updater is disabled.",
|
||||||
"dummy_last_string": ""
|
"dummy_last_string": ""
|
||||||
}
|
}
|
||||||
|
@@ -58,7 +58,8 @@ const auto kBadPrefix = u"http://"_q;
|
|||||||
const auto domains = active.appConfig().get<std::vector<QString>>(
|
const auto domains = active.appConfig().get<std::vector<QString>>(
|
||||||
"autologin_domains",
|
"autologin_domains",
|
||||||
{});
|
{});
|
||||||
if (token.isEmpty()
|
if (!::Kotato::JsonSettings::GetBool("telegram_sites_autologin")
|
||||||
|
|| token.isEmpty()
|
||||||
|| domain.isEmpty()
|
|| domain.isEmpty()
|
||||||
|| !ranges::contains(domains, domain)) {
|
|| !ranges::contains(domains, domain)) {
|
||||||
return url;
|
return url;
|
||||||
|
@@ -369,6 +369,9 @@ const std::map<QString, Definition, std::greater<QString>> DefinitionMap {
|
|||||||
{ "folders/local", {
|
{ "folders/local", {
|
||||||
.scope = SettingScope::Account,
|
.scope = SettingScope::Account,
|
||||||
.type = SettingType::QJsonArraySetting, }},
|
.type = SettingType::QJsonArraySetting, }},
|
||||||
|
{ "telegram_sites_autologin", {
|
||||||
|
.type = SettingType::BoolSetting,
|
||||||
|
.defaultValue = true, }},
|
||||||
};
|
};
|
||||||
|
|
||||||
using OldOptionKey = QString;
|
using OldOptionKey = QString;
|
||||||
|
@@ -339,6 +339,8 @@ void SetupKotatoNetwork(not_null<Ui::VerticalLayout*> container) {
|
|||||||
}, true));
|
}, true));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
SettingsMenuJsonSwitch(ktg_settings_telegram_sites_autologin, telegram_sites_autologin);
|
||||||
|
|
||||||
Ui::AddSkip(container);
|
Ui::AddSkip(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user