| 2024 | } |
| 2025 | |
| 2026 | void Session::requestItemRepaint(not_null<const HistoryItem*> item, QRect r) { |
| 2027 | _itemRepaintRequest.fire_copy(item); |
| 2028 | auto repaintGroupLeader = false; |
| 2029 | auto repaintView = [&](not_null<const ViewElement*> view) { |
| 2030 | if (view->isHiddenByGroup()) { |
| 2031 | repaintGroupLeader = true; |
| 2032 | } else { |
| 2033 | requestViewRepaint(view, r); |
| 2034 | } |
| 2035 | }; |
| 2036 | enumerateItemViews(item, repaintView); |
| 2037 | if (repaintGroupLeader) { |
| 2038 | if (const auto group = groups().find(item)) { |
| 2039 | const auto leader = group->items.front(); |
| 2040 | if (leader != item) { |
| 2041 | enumerateItemViews(leader, repaintView); |
| 2042 | } |
| 2043 | } |
| 2044 | } |
| 2045 | const auto history = item->history(); |
| 2046 | if (history->lastItemDialogsView().dependsOn(item)) { |
| 2047 | history->updateChatListEntry(); |
| 2048 | } |
| 2049 | if (const auto topic = item->topic()) { |
| 2050 | if (topic->lastItemDialogsView().dependsOn(item)) { |
| 2051 | topic->updateChatListEntry(); |
| 2052 | } |
| 2053 | } |
| 2054 | if (const auto sublist = item->savedSublist()) { |
| 2055 | if (sublist->lastItemDialogsView().dependsOn(item)) { |
| 2056 | sublist->updateChatListEntry(); |
| 2057 | } |
| 2058 | } |
| 2059 | } |
| 2060 | |
| 2061 | rpl::producer<not_null<const HistoryItem*>> Session::itemRepaintRequest() const { |
| 2062 | return _itemRepaintRequest.events(); |
no test coverage detected