Remove some debug code.

This commit is contained in:
John Preston
2025-11-14 19:21:54 +04:00
parent 1320e7ac2f
commit c3f5f69c2a
4 changed files with 11 additions and 8 deletions
@@ -59,7 +59,7 @@ namespace {
constexpr auto kAuctionAboutShownPref = "gift_auction_about_shown"_cs;
constexpr auto kBidPlacedToastDuration = 5 * crl::time(1000);
constexpr auto kMaxShownBid = 30'000'00; AssertIsDebug()
constexpr auto kMaxShownBid = 30'000;
enum class BidType {
Setting,
@@ -489,10 +489,14 @@ void AuctionBidBox(not_null<GenericBox*> box, AuctionBidBoxArgs &&args) {
const auto min = std::max(
int(mine ? now.my.minBidAmount : now.minBidAmount),
1);
const auto last = now.bidLevels.empty()
? 0
: now.bidLevels.front().amount;
const auto max = std::max({
min + 1,
kMaxShownBid,
mine,
int(base::SafeRound(mine * 1.2)),
int(base::SafeRound(last * 1.2)),
});
const auto chosen = mine ? mine : std::clamp(mine, min, max);
state->chosen = chosen;
@@ -2693,7 +2693,7 @@ MediaStory::MediaStory(
if (!maybeStory && maybeStory.error() == NoStory::Unknown) {
stories->resolve(storyId, crl::guard(this, [=] {
if (const auto maybeStory = stories->lookup(storyId)) {
if ((*maybeStory)->unsupported()) {
if ((*maybeStory)->unsupported() || (*maybeStory)->call()) {
_unsupported = true;
} else if (!_mention && _viewMayExist) {
parent->setText((*maybeStory)->caption());
@@ -2728,7 +2728,7 @@ bool MediaStory::storyExpired(bool revalidate) {
if (revalidate) {
const auto stories = &parent()->history()->owner().stories();
if (const auto maybeStory = stories->lookup(_storyId)) {
if ((*maybeStory)->unsupported()) {
if ((*maybeStory)->unsupported() || (*maybeStory)->call()) {
_unsupported = true;
}
_expired = false;
@@ -2819,7 +2819,7 @@ std::unique_ptr<HistoryView::Media> MediaStory::createView(
_expired = false;
_viewMayExist = true;
const auto story = *maybeStory;
if (story->unsupported()) {
if (story->unsupported() || story->call()) {
_unsupported = true;
return nullptr;
} else if (_mention) {
@@ -2834,13 +2834,14 @@ std::unique_ptr<HistoryView::Media> MediaStory::createView(
realParent,
photo,
spoiler);
} else {
} else if (const auto document = story->document()) {
return std::make_unique<HistoryView::Gif>(
message,
realParent,
story->document(),
spoiler);
}
return nullptr;
}
}
@@ -884,7 +884,6 @@ void Reactions::Panel::create() {
if (reactions.recent.empty()
|| (_mode.current() == Mode::Message
&& _controller->videoStream())) {
AssertIsDebug();
return;
}
_parent = std::make_unique<Ui::RpWidget>(_controller->wrap().get());
@@ -3747,7 +3747,6 @@ void Account::writePrefs() {
}
void Account::readPrefs() {
return; AssertIsDebug();
FileReadDescriptor prefs;
if (!ReadEncryptedFile(prefs, _prefsKey, _basePath, _localKey)) {
ClearKey(_prefsKey, _basePath);