mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Fix dm counts after restart
This commit is contained in:
parent
f62cb77680
commit
ada20253e7
1 changed files with 7 additions and 1 deletions
|
@ -294,7 +294,7 @@ CommunitiesModel::initializeSidebar()
|
|||
std::map<std::string, std::set<std::string>> spaceParents;
|
||||
|
||||
auto infos = cache::roomInfo();
|
||||
for (auto it = infos.begin(); it != infos.end(); it++) {
|
||||
for (auto it = infos.begin(); it != infos.end(); ++it) {
|
||||
if (it.value().is_space) {
|
||||
spaces_[it.key()] = it.value();
|
||||
isSpace.insert(it.key().toStdString());
|
||||
|
@ -318,6 +318,12 @@ CommunitiesModel::initializeSidebar()
|
|||
e.notification_count = it->notification_count;
|
||||
globalUnreads.notification_count += it->notification_count;
|
||||
globalUnreads.highlight_count += it->highlight_count;
|
||||
|
||||
if (std::find(begin(directMessages_), end(directMessages_), it.key().toStdString()) !=
|
||||
end(directMessages_)) {
|
||||
dmUnreads.notification_count += it->notification_count;
|
||||
dmUnreads.highlight_count += it->highlight_count;
|
||||
}
|
||||
}
|
||||
|
||||
// NOTE(Nico): We build a forrest from the Directed Cyclic(!) Graph of spaces. To do that we
|
||||
|
|
Loading…
Reference in a new issue