mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Add file size limit to autoplay settings.
This commit is contained in:
@@ -452,41 +452,6 @@ void SetupPerformance(
|
||||
not_null<Window::SessionController*> controller,
|
||||
not_null<Ui::VerticalLayout*> container) {
|
||||
SetupAnimations(container);
|
||||
|
||||
const auto session = &controller->session();
|
||||
AddButton(
|
||||
container,
|
||||
tr::lng_settings_autoplay_gifs(),
|
||||
st::settingsButton
|
||||
)->toggleOn(
|
||||
rpl::single(session->settings().autoplayGifs())
|
||||
)->toggledValue(
|
||||
) | rpl::filter([=](bool enabled) {
|
||||
return (enabled != session->settings().autoplayGifs());
|
||||
}) | rpl::start_with_next([=](bool enabled) {
|
||||
session->settings().setAutoplayGifs(enabled);
|
||||
if (!enabled) {
|
||||
session->data().checkPlayingVideoFiles();
|
||||
}
|
||||
session->saveSettingsDelayed();
|
||||
}, container->lifetime());
|
||||
|
||||
AddButton(
|
||||
container,
|
||||
tr::lng_settings_autoplay_videos(),
|
||||
st::settingsButton
|
||||
)->toggleOn(
|
||||
rpl::single(session->settings().autoplayVideos())
|
||||
)->toggledValue(
|
||||
) | rpl::filter([=](bool enabled) {
|
||||
return (enabled != session->settings().autoplayVideos());
|
||||
}) | rpl::start_with_next([=](bool enabled) {
|
||||
session->settings().setAutoplayVideos(enabled);
|
||||
if (!enabled) {
|
||||
session->data().checkPlayingVideoFiles();
|
||||
}
|
||||
session->saveSettingsDelayed();
|
||||
}, container->lifetime());
|
||||
}
|
||||
|
||||
void SetupSystemIntegration(
|
||||
|
Reference in New Issue
Block a user