mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Remove some debug code.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user