2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Change default autodownload settings.

This commit is contained in:
John Preston
2018-12-26 09:45:37 +04:00
parent a0c6104fae
commit 71cf4a4885
3 changed files with 16 additions and 22 deletions

View File

@@ -17,8 +17,7 @@ namespace Data {
namespace AutoDownload {
namespace {
constexpr auto kDefaultMaxSize = 10 * 1024 * 1024;
constexpr auto kNonCacheMaxSize = 2 * 1024 * 1024;
constexpr auto kDefaultMaxSize = 2 * 1024 * 1024;
constexpr auto kVersion = char(1);
template <typename Enum>
@@ -39,9 +38,12 @@ void SetDefaultsForSource(Full &data, Source source) {
data.setBytesLimit(source, Type::VoiceMessage, kDefaultMaxSize);
data.setBytesLimit(source, Type::VideoMessage, kDefaultMaxSize);
data.setBytesLimit(source, Type::GIF, kDefaultMaxSize);
data.setBytesLimit(source, Type::File, kNonCacheMaxSize);
data.setBytesLimit(source, Type::Video, kNonCacheMaxSize);
data.setBytesLimit(source, Type::Music, kNonCacheMaxSize);
const auto channelsFileLimit = (source == Source::Channel)
? 0
: kDefaultMaxSize;
data.setBytesLimit(source, Type::File, channelsFileLimit);
data.setBytesLimit(source, Type::Video, channelsFileLimit);
data.setBytesLimit(source, Type::Music, channelsFileLimit);
}
const Full &Defaults() {