diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json index 5163b028d..495f1ff17 100644 --- a/Telegram/Resources/langs/rewrites/en.json +++ b/Telegram/Resources/langs/rewrites/en.json @@ -155,6 +155,8 @@ "ktg_forward_force_old_unquoted": "Old unquoted forward method", "ktg_forward_force_old_unquoted_desc": "Old method copies messages content on client rather than server. Currently it's used only for \"Regroup media\" grouping mode, since new one doesn't support it. If for some reason unquoted forward doesn't work correctly, try switching this option.", "ktg_disable_chat_themes": "Disable chat themes", + "ktg_settings_remember_compress_images": "Remember compress images", + "ktg_settings_compress_images_default": "Compress images by default", "ktg_forward_quiz_unquoted": "Sorry, quizzes that are currently open and unvoted on cannot be forwarded unquoted.", "ktg_in_app_update_disabled": "In-app updater is disabled.", "dummy_last_string": "" diff --git a/Telegram/SourceFiles/boxes/send_files_box.cpp b/Telegram/SourceFiles/boxes/send_files_box.cpp index 18f02439c..df61dc21e 100644 --- a/Telegram/SourceFiles/boxes/send_files_box.cpp +++ b/Telegram/SourceFiles/boxes/send_files_box.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "boxes/send_files_box.h" +#include "kotato/kotato_settings.h" #include "lang/lang_keys.h" #include "storage/localimageloader.h" #include "storage/localstorage.h" @@ -1361,7 +1362,8 @@ void SendFilesBox::saveSendWaySettings() { way.setGroupFiles(oldWay.groupFiles()); } if (_list.overrideSendImagesAsPhotos == way.sendImagesAsPhotos() - || _sendImagesAsPhotos->isHidden()) { + || _sendImagesAsPhotos->isHidden() + || !::Kotato::JsonSettings::GetBool("remember_compress_images")) { way.setSendImagesAsPhotos(oldWay.sendImagesAsPhotos()); } if (way != oldWay) { diff --git a/Telegram/SourceFiles/kotato/kotato_settings.cpp b/Telegram/SourceFiles/kotato/kotato_settings.cpp index 9be78f58d..da3472774 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings.cpp @@ -395,6 +395,9 @@ const std::map> DefinitionMap { { "disable_chat_themes", { .type = SettingType::BoolSetting, .defaultValue = false, }}, + { "remember_compress_images", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, }; using OldOptionKey = QString; diff --git a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp index 126a83249..d234a89f8 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp @@ -594,6 +594,22 @@ void SetupKotatoOther( })); }); + SettingsMenuJsonSwitch(ktg_settings_remember_compress_images, remember_compress_images); + container->add(object_ptr