mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Fix expire calculations for the stories.
This commit is contained in:
parent
5e5b252f2f
commit
087c27c5e0
3 changed files with 9 additions and 10 deletions
Telegram/SourceFiles
|
@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "base/random.h"
|
||||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/widgets/checkbox.h"
|
||||
#include "ui/wrap/padding_wrap.h"
|
||||
#include "ui/painter.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "main/main_session.h"
|
||||
|
@ -86,12 +87,10 @@ object_ptr<Ui::BoxContent> PrepareContactsBox(
|
|||
Data::StorySourcesList::All),
|
||||
[=] { return state->stories->height() - box->scrollTop(); });
|
||||
const auto raw = state->stories = stories.data();
|
||||
box->peerListSetAboveWidget(std::move(stories));
|
||||
|
||||
raw->entered(
|
||||
) | rpl::start_with_next([=] {
|
||||
//clearSelection();
|
||||
}, raw->lifetime());
|
||||
box->peerListSetAboveWidget(object_ptr<::Ui::PaddingWrap<>>(
|
||||
box,
|
||||
std::move(stories),
|
||||
style::margins(0, st::membersMarginTop, 0, 0)));
|
||||
|
||||
raw->clicks(
|
||||
) | rpl::start_with_next([=](uint64 id) {
|
||||
|
|
|
@ -552,7 +552,7 @@ Story *Stories::parseAndApply(
|
|||
return nullptr;
|
||||
}
|
||||
const auto expires = data.vexpire_date().v;
|
||||
const auto expired = (expires >= now);
|
||||
const auto expired = (expires <= now);
|
||||
if (expired && !data.is_pinned() && !peer->isSelf()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -618,7 +618,7 @@ StoryIdDates Stories::parseAndApply(
|
|||
return StoryIdDates();
|
||||
}, [&](const MTPDstoryItemSkipped &data) {
|
||||
const auto expires = data.vexpire_date().v;
|
||||
const auto expired = (expires >= now);
|
||||
const auto expired = (expires <= now);
|
||||
const auto fullId = FullStoryId{ peer->id, data.vid().v };
|
||||
if (!expired) {
|
||||
registerExpiring(expires, fullId);
|
||||
|
|
|
@ -337,8 +337,6 @@ void List::paintEvent(QPaintEvent *e) {
|
|||
const auto drawFull = (ratio > 0.);
|
||||
auto hq = PainterHighQualityEnabler(p);
|
||||
|
||||
paintSummary(p, rendering, summaryTop, ratio);
|
||||
|
||||
const auto count = std::max(
|
||||
layout.endIndexFull - layout.startIndexFull,
|
||||
layout.endIndexSmall - layout.startIndexSmall);
|
||||
|
@ -485,6 +483,8 @@ void List::paintEvent(QPaintEvent *e) {
|
|||
}
|
||||
p.setOpacity(1.);
|
||||
});
|
||||
|
||||
paintSummary(p, rendering, summaryTop, ratio);
|
||||
}
|
||||
|
||||
void List::validateUserpic(not_null<Item*> item) {
|
||||
|
|
Loading…
Add table
Reference in a new issue