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

Track unread mentions and unread reactions the same way.

This commit is contained in:
John Preston
2022-01-26 19:01:40 +03:00
parent 6207770120
commit e9c79886d2
31 changed files with 885 additions and 347 deletions

View File

@@ -1303,7 +1303,14 @@ void Session::photoLoadFail(
void Session::markMediaRead(not_null<const DocumentData*> document) {
const auto i = _documentItems.find(document);
if (i != end(_documentItems)) {
_session->api().markMediaRead({ begin(i->second), end(i->second) });
auto items = base::flat_set<not_null<HistoryItem*>>();
items.reserve(i->second.size());
for (const auto &item : i->second) {
if (item->isUnreadMention() || item->isIncomingUnreadMedia()) {
items.emplace(item);
}
}
_session->api().markContentsRead(items);
}
}