2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Recount grouping after leader caption edit.

This commit is contained in:
John Preston
2017-12-16 19:25:21 +04:00
parent 963e969d2a
commit 1f070da202
5 changed files with 17 additions and 1 deletions

View File

@@ -2125,6 +2125,15 @@ not_null<HistoryItem*> History::findGroupLast(
return group->leader;
}
void History::recountGroupingAround(not_null<HistoryItem*> item) {
Expects(item->history() == this);
if (!item->detached() && item->groupId()) {
const auto [groupFrom, groupTill] = recountGroupingFromTill(item);
recountGrouping(groupFrom, groupTill);
}
}
auto History::recountGroupingFromTill(not_null<HistoryItem*> item)
-> std::pair<not_null<HistoryItem*>, not_null<HistoryItem*>> {
const auto recountFromItem = [&] {