mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Slightly refactored AdminLog::GenerateItems.
This commit is contained in:
parent
551e1f787c
commit
d6a30c4853
2 changed files with 464 additions and 232 deletions
|
@ -788,7 +788,10 @@ void InnerWidget::addEvents(Direction direction, const QVector<MTPChannelAdminLo
|
||||||
: newItemsForDownDirection;
|
: newItemsForDownDirection;
|
||||||
addToItems.reserve(oldItemsCount + events.size() * 2);
|
addToItems.reserve(oldItemsCount + events.size() * 2);
|
||||||
for (const auto &event : events) {
|
for (const auto &event : events) {
|
||||||
event.match([&](const MTPDchannelAdminLogEvent &data) {
|
const auto &data = event.match([](const MTPDchannelAdminLogEvent &d)
|
||||||
|
-> const MTPDchannelAdminLogEvent & {
|
||||||
|
return d;
|
||||||
|
});
|
||||||
const auto id = data.vid().v;
|
const auto id = data.vid().v;
|
||||||
if (_eventIds.find(id) != _eventIds.end()) {
|
if (_eventIds.find(id) != _eventIds.end()) {
|
||||||
return;
|
return;
|
||||||
|
@ -818,7 +821,6 @@ void InnerWidget::addEvents(Direction direction, const QVector<MTPChannelAdminLo
|
||||||
std::swap(addToItems[from + i], addToItems[full - i - 1]);
|
std::swap(addToItems[from + i], addToItems[full - i - 1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
auto newItemsCount = _items.size() + ((direction == Direction::Up) ? 0 : newItemsForDownDirection.size());
|
auto newItemsCount = _items.size() + ((direction == Direction::Up) ? 0 : newItemsForDownDirection.size());
|
||||||
if (newItemsCount != oldItemsCount) {
|
if (newItemsCount != oldItemsCount) {
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue