2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Improved shared story layout.

This commit is contained in:
John Preston
2023-06-13 13:36:17 +04:00
parent c133f4de69
commit 1c41df364c
9 changed files with 107 additions and 56 deletions

View File

@@ -742,11 +742,12 @@ void Stories::sendResolveRequests() {
auto leftToSend = kMaxResolveTogether;
auto byPeer = base::flat_map<PeerId, QVector<MTPint>>();
for (auto i = begin(_resolvePending); i != end(_resolvePending);) {
auto &[peerId, ids] = *i;
const auto peerId = i->first;
auto &ids = i->second;
auto &sent = _resolveSent[peerId];
if (ids.size() <= leftToSend) {
sent = base::take(ids);
i = _resolvePending.erase(i);
i = _resolvePending.erase(i); // Invalidates `ids`.
leftToSend -= int(sent.size());
} else {
sent = {