diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-07-16 03:49:41 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-07-16 03:49:41 +0200 |
commit | ada20253e7b237bb0a50d80ed48586279fb17219 (patch) | |
tree | 9f621ddc303b0f65a4df37fd1146a61ccee2266b | |
parent | Merge pull request #1062 from Nheko-Reborn/perSpaceNotifs (diff) | |
download | nheko-ada20253e7b237bb0a50d80ed48586279fb17219.tar.xz |
Fix dm counts after restart
-rw-r--r-- | src/timeline/CommunitiesModel.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/timeline/CommunitiesModel.cpp b/src/timeline/CommunitiesModel.cpp index c75f4265..e254d7f9 100644 --- a/src/timeline/CommunitiesModel.cpp +++ b/src/timeline/CommunitiesModel.cpp @@ -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 |