mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-30 09:11:43 +00:00
Merge tag 'v4.11.3' into dev
# Conflicts: # Telegram/Resources/winrc/Telegram.rc # Telegram/Resources/winrc/Updater.rc # Telegram/SourceFiles/core/version.h # Telegram/SourceFiles/info/profile/info_profile_values.cpp # Telegram/lib_ui # snap/snapcraft.yaml
This commit is contained in:
@@ -689,6 +689,7 @@ void SessionNavigation::applyBoost(
|
||||
done(false);
|
||||
return;
|
||||
}
|
||||
auto slot = int();
|
||||
auto different = PeerId();
|
||||
auto earliest = TimeId(-1);
|
||||
const auto now = base::unixtime::now();
|
||||
@@ -699,13 +700,13 @@ void SessionNavigation::applyBoost(
|
||||
? peerFromMTP(*data.vpeer())
|
||||
: PeerId();
|
||||
if (!peerId && cooldown <= now) {
|
||||
applyBoostChecked(channel, done);
|
||||
applyBoostChecked(channel, data.vslot().v, done);
|
||||
return;
|
||||
} else if (peerId != channel->id) {
|
||||
} else if (peerId != channel->id
|
||||
&& (earliest < 0 || cooldown < earliest)) {
|
||||
slot = data.vslot().v;
|
||||
different = peerId;
|
||||
if (earliest < 0 || cooldown < earliest) {
|
||||
earliest = cooldown;
|
||||
}
|
||||
earliest = cooldown;
|
||||
}
|
||||
}
|
||||
if (different) {
|
||||
@@ -731,7 +732,7 @@ void SessionNavigation::applyBoost(
|
||||
done(false);
|
||||
} else {
|
||||
const auto peer = _session->data().peer(different);
|
||||
replaceBoostConfirm(peer, channel, done);
|
||||
replaceBoostConfirm(peer, channel, slot, done);
|
||||
}
|
||||
} else {
|
||||
uiShow()->show(Ui::MakeConfirmBox({
|
||||
@@ -752,11 +753,12 @@ void SessionNavigation::applyBoost(
|
||||
void SessionNavigation::replaceBoostConfirm(
|
||||
not_null<PeerData*> from,
|
||||
not_null<ChannelData*> channel,
|
||||
int slot,
|
||||
Fn<void(bool)> done) {
|
||||
const auto forwarded = std::make_shared<bool>(false);
|
||||
const auto confirmed = [=](Fn<void()> close) {
|
||||
*forwarded = true;
|
||||
applyBoostChecked(channel, done);
|
||||
applyBoostChecked(channel, slot, done);
|
||||
close();
|
||||
};
|
||||
const auto box = uiShow()->show(Box([=](not_null<Ui::GenericBox*> box) {
|
||||
@@ -785,10 +787,11 @@ void SessionNavigation::replaceBoostConfirm(
|
||||
|
||||
void SessionNavigation::applyBoostChecked(
|
||||
not_null<ChannelData*> channel,
|
||||
int slot,
|
||||
Fn<void(bool)> done) {
|
||||
_api.request(MTPpremium_ApplyBoost(
|
||||
MTP_flags(0),
|
||||
MTPVector<MTPint>(), // slots
|
||||
MTP_flags(MTPpremium_ApplyBoost::Flag::f_slots),
|
||||
MTP_vector<MTPint>({ MTP_int(slot) }),
|
||||
channel->input
|
||||
)).done([=](const MTPpremium_MyBoosts &result) {
|
||||
done(true);
|
||||
@@ -854,7 +857,8 @@ void SessionNavigation::showRepliesForMessage(
|
||||
auto memento = std::make_shared<HistoryView::RepliesMemento>(
|
||||
history,
|
||||
rootId,
|
||||
commentId);
|
||||
commentId,
|
||||
params.highlightPart);
|
||||
memento->setFromTopic(topic);
|
||||
showSection(std::move(memento), params);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user