Skip to content

Commit

Permalink
Revert "Expanding total size and media limits"
Browse files Browse the repository at this point in the history
This reverts commits 77ae87a and ffaae36.

Reverted feature because it adds only crashes for now.
  • Loading branch information
EricKotato committed Jul 3, 2020
1 parent ffaae36 commit 2b1907b
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions Telegram/SourceFiles/boxes/local_storage_box.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ For license and copyright information please follow this link:
namespace {

constexpr auto kMegabyte = int64(1024 * 1024);
constexpr auto kTotalSizeLimitsCount = 27;
constexpr auto kMediaSizeLimitsCount = 27;
constexpr auto kMinimalSizeLimit = 20 * kMegabyte;
constexpr auto kTotalSizeLimitsCount = 18;
constexpr auto kMediaSizeLimitsCount = 18;
constexpr auto kMinimalSizeLimit = 100 * kMegabyte;
constexpr auto kTimeLimitsCount = 22;
constexpr auto kMaxTimeLimitValue = std::numeric_limits<size_type>::max();
constexpr auto kFakeMediaCacheTag = uint16(0xFFFF);
Expand All @@ -42,15 +42,8 @@ int64 TotalSizeLimitInMB(int index) {
return int64(index - 7) * 1024;
}

int64 TotalSizeLimitInMBKotato(int index) {
if (index < 9) {
return int64(index + 2) * 10;
}
return TotalSizeLimitInMB(index - 9);
}

int64 TotalSizeLimit(int index) {
return TotalSizeLimitInMBKotato(index) * kMegabyte;
return TotalSizeLimitInMB(index) * kMegabyte;
}

int64 MediaSizeLimitInMB(int index) {
Expand All @@ -60,15 +53,8 @@ int64 MediaSizeLimitInMB(int index) {
return int64(index - 8) * 1024;
}

int64 MediaSizeLimitInMBKotato(int index) {
if (index < 9) {
return int64(index + 1) * 10;
}
return MediaSizeLimitInMB(index - 9);
}

int64 MediaSizeLimit(int index) {
return MediaSizeLimitInMBKotato(index) * kMegabyte;
return MediaSizeLimitInMB(index) * kMegabyte;
}

QString SizeLimitText(int64 limit) {
Expand Down

0 comments on commit 2b1907b

Please sign in to comment.