summary refs log tree commit diff
path: root/src/Cache.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-03-19 14:04:13 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2023-03-19 14:04:13 +0100
commitfafb9cc4a614b69bbd9299e784fa0652ebe1cf2f (patch)
tree05c4799385a56dde9793ac37eee0e657bf84904f /src/Cache.cpp
parentFix space-community wording (diff)
downloadnheko-fafb9cc4a614b69bbd9299e784fa0652ebe1cf2f.tar.xz
Don't try to load emotes from space parents we are not in
Diffstat (limited to '')
-rw-r--r--src/Cache.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp
index 7471ec40..274b0840 100644
--- a/src/Cache.cpp
+++ b/src/Cache.cpp
@@ -4179,8 +4179,15 @@ Cache::getImagePacks(const std::string &room_id, std::optional<bool> stickers)
 
           for (const auto &parent :
                getStateEventsWithType<mtx::events::state::space::Parent>(txn, current_room)) {
-              if (parent.content.canonical && parent.content.via && !parent.content.via->empty())
-                  addRoomAndCanonicalParents(parent.state_key);
+              if (parent.content.canonical && parent.content.via && !parent.content.via->empty()) {
+                  try {
+                      addRoomAndCanonicalParents(parent.state_key);
+                  } catch (const lmdb::error &) {
+                      nhlog::db()->debug("Skipping events from parent community, because we are "
+                                         "not joined to it: {}",
+                                         parent.state_key);
+                  }
+              }
           }
       };