| 607 | } |
| 608 | |
| 609 | void SavedMessages::updateUnreadCounts( |
| 610 | MsgId readTillId, |
| 611 | const base::flat_map<not_null<SavedSublist*>, int> &counts) { |
| 612 | for (const auto &[peer, sublist] : _sublists) { |
| 613 | const auto raw = sublist.get(); |
| 614 | const auto i = counts.find(raw); |
| 615 | const auto count = (i != end(counts)) ? i->second : 0; |
| 616 | if (raw->unreadCountCurrent() != count) { |
| 617 | raw->setInboxReadTill(readTillId, count); |
| 618 | } |
| 619 | } |
| 620 | } |
| 621 | |
| 622 | rpl::producer<> SavedMessages::destroyed() const { |
| 623 | if (!_parentChat) { |
nothing calls this directly
no test coverage detected