mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix loading of chat preview messages.
This commit is contained in:
parent
d2e6003521
commit
d6e827e982
1 changed files with 8 additions and 1 deletions
|
@ -89,6 +89,13 @@ rpl::producer<SparseIdsSlice> HistoryViewer(
|
||||||
using RequestAroundInfo = SparseIdsSliceBuilder::AroundData;
|
using RequestAroundInfo = SparseIdsSliceBuilder::AroundData;
|
||||||
builder->insufficientAround(
|
builder->insufficientAround(
|
||||||
) | rpl::start_with_next([=](const RequestAroundInfo &info) {
|
) | rpl::start_with_next([=](const RequestAroundInfo &info) {
|
||||||
|
if (!info.aroundId) {
|
||||||
|
// Ignore messages-count-only requests, because we perform
|
||||||
|
// them with non-zero limit of messages and end up adding
|
||||||
|
// a broken slice with several last messages from the chat
|
||||||
|
// with a non-skip range starting at zero.
|
||||||
|
return;
|
||||||
|
}
|
||||||
history->session().api().requestHistory(
|
history->session().api().requestHistory(
|
||||||
history,
|
history,
|
||||||
info.aroundId,
|
info.aroundId,
|
||||||
|
@ -155,7 +162,7 @@ rpl::producer<SparseIdsMergedSlice> HistoryMergedViewer(
|
||||||
};
|
};
|
||||||
const auto peerId = history->peer->id;
|
const auto peerId = history->peer->id;
|
||||||
const auto topicRootId = MsgId();
|
const auto topicRootId = MsgId();
|
||||||
const auto migratedPeerId = migrateFrom ? migrateFrom->id : peerId;
|
const auto migratedPeerId = migrateFrom ? migrateFrom->id : PeerId(0);
|
||||||
using Key = SparseIdsMergedSlice::Key;
|
using Key = SparseIdsMergedSlice::Key;
|
||||||
return SparseIdsMergedSlice::CreateViewer(
|
return SparseIdsMergedSlice::CreateViewer(
|
||||||
Key(peerId, topicRootId, migratedPeerId, universalAroundId),
|
Key(peerId, topicRootId, migratedPeerId, universalAroundId),
|
||||||
|
|
Loading…
Add table
Reference in a new issue