summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-10-20 15:04:36 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-10-20 15:05:00 +0200
commit2902bbb7e70d509335e68660ff9314cc7cece959 (patch)
treec5922f4da6d2565a143b0b26f21092e92c710cc2 /src
parentTranslated using Weblate (Portuguese (Portugal)) (diff)
downloadnheko-2902bbb7e70d509335e68660ff9314cc7cece959.tar.xz
Fix calculating hidden space children
Diffstat (limited to 'src')
-rw-r--r--src/Cache.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp

index ecfbe6c9..5b77a9d4 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp
@@ -3420,9 +3420,15 @@ Cache::updateSpaces(lmdb::txn &txn, spacesParentsDb_.put(txn, event.state_key, space); } } + + for (const auto &r : getRoomIds(txn)) { + if (auto parent = getStateEvent<mtx::events::state::space::Parent>(txn, r, space)) { + rooms_with_updates.insert(r); + } + } } - const auto space_event_type = to_string(mtx::events::EventType::RoomPowerLevels); + const auto space_event_type = to_string(mtx::events::EventType::SpaceChild); for (const auto &room : rooms_with_updates) { for (const auto &event : @@ -3440,6 +3446,13 @@ Cache::updateSpaces(lmdb::txn &txn, pls->content.state_level(space_event_type)) { spacesChildrenDb_.put(txn, space, room); spacesParentsDb_.put(txn, room, space); + } else { + nhlog::db()->debug("Skipping {} in {} because of missing PL. {}: {} < {}", + room, + space, + event.sender, + pls->content.user_level(event.sender), + pls->content.state_level(space_event_type)); } } }